November 2016
Beginner to intermediate
941 pages
21h 55m
English
We will use a webcam in this chapter to capture video data. Let's see how to capture the video from the webcam using OpenCV-Python.
import cv2
0 input argument specifies the ID of the webcam. If you connect a USB camera, then it will have a different ID:# Initialize video capture object cap = cv2.VideoCapture(0)
# Define the image size scaling factor scaling_factor = 0.5