OpenCV Python Tutorial #5 - Colors and Color Detection
HTML-код
- Опубликовано: 11 май 2024
- Welcome to this video in the OpenCV tutorial series! In this one, I'll be talking about colors and how to detect them. We can even detect specific colors from our video feed and only display those colors. We'll also go over color display methods like RGB, BGR, and HSV.
💻 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" algoexpert.io/techwithtim
📄 Relevant Documentation: opencv-python-tutroals.readth...
📝 Code For This Series: github.com/techwithtim/OpenCV...
🔍 Playlist: • OpenCV Python Tutorials
⭐️ Timestamps ⭐️
00:00 | Introduction
00:45 | HSV Color
06:40 | Masks
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
💰 Courses & Merch 💰
💻 The Fundamentals of Programming w/ Python: tech-with-tim.teachable.com/p...
👕 Merchandise: teespring.com/stores/tech-wit...
🔗 Social Medias 🔗
📸 Instagram: / tech_with_tim
📱 Twitter: / techwithtimm
⭐ Discord: / discord
📝 LinkedIn: / tim-ruscica-82631b179
🌎 Website: techwithtim.net
📂 GitHub: github.com/techwithtim
🔊 Podcast: anchor.fm/tech-with-tim
🎬 My RUclips Gear 🎬
🎥 Main Camera (EOS Canon 90D): amzn.to/3cY23y9
🎥 Secondary Camera (Panasonic Lumix G7): amzn.to/3fl2iEV
📹 Main Lens (EFS 24mm f/2.8): amzn.to/2Yuol5r
🕹 Tripod: amzn.to/3hpSprv
🎤 Main Microphone (Rode NT1): amzn.to/2HrZxXc
🎤 Secondary Microphone (Synco Wireless Lapel System): amzn.to/3e07Swl
🎤 Third Microphone (Rode NTG4+): amzn.to/3oi0v8Z
☀️ Lights: amzn.to/2ApeiXr
⌨ Keyboard (Daskeyboard 4Q): amzn.to/2YpN5vm
🖱 Mouse (Logitech MX Master): amzn.to/2HsmRDN
📸 Webcam (Logitech 1080p Pro): amzn.to/2B2IXcQ
📢 Speaker (Beats Pill): amzn.to/2XYc5ef
🎧 Headphones (Bose Quiet Comfort 35): amzn.to/2MWbl3e
🌞 Lamp (BenQ E-reading Lamp): amzn.to/3e0UCr8
🌞 Secondary Lamp (BenQ Screenbar Plus): amzn.to/30Dtafi
💻 Monitor (BenQ EX2780Q): amzn.to/2HsmUPZ
💻 Monitor (LG Ultrawide 34WN750): amzn.to/3dSD7tS
🎙 Mic Boom Arm (Rode PSA 1): amzn.to/30EZw9m
🎚 Audio Interface (Focusrite Scarlet 4i4): amzn.to/2TjXsih
💸 Donations 💸
💵 One-Time Donations: www.paypal.com/donate?hosted_...
💰 Patreon: / techwithtim
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
⭐️ Tags ⭐️
- Color detection in OpenCV
- Colors OpenCV
- HSV OpenCV
- Python
- Computer vision
- Cameras and video capture
⭐️ Hashtags ⭐️
#OpenCV #Python #CameraCapture
For others like me who struggled to create the numpy array:
I kept getting
> Unsupported depth of input image:
> 'VDepth::contains(depth)'
> where
> 'depth' is 4 (CV_32S)
This indicates that the numpy array consists of 32 bit signed integers which are not supported by cvtColor.
You should create your array like this, specifying datatype uint8:
bgr_color = np.array([[[blue, green, red]]], dtype=np.uint8)
THANKS A LOT! I struggled with this for half hour.
HAHAAHAH same
I was looking into machine vision and this video's content on mask and hsv inspired me on the direction i should move in.
If this had appeared earlier, i would not have wasted time figuring out canny and harris corner detection.
Not that they are bad, just that I prefer simple solutions that I have full understanding of.
Keep up the great work.
Another amazing video Tim, thank you!
1:11
HSV = Hue, Saturation, Value
HSL = Hue, Saturation, Lightness
Both are a bit different from each other.
This is such a well made tutorial series.
Love the way you explain things, well done!!!
Hello Tim you’re such an amazing youtuber keep it up👏👏👏👏. From Kenya love you❤️💖
Thank you so much for your tutorials !!!!
You deserve this 🙏 Tim proud to be your subscriber
this is educative. great work.
the HSV colors do not match what all the color pickers say, and i cant find one that goes from 0-255, all use degrees and %. i dont know how to get any correct HSV colors
HSV stands for hue, saturation, value. 1:10
lmao i was gonna comment that ahahaha
Great set of tutorials!! I guess that before displaying the images regular on the screen the color scheme should be converted back from HSV to BGR?
Awesome as always 👍
Just Wanted To Say I Love Your Videos! Can You Do A Tutorial On The Game Show Countdown Conundrum, It Would Be Very Much Appreciated. Keep Up The Good Work!
Great video Tim!👍
Awesome video Tim 👍
Great tutorials. Is there one for shadow detection and substraction?
youre awesome dude, please keep going
Hey Tim, I have an idea for a tutorial I would love it if you would consider it. How to get open cv and a pyttsx3 python chat bot working together. I'm trying on my own as a beginner programmer to build a personal assistant robot that can function offline, I want to be able to ask it to identify an object, not having to display it on a screen but to verbally respond to what the object is. also, I want to incorporate s.l.a.m. into it ( I already bought 2 identical webcams for stereo vision), so it can map its environment and remember that map and update that map each time it passes through that location. It might be a bit of a challenge I'm sure, but you really have simplified so much for me so far, I really hope you will accept this!
Hello Tim, how are you ? Last time you talked about MS VSC and it was very helpful. Many thanks ^_^
:p
i am watching this in a flow!!
now i finally know how green screen works, yay!
Very Interesting video series
Cheers Tim :)
thank you my big fan 😃
Hi Tech With Tim, if the background color is similar to the object color, is there a way to detect and draw only the outline of the object?pyD
Hey Tim! thank you for this wonderful tutorial.
but how to get the range of colors like you did for blue. Actually I am doing a project in which colors are detected and then i want to replace that color object with a different color. like, changing the color of a t shirt.
Hey man, amazing video. Can I ask how to put rectangle on the image after that. I mean yes mask find blue, then i want to put a rectangle to show it on screen. Thank you
@TechWithTim V in HSV mean value for value of brightness
If i wanted to use colors other than blue, am I trying to identify the color spectrum as they appear in my HSV image? like my red shirt turned green, so do I aim for the green values, or the original red values but with their HSV values?
I do visual effects work and I'm trying to write an openCV that will detect diffuse maps out of a group of normal maps and bump maps and diffuse maps and occlusion maps and roughness maps and metal maps I can't place examples of these images here you could Google and find them but can you show me how to write an open CV that will do that?
Can you add this video to the OpenCV playlist?
Episode 5: Hello everyone, today we are going to be detecting colors.
Episode 15: HACKING INTO A DRONE AND SPYING ON THE GOVERNMENT...
how you get the minimum and maximum pixel value for blue color....pls help.
V is stand for Value in Graphic Field it means Brightness
next video tutorial series How to solve the rubics cube?
What can be done so that it does not detect another blue color. I am building an autonomous vehicle and performing color tracking. What can be done to prevent the vehicle from heading towards another object of the same color?
Help? if i set the VideoCapture value (webcam number) to anything other then 0 the cote doesnt work. i am trying to use the obs virtual camara but it will only accept 0 which is my main webcam.
Hi everyone. Is it possible to fill the area with any number that contains the same color?
V in HSV stands for vibrance
Supposing I would want to send a signal or print something on the screen when a certain color is detected, how would I proceed?
If statement + cv2.puttext
I'm pretty sure 1 and 0 = 1 and those stuff are called Truth Tables. They are pretty much like multiplication in maths. Consider the 1 as + and 0 as - and the "and" as * , then 0 and 1(- * +) = -(0). Its something likes that anyway you can go ahead and search in google about it.
so you're saying (0 and 0) is 1 cause (- * -) = +
1 and 0 is 0
Sir full tutorial of flask!!!! Plzz..... 🥺🥺🙏🏼🙏🏼🙏🏼
Check the playlist
please help i am getting the following error "module 'cv2' has no attribute 'bitswise_not'"
hsv means hue saturation and value
BGR of Color: [[[255 0 0]]]
HSV of Color: [[[120 255 255]]]
Lower Limit: (110, 100, 100)
Upper Limit: (130, 255, 255)
How can u convert a black and white image to colored image
What changes are required if we want to detect green instead of blue? Tim explained it but i couldn't get it. Anyone?
same question
Change the HSV values in the upper_blue and lower_blue variables
It's all fun and games when you have a clear image, but when you have an image with unclear colors and poor quality, it becomes hard
Hello, TechWithTim
Create Chroma Key using OPENCV
why do i get white image instead blue
omg i was using blue filter screen
HSV = Hue, Saturation, Value
Second
#6 and #7 just got private
am i the only one who asks every time myself when i watch tim .... why doesn't TIM grow his HAIR? .... i want to see that look.
Tim finally showed his evil nature.
hsv tutorial leftg me confused
Cuther = Color
Can I ask why you pronounce "Color" as "Cother"?
Exactly. I noticed it too!
cothers
hey
First
I see. I see where this is going
FACIAL RECOGNITION
AWEEESOMMEEEEEEE.
Use face cascades
Wot
12:07 u really look weird after coming back to the original world!
First
Second