import cv2
import numpy as np
cap1 = cv2.VideoCapture(0)
while True:
ret1,img1 = cap1.read()
cv2.imshow('video output1', img1)
k=cv2.waitKey(10)& 0xff
if k==27:
break
cap1. release()
cv2.destroyAllWindows()
Usb Webcam Preview Snippet
Prerequisits
1. OpenCv
If installing on raspbian jessie
pip3 install opencv-python
If On RHEL / Ubuntu
sudo yum install python36
sudo python3.6 -m pip install opencv-python
Prerequisits
1. OpenCv
If installing on raspbian jessie
pip3 install opencv-python
If On RHEL / Ubuntu
sudo yum install python36
sudo python3.6 -m pip install opencv-python
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.