mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Add FPS test script.
This commit is contained in:
parent
014847da5d
commit
027d548300
14
usr/examples/15-Tests/fps.py
Normal file
14
usr/examples/15-Tests/fps.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# 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())
|
||||||
Loading…
Reference in New Issue
Block a user