logo

在灰度识别中,threshold应该这样设置值??

2021-07-26 10:23
P
cxr1
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time=2000)
sensor.set_auto_gain(False)  # must be turned off for color tracking
sensor.set_auto_whitebal(False)  # must be turned off for color tracking
clock = time.clock()

这个设置中

threshold = [53, 238]

阈值为啥设置成这样,

为啥阈值是两个值,改变这两个值对灰色有啥影响吗?

P
cxr1

# 跟踪一条黑线。使用[(128,255)]来跟踪白线。

GRAYSCALE_THRESHOLD = [(0, 64)]

#设置阈值,如果是黑线,GRAYSCALE_THRESHOLD = [(0, 64)];

#如果是白线,GRAYSCALE_THRESHOLD = [(128,255)]

这个是巡线小车的,

P
cxr1

机器人巡线里的例子

2021-07-26 17:50
I
网红小智智 星瞳科技

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