Skip to content

Instantly share code, notes, and snippets.

@boochow
Created November 17, 2019 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boochow/67860df08f8642606605c0e8e630c8e1 to your computer and use it in GitHub Desktop.
Save boochow/67860df08f8642606605c0e8e630c8e1 to your computer and use it in GitHub Desktop.
import sensor, lcd, image
import time
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_hmirror(0)
sensor.run(1)
sensor.skip_frames()
lcd.init(freq=15000000)
min_degree = 0
max_degree = 179
while(True):
img = sensor.snapshot()
img.lens_corr(1.06,zoom=1.0)
for l in img.find_lines(threshold = 2500, theta_margin = 25, rho_margin = 25):
if (min_degree <= l.theta()) and (l.theta() <= max_degree):
img.draw_line(l.line(), color = (255, 0, 0))
lcd.display(img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment