Created
October 28, 2021 06:38
-
-
Save Nithilaa/6b8a334c59ff49f5d76f39d09b307555 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
rows, cols, ch = img.shape | |
src_points = np.float32([[0,0], [cols-1,0], [0,rows-1]]) | |
dst_points = np.float32([[cols-1,0], [0,0], [cols-1,rows-1]]) | |
matrix = cv2.getAffineTransform(src_points, dst_points) | |
img_afftran = cv2.warpAffine(img, matrix, (cols,rows)) | |
cv2.imshow("Affine Transformation (Mirror)", img_afftran) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment