我使用的SimpleBlobDetector具有以下指定的参数:
# Parameters
params = cv2.SimpleBlobDetector_Params()
params.filterByArea = True
params.minArea = 1500
params.filterByCircularity = True
params.minCircularity = 0.5
params.filterByConvexity = True
params.minConvexity = 0.9
params.filterByInertia = True
params.minInertiaRatio = 0.7
params.minDistBetweenBlobs = 10
params.filterByColor = False
# Create a detector with the parameters
detector = cv2.SimpleBlobDetector(params)
keypoints = detector.detect(dilated)
im_with_keypoints = cv2.drawKeypoints(dilated, keypoints, np.array([]), (0, 0, 255),cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)
# Display result
cv2.imshow("Keypoints", im_with_keypoints)
这会产生以下结果。如您所见,未检测到某些“清洁”圆圈,而检测到其他边缘较粗糙的圆圈。可能有什么问题?