Created
April 12, 2021 04:50
-
-
Save bhomaidan1990/49b544914af19c2c1113ec20037eab2f to your computer and use it in GitHub Desktop.
grabber script to capture images continuously on a raspberry pi 3 module
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 cv2 | |
from time import sleep | |
resolution = (1024, 768) | |
cap = cv2.VideoCapture(0) | |
cap.set(cv2.CAP_PROP_FRAME_WIDTH, resolution[0]) # max: 2592 | |
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, resolution[1]) # max: 1944 | |
while(True): | |
status , frame = cap.read() | |
cv2.imwrite('/home/pi1/vision/image.jpg', frame) | |
sleep(1) | |
cap.release() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment