Created
November 17, 2019 14:37
-
-
Save boochow/67860df08f8642606605c0e8e630c8e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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