openmv/scripts/examples/01-Camera/01-Video-Recording/imageio_read.py
iabdalkader 0ab46ec66f scripts/examples: Update examples.
Remove sensor code that's not needed in some scripts.
2023-10-15 19:40:08 +02:00

18 lines
456 B
Python

# Image Reader Example
#
# NOTE: This example requires an SD card.
#
# This example shows how to use the Image Reader object to replay a raw video file.
import image
import time
stream = image.ImageIO("/stream.bin", "r")
clock = time.clock() # Create a clock object to track the FPS.
while True:
clock.tick()
img = stream.read(copy_to_fb=True, loop=True, pause=True)
# Do machine vision algorithms on the image here.
print(clock.fps())