openmv/usr/examples/09-Feature-Detection/qrcodes_with_lens_zoom.py
Kwabena W. Agyeman 0e89b655bf Made set_windowing simpilier.
Tested with updated qr code example script.
2017-01-12 17:41:40 -05:00

22 lines
585 B
Python

# QRCode Example
#
# This example shows the power of the OpenMV Cam to detect QR Codes
# without needing lens correction.
import sensor, image, time
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.VGA)
sensor.set_windowing((240, 240)) # look at center 240x240 pixels of the VGA resolution.
sensor.skip_frames(30)
sensor.set_auto_gain(False) # must turn this off to prevent image washout...
clock = time.clock()
while(True):
clock.tick()
img = sensor.snapshot()
for code in img.find_qrcodes():
print(code)
print(clock.fps())