OpenCV Python Tutorial #3 - Cameras and VideoCapture

preview_player
Показать описание
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.

⭐️ Timestamps ⭐️
00:00 | Introduction
00:50 | Displaying video capture device
07:11 | Mirroring video multiple times

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
💰 Courses & Merch 💰

🔗 Social Medias 🔗

🎬 My YouTube Gear 🎬

💸 Donations 💸
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️

⭐️ Tags ⭐️
- Images within OpenCV
- Image Manipulation OpenCV
- Image Fundamentals OpenCV
- Python
- Computer vision
- Cameras and video capture

⭐️ Hashtags ⭐️
#OpenCV #Python #CameraCapture
Рекомендации по теме
Комментарии
Автор

What the heck i just started learning opencv and i found you channel and you just started uploading tutorials. Perfect lol

kingchavez
Автор

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 😎

barrotem
Автор

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)

dont_ask_
Автор

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!

leonvanzyl
Автор

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.

sunwukong
Автор

I like this series, very easy to follow as always, looking forward to the next one.. Thank You.

jameswilkinson
Автор

You are great in the way you explain things ! That shows a lot of control to what you do ! Thanks a lot

cherifboumaiza
Автор

Awesome tutorial man!

Btw, you can still do it with the 4 different rotations if they are all squares. It looks really trippy...
Here's the code:

import numpy as np
import cv2

cap = cv2.VideoCapture(0)

while True:
ret, frame = cap.read()
h = frame.shape[0]
w = frame.shape[1]
strip = abs(w - h)//2
edge = min(w, h)

square = np.zeros((edge, edge, frame.shape[2]), np.uint8)
square = frame[:, strip:-strip]

small = cv2.resize(square, (0, 0), fx=0.5, fy=0.5)

square[:edge//2, :edge//2] = cv2.rotate(small, cv2.ROTATE_90_CLOCKWISE)
square[edge//2:, :edge//2] = cv2.rotate(small, cv2.ROTATE_180)
square[:edge//2, edge//2:] = cv2.rotate(small,
square[edge//2:, edge//2:] = small

cv2.imshow('frame', square)

if cv2.waitKey(1) == ord('p'):
break

cap.release()
cv2.destroyAllWindows()

ihatethesensors
Автор

Looking forward for part #4... Thank you for the awesome tutorials.

MarceloRodrigues-yxty
Автор

Hi.
great stuff for opencv beginners. thanks for the goodwill and the work done to make these videos available

avivran
Автор

use cv2.VideoCapture(0, cv2.CAP_DSHOW)

If cv2.VideoCapture(0) is taking awhile to display webcam

itsjxelito
Автор

You explained everything so simply and details

abdullatifnizamani
Автор

Part 4 Coming Soon, he should have said

CodingWorm
Автор

Will u upload videos on object detection using yolo?

HipHop-czos
Автор

Great tutorials Tim. Keep making them.

droneguy
Автор

Love your vids tim!! Excited for the codejam 3 results

ananthramvijayaraj
Автор

I had to make some changes to make the code work for me but at the end it did so thanks! I love it

NHYCK
Автор

Hello Tim can you make a video "python STATIC TYPING with mypy"? It turns dynamic language to complete static language.

alijebrailzade
Автор

15:30 Tim, Can we somehow make use of the .T Attribute of numpy ndarray so as to swap the the height and width?

greenjumbo-v
Автор

thank you for your lecture
wonder
Start video recording key = 'F5'
Video recording pause key ='F6'
End section (off) key ='q'
If you can tell me how to do it, thank you.

dhxbcmd