Skip to content

Instantly share code, notes, and snippets.

@Praveen76
Created April 15, 2022 16:48
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 Praveen76/7f174a9cb7b1185e624ab30d03c572d5 to your computer and use it in GitHub Desktop.
Save Praveen76/7f174a9cb7b1185e624ab30d03c572d5 to your computer and use it in GitHub Desktop.
def translation(img,x,y):
transmat=np.float([1,0,x],[0,1,y])
dimension=(img.shape[1],img.shape[0])
return cv.warpAffine(img,transMat,dimension)
img=translation(img,100,-100)
cv.imshow('lady',img)
cv.waitkey(0)
cv.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment