你的代码写的有问题。改成这个:
import sensor, image, time
sensor.reset()
sensor.set_pixformat(sensor.RGB565) # 灰度更快
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
while(True):
clock.tick()
#lens_corr(1.8)畸变矫正
img = sensor.snapshot().lens_corr(1.8)
圆 =img.find_circles(threshold = 3500, x_margin = 10, y_margin = 10, r_margin = 10,r_min = 2, r_max = 100, r_step = 2)
if(圆):
print("找到了",c)
else:
print("五")