Skip to content

Instantly share code, notes, and snippets.

@Nithilaa
Created October 28, 2021 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nithilaa/08e6567fc9200bfac6f9e3b2e214a7df to your computer and use it in GitHub Desktop.
Save Nithilaa/08e6567fc9200bfac6f9e3b2e214a7df to your computer and use it in GitHub Desktop.
import numpy as np
rows, cols, ch = img.shape
matrix_trans = np.float32([[1, 0, -70], [0, 1, -40]])
translated_img = cv2.warpAffine(img, matrix_trans, (cols, rows))
cv2.imshow("Translated image 1", translated_img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment