openmv/usr/examples/16-Codes/qrcodes_with_lens_zoom.py
Kwabena W. Agyeman e9e48d5028 Update QRCode
Fixed issues with QRCode method in response to user reqeust on the
forums: http://forums.openmv.io/viewtopic.php?
f=6&t=286&p=1799&hilit=qrcode#p1799.
2017-05-27 16:21:10 -04:00

23 lines
638 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():
img.draw_rectangle(code.rect(), color = 127)
print(code)
print(clock.fps())