From a165c671323e5380c0b4dbbbf531b2c01efe60a9 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Sun, 1 May 2016 16:01:35 +0200 Subject: [PATCH] Set sharpness on OV7725 for edge detection. --- usr/examples/04-Image-Filters/edge_detection.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr/examples/04-Image-Filters/edge_detection.py b/usr/examples/04-Image-Filters/edge_detection.py index 90f88715b..d2cc8040c 100644 --- a/usr/examples/04-Image-Filters/edge_detection.py +++ b/usr/examples/04-Image-Filters/edge_detection.py @@ -19,6 +19,13 @@ sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(10) # Let new settings take affect. clock = time.clock() # Tracks FPS. +# On the OV7725 sensor, edge detection can be enhanced +# significantly by setting the sharpness/edge registers. +# Note: This will be implemented as a function later. +if (sensor.get_id() == sensor.OV7725): + sensor.__write_reg(0xAC, 0xDF) + sensor.__write_reg(0x8F, 0xFF) + while(True): clock.tick() # Track elapsed milliseconds between snapshots(). img = sensor.snapshot() # Take a picture and return the image.