How to crop the biggest object in image with python opencv?
问题 I want to crop the biggest object in the image (Characters). This code only works if there is no line (shown in the first image). But I need to ignore the line and make the image of the second image. Only crop the biggest object image. import cv2 x1, y1, w1, h1 = (0,0,0,0) points = 0 # load image img = cv2.imread('Image.jpg') gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # convert to grayscale # threshold to get just the signature retval, thresh_gray = cv2.threshold(gray, thresh=100, maxval