为什么霍夫变换查找直线检测不到到黄色直线?
-
为什么霍夫变换查找直线检测不到到黄色直线?
-
@1qx5 enable_lens_corr = False # turn on for straighter lines...
import sensor, image, time
sensor.reset()
sensor.set_pixformat(sensor.RGB565) # grayscale is faster
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()min_degree = 0
max_degree = 179while(True):
clock.tick()
img = sensor.snapshot()
if enable_lens_corr: img.lens_corr(1.8) # for 2.8mm lens...for l in img.find_lines(threshold = 1000, theta_margin = 30, rho_margin = 30): if (min_degree <= l.theta()) and (l.theta() <= max_degree): img.draw_line(l.line(), color = (255, 0, 0)) print("FPS %f" % clock.fps())
-
请提供一下你的图片。
-
-
黄色的边缘不明显。你可以先二值化,然后再找