# Get the minimum area rectangle for the contour
min_rect = cv2.minAreaRect(contour) # Returns (center, (width, height), angle)
box = cv2.boxPoints(min_rect) # Get four corner points of the rectangle
box = np.int8(box) # Convert to integer coordinates
# Draw the rotated bounding box
cv2.polylines(frame, [box], True, (0, 255, 0), 2)
[code]# Get the minimum area rectangle for the contour min_rect = cv2.minAreaRect(contour) # Returns (center, (width, height), angle) box = cv2.boxPoints(min_rect) # Get four corner points of the rectangle box = np.int8(box) # Convert to integer coordinates
# Draw the rotated bounding box cv2.polylines(frame, [box], True, (0, 255, 0), 2) [/code] Я получаю эту ошибку во время работы: [code]cv2.polylines(frame, [box], True, (0, 255, 0), 2) [/code] [code]cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\drawing.cpp:2465: error: (-215:Assertion failed) p.checkVector(2, CV_32S) >= 0 in function 'cv::polylines'. [/code] Как это решить?
Я работаю над сценарием детектора лиц.
Мне удалось создать набор данных, захватив изображения с веб-камеры, сохранив их в локальном каталоге и сохранив данные в моей локальной базе данных.
но когда я пытаюсь запустить основное приложение для...