Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

capture image raspberry pi usb camera

import cv2

cam = cv2.VideoCapture(0)

while True:
	ret, image = cam.read()
	cv2.imshow('Imagetest',image)
	k = cv2.waitKey(1)
	if k != -1:
		break
cv2.imwrite('/home/pi/testimage.jpg', image)
cam.release()
cv2.destroyAllWindows()
Comment

PREVIOUS NEXT
Code Example
Python :: python return number of characters in string 
Python :: how to append panda columns using loop 
Python :: convert list to set python 
Python :: df astype 
Python :: async python 
Python :: set an index to a dataframe from another dataframe 
Python :: python print n numbers 
Python :: is tuple immutable in python 
Python :: splitting column values in pandas 
Python :: ModuleNotFoundError: No module named 
Python :: how to get a random number in python 
Python :: python generate pdf from template 
Python :: get ip address python 
Python :: python timeout exception 
Python :: transpose list 
Python :: install glob module in linux 
Python :: python count same number in list 
Python :: django example 
Python :: set environment variable flask app 
Python :: python 3.11 release date 
Python :: how to make a dict from a file py 
Python :: Python Difference between two dates and times 
Python :: a string starts with an uppercase python 
Python :: hashmap python 
Python :: compare two dates python 
Python :: global in python 
Python :: add reaction discord.py 
Python :: tkinter treeview 
Python :: creating dataframe 
Python :: find length of string in python 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =