openmv/scripts/examples/01-Camera/03-Event-Cameras/genx320_grayscale.py
2024-09-26 14:02:36 -07:00

23 lines
553 B
Python

# This work is licensed under the MIT license.
# Copyright (c) 2013-2024 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# This example shows off using the genx320 event camera from Prophesee.
import sensor
import time
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE) # Must always be grayscale.
sensor.set_framesize(sensor.B320X320) # Must always be 320x320.
clock = time.clock()
while True:
clock.tick()
img = sensor.snapshot()
# img.median(1) # noise cleanup.
print(clock.fps())