@kidswong999 试过了,每次阀值都会变?
L
lcwx
@lcwx
0
声望
2
楼层
299
资料浏览
0
粉丝
0
关注
lcwx 发布的帖子
-
同样的代码OPENMV无法识别roi内的颜色但是k210可以识别
import sensor, image, time thresholds = [(24, 71, 2, 63, 5, 127)] sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) 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() while(True): clock.tick() flag = [1,1] img = sensor.snapshot().lens_corr(1.8) blob1 = img.find_blobs(thresholds, roi=(123,51,50,70),pixels_threshold=330, area_threshold=500, merge=False) img.draw_rectangle((123,51,50,70), color=(0,255,0)) blob2 = img.find_blobs(thresholds, roi=(211,51,50,70),pixels_threshold=330, area_threshold=500, merge=False) img.draw_rectangle((211,51,50,70), color=(0,255,0)) if blob1: flag[0]=0 if blob2: flag[1]=0 if(flag[0]==0 and flag[1]==0 ): print('两个') if(flag[0]==1 and flag[1]==1): print('不亮')