openmv/scripts/examples/01-Camera/03-Event-Cameras/02-Genx320/genx320_grayscale_set_afk.py
Natalia Lyubova 526a704eda
Some checks failed
🔎 Check Code Formatting / formatting-check (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV2) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Has been cancelled
🔥 Firmware Build / code-size-report (push) Has been cancelled
🔥 Firmware Build / stable-release (push) Has been cancelled
🔥 Firmware Build / development-release (push) Has been cancelled
sensors/GenX320: Adding IOCTL to control Anti-Flicker filter (AFK). (#2617)
* sensors/GenX320: Adding IOCTL to control Anti-Flicker filter (AFK).
2025-02-23 14:51:29 +01:00

30 lines
932 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 sensor from Prophesee and controlling
# AntiFlicKer (AFK) filter bloc in the GenX320 digital pipeline.
# AFK allows to detect periodic changes of given frequencies in the scene and filter them out.
import sensor
import time
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE) # Must always be grayscale.
sensor.set_framesize(sensor.B320X320) # Must always be 320x320.
sensor.set_framerate(100)
# Enables AFK filter to remove periodic data in the frequency range from 130Hz to 160Hz
sensor.ioctl(sensor.IOCTL_GENX320_SET_AFK, 1, 130, 160)
# Disables AFK filter
# sensor.ioctl(sensor.IOCTL_GENX320_SET_AFK, 0)
clock = time.clock()
while True:
clock.tick()
img = sensor.snapshot()
print(clock.fps())