logo

代码段有错误,请问如何修改呀,请大佬们有时间指点一下,非常感谢?

2019-01-07 16:10
1
_2xvc_1545910308

# Untitled - By: 16652 - 周五 1月 4 2019

import sensor, image, time

from pyb import UART

sensor.reset()

sensor.set_pixformat(sensor.RGB565)

sensor.set_framesize(sensor.QVGA)

sensor.skip_frames(time = 2000)

uart=UART(3,9600);

clock = time.clock()

while(True):

clock.tick()

img = sensor.snapshot()

img = sensor.snapshot().lens_corr(1.8)

circles = img.find_circles(threshold = 2000, x_margin = 10, y_margin = 10, r_margin = 10,

r_min = 2, r_max = 100, r_step = 2)

if circles:

data=[]

for c in circles:

img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))

data.append((c.x(),c.y()))

data_out = json.dumps(set(data))

uart.write(data_out +'\n')

2019-01-07 16:44
I
网红小智智 星瞳科技

请提具体的问题,

比如目的,具体的报错提示。