Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def snapPhoto(camera):
- for i in range(3):
- camera.capture('threaded_photo_' + str(i) + '.jpg')
- # Tried to use video port with no luck
- #camera.capture('threaded_photo_' + str(i) + '.jpg', use_video_port=True)
- def runCameraPreview():
- #for i in range(3):
- with picamera.PiCamera() as camera:
- # Get the camera ready
- time.sleep(2)
- print("Starting process")
- # try image capture in a thread
- p1 = Process(target=snapPhoto, args=(camera,))
- p1. start()
- # Do any processing
- print("Waiting")
- p1.join() # Wait for the process to return
- runCameraPreview()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement