SimpleBlobDetector无法识别更明显的圆圈

时间:2016-10-04 22:19:09

标签: opencv computer-vision geometry detection

我使用的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)

这会产生以下结果。如您所见,未检测到某些“清洁”圆圈,而检测到其他边缘较粗糙的圆圈。可能有什么问题?

result of SimpleBlobDetector

1 个答案:

答案 0 :(得分:4)

如果你添加

params.maxArea = 10000

你得到这张图片:

not too big to fail

所以我假设有一个默认的最大值,你就超过了它。