Skip to content

Instantly share code, notes, and snippets.

@thezaza101
Last active May 12, 2020 10:37
Show Gist options
  • Save thezaza101/1ab772d32ad4d5240482e9a8db647816 to your computer and use it in GitHub Desktop.
Save thezaza101/1ab772d32ad4d5240482e9a8db647816 to your computer and use it in GitHub Desktop.
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