logo

二值化后能用色块查找白色的多块目标吗,不能的话用什么好?

2018-10-07 07:47
7
Drizzt
 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")
2018-10-07 13:14
I
网红小智智 星瞳科技

可以找白色,阈值设置好就行,并没有什么问题……

2020-03-22 15:16
A
ca2g

可以找黑色吗?可以的话怎么找

2020-03-23 14:01
I
网红小智智 星瞳科技

https://singtown.com/learn/49993/