video_capture = cv.VideoCapture('sample.mp4') Set and Get It will read and display the content of the video instead. video_capture = cv.VideoCapture(0)įor your information, you can pass in a string that represent the name of a video file. In my use case, I am going to use 0 since I only have one camera. It represent the index value of the camera (for multiple cameras). frame_width = 680 frame_height = 480 fps = 30.0 VideoCaptureĬall the VideoCapture() function and pass an integer to it. For example, you specified the size as 720 x 480 but the final output might be 680 x 480 instead. Please be noted that the final dimension of the display window might be different from what you have specified here as each webcam will have its own dimension. Next, initialize the following variables based on your preferences. If you prefer to use cv as the Python bindings, you can do so via the following code: import cv2 as cv Variables OpenCV package uses cv2 as the Python bindings.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |