Image Transformations Using OpenCV
Free OpenCV course with real-time projects Start Now!!
Program 1
import cv2 import numpy as np img=cv2.imread("D://opencvapp//wildlifeImages//walking-dog.jpg") print(type(img)) cv2.imshow('Orginal Image Window',img) x=-100 y=100 trans=np.float32([[1,0,x],[0,1,y]]) dim=((img.shape[1],img.shape[0])) img1=cv2.warpAffine(img,trans,dim) cv2.imshow('Transformation Image Window',img1) cv2.waitKey(0) cv2.destroyAllWindows()
Your opinion matters
Please write your valuable feedback about DataFlair on Google