Skip to content

Instantly share code, notes, and snippets.

@KMConner
Created October 24, 2020 14:42
Show Gist options
  • Save KMConner/0ad8622af8dc7bcdbd8327a229eaeb15 to your computer and use it in GitHub Desktop.
Save KMConner/0ad8622af8dc7bcdbd8327a229eaeb15 to your computer and use it in GitHub Desktop.
Take pictures using raspberry pi camera
import cv2
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1024)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
ret, frame = cap.read()
print(ret)
cv2.imwrite('./foo.jpg', frame)
## requirements
# - numpy
# - opencv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment