qrcodes_with_lens_corr.py

# この作品はMITライセンスの下で提供されています。
# Copyright (c) 2013-2023 OpenMV LLC. 全著作権所有。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# QRコードの例
#
# この例では、レンズ補正なしでQRコードを検出できる
# レンズ補正を使用します(より高いパフォーマンスにはqrcodes_with_lens_corr.pyスクリプトを参照してください)。

import csi
import time

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.QVGA)
csi0.snapshot(time=2000)
csi0.auto_gain(False)  # 画像の白飛びを防ぐため、これをオフにする必要があります……

clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot()
    img.lens_corr(1.8)  # 2.8mmレンズには1.8の強度が適しています。
    for code in img.find_qrcodes():
        img.draw_rectangle(code.rect, color=(255, 0, 0))
        print(code)
    print(clock.fps())

results matching ""

    No results matching ""