Example: 01-Camera/03-Event-Cameras/02-Genx320/genx320_histogram_color_mode.py
# 本作品采用MIT许可证授权。
# 版权所有 (c) 2013-2024 OpenMV LLC。保留所有权利。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# 此示例展示了如何使用Prophesee的genx320事件相机。
import csi
import image
import time
csi0 = csi.CSI(cid=csi.GENX320)
csi0.reset()
csi0.pixformat(csi.GRAYSCALE)
csi0.framesize((320, 320))
csi0.brightness(128) # Leave at 128 generally (this is the default).
csi0.contrast(16) # Increase to make the image pop.
csi0.color_palette(image.PALETTE_EVT_LIGHT) # image.PALETTE_EVT_DARK for dark mode.
# The default frame rate is 50 FPS. You can change it between ~20 FPS and ~350 FPS.
csi0.framerate(50)
clock = time.clock()
while True:
clock.tick()
img = csi0.snapshot()
# img.median(1) # 噪声清理。
print(clock.fps())