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 :: django model different schema 
Python :: cache pyspark 
Python :: join two querysets django 
Python :: pop element from heap python 
Python :: create new dataframe from existing data frame python 
Python :: i have two versions of python installed mac 
Python :: split string to list 
Python :: python create a set of class 
Python :: session has key python 3 
Python :: csv in python 
Python :: Python Create a nonlocal variable 
Python :: python single line comment 
Python :: python program to find sum of natural numbers using recursion 
Python :: combining strings 
Python :: Read excel formula value python openpyxl 
Python :: python check if string is url 
Python :: how to repeat code in python until a condition is met 
Python :: how to get last letter of string python 
Python :: replace in lists py 
Python :: get hex code of character python 
Python :: find common string in two strings python 
Python :: matplotlib save figure without showing 
Python :: python __repr__ meaning 
Python :: pandas frequency 
Python :: convert to ascii 
Python :: function to perform pairs bootstrap estimates on linear regression parameters 
Python :: matplotlib pie edge width 
Python :: telegram.ext python 
Python :: Using Python-docx to update cell content of a table 
Python :: intersection of 3 array in O(n) python 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =