У меня есть проблема, которая разрушила мой проект:
def extract_candidate_rectangles(image, contours):
rectangles = []
for i, cnt in enumerate(contours):
min_rect = cv.minAreaRect(cnt)
if validate_contour(min_rect):
x, y, w, h = cv.boundingRect(cnt)
plate_img = image[y:y+h, x:x+w]
if is_max_white(plate_img):
copy = image.copy()
cv.rectangle(copy, (x, y), (x + w, y + h), (0, 255, 0), 2)
rectangles.append(plate_img)
cv.imshow("candidates", copy)
cv.waitKey(0)
return rectangles
и ошибка:
Using TensorFlow backend.
Traceback (most recent call last):
File "/home/muhammad/Coding/Python/PlateDetectionCodes/PlateDetection/main.py", line 43, in <module>
plates = extract_candidate_rectangles(resized.copy(), contours)
File "/home/muhammad/Coding/Python/PlateDetectionCodes/PlateDetection/extractor.py", line 65, in extract_candidate_rectangles
min_rect = cv.minAreaRect(cnt)
cv2.error: OpenCV(4.2.0) /io/opencv/modules/imgproc/src/convhull.cpp:137: error: (-215:Assertion failed) total >= 0 && (depth == CV_32F || depth == CV_32S) in function 'convexHull'
Я буду рад, если кто-нибудь сможет помочь!