Closed yecheng-9860 closed 3 months ago
Maybe there is something wrong with def estimate_largest_interior_rectangle(self, mask):
And i cannot correctly import largestinteriorrectangle
,then I commented out the function and rewrote it with reference to issues:119 . It works out.
def estimate_largest_interior_rectangle(self, mask):
# largestinteriorrectangle is only imported if cropping
# is explicitly desired (needs some time to compile at the first run!)
# transform the panorama image to grayscale and threshold it
# gray = cv.cvtColor(mask, cv.COLOR_BGR2GRAY)
thresh = cv.threshold(mask, 0, 255, cv.THRESH_BINARY)[1]
# Finds contours from the binary image
cnts = cv.findContours(thresh.copy(), cv.RETR_EXTERNAL, cv.CHAIN_APPROX_SIMPLE)
cnts = imutils.grab_contours(cnts)
# get the maximum contour area
c = max(cnts, key=cv.contourArea)
# get a bbox from the contour area
(x, y, w, h) = cv.boundingRect(c)
# crop the image to the bbox coordinates
mask = mask[y:y + h, x:x + w]
lir = Rectangle(*(x, y, w, h))
return lir
Are you on Windows 11?
Could you upgrade numba and check if it solves the problem?
I keep getting errors in the reproduction process but can't find a solution. Maybe there is something wrong with my configuration file?
My requirements.txt
python==3.8
Traceback (most recent call last):