【发布时间】:2019-03-18 02:34:59
【问题描述】:
我遇到了 Simple Blob Detector 无法检测到大于 300 的 Blob 的问题。
我有这张图片,里面有一个乐高积木,但无论我给它哪个区域,它都不会检测到它。有任何想法吗?我正在尝试获取乐高的颜色,但我想过滤掉其他所有内容
params = cv2.SimpleBlobDetector_Params()
params.filterByArea = True
params.minArea = 500 # Tried using from 300 - 3000 and can't get a detection
params.filterByCircularity = False
params.filterByColor = False
params.filterByConvexity = False
params.filterByInertia = False
detector = cv2.SimpleBlobDetector_create(params)
keypoints = detector.detect(img)
【问题讨论】:
-
也许您需要将输入图像读取为灰度。另见stackoverflow.com/questions/8076889/…
-
@fmw42 BGR 图像会自动转换为灰度,因此除非您想在特定通道中检测,否则无需显式执行此操作。
-
@Piglet这对我来说没有意义。这是什么命令?读取彩色图像时,读取命令必须指定转换为灰度,否则所有彩色图像都会变成灰度。
标签: python opencv computer-vision