From c537c7ad294107b1804975c4e7ed0dc9886990cf Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 7 Jun 2023 10:22:02 +0200 Subject: better road detection --- nicla/downscale.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 nicla/downscale.py (limited to 'nicla/downscale.py') diff --git a/nicla/downscale.py b/nicla/downscale.py new file mode 100644 index 0000000..738b4bb --- /dev/null +++ b/nicla/downscale.py @@ -0,0 +1,19 @@ +import sensor, image, time, math + +sensor.reset() +sensor.set_pixformat(sensor.RGB565) +sensor.set_framesize(sensor.HVGA) +sensor.skip_frames(time = 2000) +sensor.set_vflip(True) +sensor.set_hmirror(True) +clock = time.clock() + +def main(): + img = sensor.snapshot() + img.to_grayscale() + img.scale(copy_to_fb=True, x_size=100) + +if __name__ == "__main__": + while(True): + main() + clock.tick() -- cgit v1.2.3