OpenCV Python Tutorial #3 – Cameras and VideoCapture

Welcome to this Python OpenCV tutorial. In this video, I’ll be talking about cameras and video capture within OpenCV. Specifically, I’ll be showing you how we can load our webcam, how we can view that in live time, and how we can manipulate the image from the camera feed.

💻 AlgoExpert is the coding interview prep platform that I used to ace my Microsoft and Shopify interviews. Check it out and get a discount on the platform using the code “techwithtim”

Similar Posts

46 thoughts on “OpenCV Python Tutorial #3 – Cameras and VideoCapture
  1. hey "tech with tim youtube ":) , I just started open cv course and I am really enjoying it :).

    but should I need to master the math behind openCV functions ???? to be a good programmer ………whatever 🙂 ………..

  2. A quick question ,could we have also used frame.shape[1] instead of cap.get(3) as well as for height? if we could or could not , can you please justify.Thank You for such a good video.

  3. Hi Tim,
    I'm a recent subscriber to your channel. I've been coding now for 13 years, but is new to Python. Your knowledge is impressive young man, and your explanations are crystal clear. Keep up the brilliant work!

  4. Try this for 2nd and 4th quadrant upside down……….

    image[:height//2,:width//2] = smaller_frame[::-1]

    image[:height//2,width//2:] = smaller_frame

    image[height//2:,width//2:] = smaller_frame[::-1]

    image[height//2:,:width//2] = smaller_frame

  5. I am about to finish a face recognition project using OpenCV and this appears to be a great series for those who wish to learn the basics.
    Ty so much Tim ! You make a difference for the future generations 😎

  6. Is there a better way to select the devices than by arbitrary number? Like for instance by name of the device or usb port of the webcam?
    I had looked into it but I could only find python-c++ solutions, which were effective, but rather complicated…
    Wondering if you knew a better solution Tim. Thank you 😀

  7. Thanks again. Very nice tutorial, I really like these. And I like the fact, that you run into errors and show what could happen and how to possibly handle these errors.

  8. Great video as always Tim. For anyone who is interested, here is a function to rotate the image to any chosen angle.

    def rotate(img, angle, rotPoint=None):

    (height, width) = img.shape[:2]

    # set rotation point as center of image if not specified
    if rotPoint is None:

    rotPoint = (width//2, height//2)

    rotMat = cv.getRotationMatrix2D(rotPoint, angle, 1.0)

    dimensions = (width,height)

    return cv.warpAffine(img, rotMat, dimensions)

Leave a Reply

Your email address will not be published. Required fields are marked *