Q
quy4 发布的帖子
-
RE: find_circles 函数 ,如何在历程中设置感光区域,上传电脑观看?
@quy4 sensor.set_windowing(ROI) 这个函数设置的区域最大值好小好小,不能满足需求,
-
find_circles 函数 ,如何在历程中设置感光区域,上传电脑观看?
我在find_circles 函数中设置了roi区域,但是上传到电脑上的图像并没有改变,如何改变电脑上的图像区域?
import sensor, image, time, pyb ROI=(13,0,120,120) sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) # grayscale is faster sensor.set_framesize(sensor.QQVGA) sensor.set_windowing(ROI) sensor.skip_frames(time = 2000) clock = time.clock() led = pyb.LED(1) while(True): clock.tick() led.on() img = sensor.snapshot().lens_corr(1.8) # Circle objects have four values: x, y, r (radius), and magnitude. The # magnitude is the strength of the detection of the circle. Higher is # better... # `threshold` controls how many circles are found. Increase its value # to decrease the number of circles detected... # `x_margin`, `y_margin`, and `r_margin` control the merging of similar # circles in the x, y, and r (radius) directions. # r_min, r_max, and r_step control what radiuses of circles are tested. # Shrinking the number of tested circle radiuses yields a big performance boost. for c in img.find_circles(roi=ROI,threshold = 1200, x_margin = 10, y_margin = 10, r_margin = 10, r_min = 1, r_max = 5, r_step = 2): #img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0)) print(c) #print("FPS %f" % clock.fps())