gpt4 book ai didi

opencv - SimpleBlobDetector 无法识别更明显的圆圈

转载 作者:太空宇宙 更新时间:2023-11-03 21:21:42 24 4
gpt4 key购买 nike

我正在使用具有以下指定参数的 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

最佳答案

如果你添加

params.maxArea = 10000

你得到这张图片:

not too big to fail

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

关于opencv - SimpleBlobDetector 无法识别更明显的圆圈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39862630/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com