Skip to content

Instantly share code, notes, and snippets.

@suminb
Created September 30, 2014 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suminb/8400c4390559dd9a8b43 to your computer and use it in GitHub Desktop.
Save suminb/8400c4390559dd9a8b43 to your computer and use it in GitHub Desktop.
Take a picture with a Raspberry Pi camera
import picamera
def test_camera():
with picamera.PiCamera() as camera:
camera.capture('image.jpg')
if __name__ == '__main__':
test_camera()
@suminb
Copy link
Author

suminb commented Sep 30, 2014

Taking one picture:

(camera)pi@raspberrypi ~/dev/camera $ time python camera.py

real    0m6.211s
user    0m1.670s
sys     0m0.120s

Taking ten pictures:

(camera)pi@raspberrypi ~/dev/camera $ time python camera.py

real    0m26.468s
user    0m1.740s
sys     0m0.310s

Taking 100 pictures:

(camera)pi@raspberrypi ~/dev/camera $ time python camera.py

real    3m47.392s
user    0m3.430s
sys     0m0.940s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment