genx320_histogram_grayscale_mode_with_tracking.py

# この作品はMITライセンスの下で提供されています。
# Copyright (c) 2013-2024 OpenMV LLC. 全著作権所有。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# この例では、Prophesee製のgenx320イベントカメラを使用する方法を示します。

import csi
import time

csi0 = csi.CSI(cid=csi.GENX320)
csi0.reset()
csi0.pixformat(csi.GRAYSCALE)
csi0.framesize((320, 320))
csi0.brightness(128)  # 通常は128のままにしておきます(これがデフォルトです)。
csi0.contrast(16)  # 画像を際立たせたい場合は増加させます。

# デフォルトのフレームレートは50FPSです。約20FPSから約350FPSの間で変更できます。
csi0.framerate(50)

clock = time.clock()

while True:
    clock.tick()

    img = csi0.snapshot()
    # img.median(1) # ノイズ除去。

    blobs = img.find_blobs(
        [(120, 130)], invert=True, pixels_threshold=10, area_threshold=100, merge=True
    )

    for blob in blobs:
        img.draw_detection(blob, color1=(255, 255, 255), color2=(0, 0, 0))

    print(clock.fps())

results matching ""

    No results matching ""