Last active
May 12, 2020 10:37
-
-
Save thezaza101/1ab772d32ad4d5240482e9a8db647816 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import numpy as np | |
from picamera import PiCamera | |
camera = PiCamera() | |
camera.resolution = (320, 240) | |
camera.framerate = 5 | |
time.sleep(2) | |
def getFrame(): | |
output = np.empty((240, 320, 3), dtype=np.uint8) | |
camera.capture(output, 'rgb') | |
return output | |
start = time.time() | |
i = 0 | |
while True: | |
image = getFrame() | |
i = i + 1 | |
print('.') | |
if ((time.time() -start) > 60): | |
# Print FPS | |
print(i/60) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment