Created
October 28, 2021 06:37
-
-
Save Nithilaa/92fc51efb752a8b6c8c182d550c58286 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([[0,0], [int(0.6*(cols-1)),0], [int(0.4*(cols-1)),rows-1]]) | |
matrix = cv2.getAffineTransform(src_points, dst_points) | |
img_afftran = cv2.warpAffine(img, matrix, (cols,rows)) | |
cv2.imshow("Affine Transformation", 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