import cv2 img = cv2.imread("lenna.png") crop_img = img[y:y+h, x:x+w] cv2.imshow("cropped", crop_img) cv2.waitKey(0)
References
https://stackoverflow.com/questions/15589517/how-to-crop-an-image-in-opencv-using-python
import cv2 img = cv2.imread("lenna.png") crop_img = img[y:y+h, x:x+w] cv2.imshow("cropped", crop_img) cv2.waitKey(0)
References
https://stackoverflow.com/questions/15589517/how-to-crop-an-image-in-opencv-using-python