qrcodes_with_lens_zoom.py

# Эта работа лицензирована по лицензии MIT.
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# Пример QR-кода
#
# Этот пример показывает возможности камеры OpenMV Cam по обнаружению QR-кодов
# без необходимости коррекции объектива.

import csi
import time

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.GRAYSCALE)
csi0.framesize(csi.VGA)
csi0.window((240, 240))  # рассмотрим центральные 240x240 пикселей разрешения VGA.
csi0.snapshot(time=2000)
csi0.auto_gain(False)  # нужно отключить это, чтобы предотвратить засветку изображения...

clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot()
    for code in img.find_qrcodes():
        img.draw_rectangle(code.rect, color=127)
        print(code)
    print(clock.fps())

results matching ""

    No results matching ""