What does it mean ?

Discussion related to "under the hood" OpenMV topics.
duyci
Posts: 2
Joined: Wed Feb 27, 2019 4:33 am

What does it mean ?

Postby duyci » Wed Mar 13, 2019 4:17 pm

This is the example code of the QR code. But I have some question about the this code.
What is the code mean in this line

Code: Select all

 for code in img.find_qrcodes():
And what is the behind of the find_qrcodes() function. How can I find the explanation about the some function.

Code: Select all

# QRCode Example
#
# This example shows the power of the OpenMV Cam to detect QR Codes
# using lens correction (see the qrcodes_with_lens_corr.py script for higher performance).

import sensor, image, time

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
sensor.set_auto_gain(False) # must turn this off to prevent image washout...
clock = time.clock()

while(True):
    clock.tick()
    img = sensor.snapshot()
    img.lens_corr(1.8) # strength of 1.8 is good for the 2.8mm lens.
    for code in img.find_qrcodes():
        img.draw_rectangle(code.rect(), color = (255, 0, 0))
        print(code)
    print(clock.fps())
User avatar
kwagyeman
Posts: 2802
Joined: Sun May 24, 2015 2:10 pm

Re: What does it mean ?

Postby kwagyeman » Thu Mar 14, 2019 11:55 am

Hi, the method finds QR Codes. The C code that implements it is here:

https://github.com/openmv/openmv/blob/m ... g/qrcode.c
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: Bing [Bot] and 8 guests