Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to show webcam in opencv

import cv2

cap = cv2.VideoCapture(0)

while True:
    success, img = cap.read()
    cv2.imshow("Webcam", img)
    if cv2.waitKey(1) == ord('q'):
        break
Comment

Opencv Webcam

import cv2
frameWidth = 640
frameHeight = 480
cap = cv2.VideoCapture(0)
cap.set(3, frameWidth)
cap.set(4, frameHeight)
cap.set(10,150)
while True:
    success, img = cap.read()
    cv2.imshow("Result", img)
    if cv2.waitKey(1) and 0xFF == ord('q'):
        break
Comment

PREVIOUS NEXT
Code Example
Python :: plt show 2 images 
Python :: torchviz 
Python :: python finite difference approximation backward difference 
Python :: python [a]*b means [a,a,...b times] v2 
Python :: read text file in python 
Python :: find nth root of m using python 
Python :: how to compare current date to future date pythono 
Python :: python virus 
Python :: how to import subprocess in python 
Python :: matplotlib rc params 
Python :: how to change icon in pygame 
Python :: openpyxl add worksheet 
Python :: numpy arrays equality 
Python :: python convert remove spaces from beginning of string 
Python :: how to swap tuple 
Python :: print complete dataframe pandas 
Python :: pickle.load python 
Python :: pandas absolute value 
Python :: sql alchemy engine all tables 
Python :: nan float python 
Python :: how to add up a list in python 
Python :: download youtube-dl python 
Python :: python execute command with variable 
Python :: python get names of all classes 
Python :: split string by length python 
Python :: confusion matrix python code 
Python :: how to check if all characters in string are same python 
Python :: ffmpeg python cut video 
Python :: os listdir sort by date 
Python :: spread operator python 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =