二值化后能用色块查找白色的多块目标吗,不能的话用什么好?
-
img = sensor.snapshot() # Take a picture and return the image. img.binary(thresholds) img.difference("/template.bmp") ###没准腐蚀 ###image.find_blobs(thresholds[, invert=False[, roi[, x_stride=2[, y_stride=1[, ###area_threshold=10[, pixels_threshold=10[, merge=False[, margin=0[, ###threshold_cb=None[, merge_cb=None]]]]]]]]]]) head_blob = img.find_blobs(thresholds, x_stride=200, y_stride=200, area_threshold=600, pixels_threshold=700, merge= True) if head_blob: img.draw_rectangle(head_blob[0].rect())#画出色块矩形和中心点 img.draw_cross(head_blob[0].cx(), head_blob.cy()) print(head_blob.count) print("u")
-
可以找白色,阈值设置好就行,并没有什么问题……
-
可以找黑色吗?可以的话怎么找
-