I need to detect semicircles on image and I find follow stuff for this:
import cv2
import numpy as npdef get_circle(img_path):im = cv2.imread(img_path, cv2.IMREAD_GRAYSCALE)detector = cv2.SimpleBlobDetector()keypoints = detector.detect(im)im_with_keypoints = cv2.drawKeypoints(im, keypoints, np.array([]), (0,0,255), cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)cv2.imshow("Keypoints", im_with_keypoints)cv2.waitKey(0)
But I give follow error when I try to run it:
Traceback (most recent call last):File "D:\giveaway_bot\main.py", line 16, in <module>get_circle("blob.png")File "D:\giveaway_bot\main.py", line 11, in get_circlekeypoints = detector.detect(im)
cv2.error: Unknown C++ exception from OpenCV code
Image: click