Skip to content

Instantly share code, notes, and snippets.

@Abhayparashar31
Created October 13, 2020 14:00
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 Abhayparashar31/9b01473431de765c0a73e81271233d91 to your computer and use it in GitHub Desktop.
Save Abhayparashar31/9b01473431de765c0a73e81271233d91 to your computer and use it in GitHub Desktop.
import cv2
img = cv2.imread("images/test.jpg")
imgCropped = img[50:283,25:190]
shape = imgCropped.shape
print(shape[0])
imgCropped = cv2.resize(imgCropped,(shape[0]*12//10,shape[1]*2))
cv2.imshow("Image cropped",imgCropped)
cv2.imshow("Image",img)
cv2.waitKey(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment