openmv/scripts/examples/Arduino/99-Tests/fps.py
iabdalkader 5a6b4b2f1c Update Examples.
* Move examples to sub dirs.
* Add Arduino examples dir.
2020-11-16 23:03:02 +02:00

15 lines
468 B
Python

# FPS Test Script.
import sensor, image, time
sensor.reset() # Initialize the camera sensor.
sensor.set_framesize(sensor.QQVGA) # or sensor.QQVGA (or others)
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
sensor.set_colorbar(True) # Enable colorbars output
clock = time.clock() # Tracks FPS.
for i in range(0, 600):
clock.tick() # Track elapsed milliseconds between snapshots().
sensor.snapshot() # Capture snapshot.
print("FPS:", clock.fps())