cropping image in cv2 code example
Example 1: cv2 crop image
import cv2
img = cv2.imread("lenna.png")
crop_img = img[y:y+h, x:x+w]
cv2.imshow("cropped", crop_img)
cv2.waitKey(0)
Example 2: how to crop the image using opencv
crop_img = img[y:y+h, x:x+w]