logo

NameError;name'RGB565'is not defined

2018-04-16 22:19
U
Maero
![0_1523888226435_5O(~3RN9I(XCUBRU

不知道为什么会出现这种问题。。。新人求教,源代码如下

import sensor,image,time

red_threshold_01=(0,35,0,50,-10,40)

sensor.reset()

sensor.set_pixformat(sensor,RGB565)

sensor.set_framesize(sensor.QQVGA)

sensor,skip_frames(10)

sensor.set_auto_whitebal(False)

clock=time.clock()

while(True):

clock.tick()

img=sensor.snapshot()

blobs=img.find_blobs([red_threshold_01],area_threshold=150)

if blobs:

print(blobs)

for b in blobs:

img.draw_rectangle(b[0:4])

img.draw_cross(b[5],b[6])

print(clock.fps())

2018-04-17 10:01
X
Yuan

是sensor.RGB565

中间是 点 而不是 逗号