OpenCV Python Tutorial #5 - Colors and Color Detection

  Рет қаралды 107,519

Tech With Tim

Tech With Tim

Күн бұрын

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 KZbin 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

Пікірлер: 87
@SadSack963
@SadSack963 2 жыл бұрын
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)
@kshiprajadav179
@kshiprajadav179 2 жыл бұрын
THANKS A LOT! I struggled with this for half hour.
@alessandrodilorenzo2363
@alessandrodilorenzo2363 Жыл бұрын
HAHAAHAH same
@TheDtkxiang
@TheDtkxiang 3 жыл бұрын
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.
@CubixCreations
@CubixCreations 3 жыл бұрын
Another amazing video Tim, thank you!
@labscience8271
@labscience8271 Жыл бұрын
1:11 HSV = Hue, Saturation, Value HSL = Hue, Saturation, Lightness Both are a bit different from each other.
@alexanderwang2484
@alexanderwang2484 2 жыл бұрын
This is such a well made tutorial series.
@ntechplayz6155
@ntechplayz6155 Жыл бұрын
Love the way you explain things, well done!!!
@arjunsahlot
@arjunsahlot 3 жыл бұрын
HSV stands for hue, saturation, value. 1:10
@ryuzu438
@ryuzu438 3 жыл бұрын
lmao i was gonna comment that ahahaha
@timsosnora2151
@timsosnora2151 3 жыл бұрын
Thank you so much for your tutorials !!!!
@Doraredora
@Doraredora 3 жыл бұрын
You deserve this 🙏 Tim proud to be your subscriber
@JuANdELAMANaNA695
@JuANdELAMANaNA695 2 жыл бұрын
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
@smoothrain
@smoothrain 3 жыл бұрын
Hello Tim you’re such an amazing youtuber keep it up👏👏👏👏. From Kenya love you❤️💖
@theebookkeeper
@theebookkeeper 3 жыл бұрын
this is educative. great work.
@index-zero
@index-zero 3 жыл бұрын
Awesome as always 👍
@acm1812
@acm1812 3 жыл бұрын
Great video Tim!👍
@fionanathanson6580
@fionanathanson6580 3 жыл бұрын
Awesome video Tim 👍
@SAMETELMACI
@SAMETELMACI 3 жыл бұрын
youre awesome dude, please keep going
@naokimc
@naokimc 2 жыл бұрын
now i finally know how green screen works, yay!
@chuchumuruplayz6866
@chuchumuruplayz6866 3 жыл бұрын
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!
@parthkabra4968
@parthkabra4968 3 жыл бұрын
i am watching this in a flow!!
@edwardedward7765
@edwardedward7765 3 жыл бұрын
Hello Tim, how are you ? Last time you talked about MS VSC and it was very helpful. Many thanks ^_^
@noah77
@noah77 3 жыл бұрын
:p
@LifOfJohn
@LifOfJohn 2 жыл бұрын
Very Interesting video series
@Life-zx5wp
@Life-zx5wp 2 жыл бұрын
thank you my big fan 😃
@jaimehernandezprado6356
@jaimehernandezprado6356 2 жыл бұрын
Great tutorials. Is there one for shadow detection and substraction?
@learnwithnawf246
@learnwithnawf246 3 жыл бұрын
Cheers Tim :)
@johngroebe9373
@johngroebe9373 10 ай бұрын
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?
@tuminh9656
@tuminh9656 2 жыл бұрын
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
@MrHellmeowmix
@MrHellmeowmix 2 жыл бұрын
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?
@nadraibrahim6400
@nadraibrahim6400 2 жыл бұрын
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.
@drydenstewartenterprises
@drydenstewartenterprises 3 жыл бұрын
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!
@rkade159
@rkade159 3 жыл бұрын
Episode 5: Hello everyone, today we are going to be detecting colors. Episode 15: HACKING INTO A DRONE AND SPYING ON THE GOVERNMENT...
@lukajeliciclux3074
@lukajeliciclux3074 3 жыл бұрын
@TechWithTim V in HSV mean value for value of brightness
@hobbitthegobbit
@hobbitthegobbit 2 жыл бұрын
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
@toapyandfriends
@toapyandfriends Жыл бұрын
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?
@ramandeepsingh8896
@ramandeepsingh8896 3 жыл бұрын
how you get the minimum and maximum pixel value for blue color....pls help.
@omeralperensari7067
@omeralperensari7067 2 жыл бұрын
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?
@Malkawi_FTP
@Malkawi_FTP 2 жыл бұрын
V in HSV stands for vibrance
@malek3764
@malek3764 3 жыл бұрын
Can you add this video to the OpenCV playlist?
@dreamwork69
@dreamwork69 Жыл бұрын
V is stand for Value in Graphic Field it means Brightness
@lifesgood5065
@lifesgood5065 3 жыл бұрын
next video tutorial series How to solve the rubics cube?
@vjx1163
@vjx1163 2 жыл бұрын
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.
@princemajestal8100
@princemajestal8100 2 жыл бұрын
Supposing I would want to send a signal or print something on the screen when a certain color is detected, how would I proceed?
@MichielVanzeir
@MichielVanzeir 2 жыл бұрын
If statement + cv2.puttext
@sercanalnca1962
@sercanalnca1962 11 ай бұрын
Hi everyone. Is it possible to fill the area with any number that contains the same color?
@oskarkottom8365
@oskarkottom8365 Жыл бұрын
hsv means hue saturation and value
@_shivi_7425
@_shivi_7425 Жыл бұрын
please help i am getting the following error "module 'cv2' has no attribute 'bitswise_not'"
@teacheronat
@teacheronat Жыл бұрын
BGR of Color: [[[255 0 0]]] HSV of Color: [[[120 255 255]]] Lower Limit: (110, 100, 100) Upper Limit: (130, 255, 255)
@rwtNitin
@rwtNitin 3 жыл бұрын
How can u convert a black and white image to colored image
@KrishuBrawlStars
@KrishuBrawlStars 3 жыл бұрын
Sir full tutorial of flask!!!! Plzz..... 🥺🥺🙏🏼🙏🏼🙏🏼
@yuvaraj_i
@yuvaraj_i 3 жыл бұрын
Check the playlist
@muhammadanique2256
@muhammadanique2256 2 жыл бұрын
What changes are required if we want to detect green instead of blue? Tim explained it but i couldn't get it. Anyone?
@balarohank4416
@balarohank4416 2 жыл бұрын
same question
@ItsMe28755
@ItsMe28755 Жыл бұрын
Change the HSV values in the upper_blue and lower_blue variables
@DGHere12
@DGHere12 3 жыл бұрын
Hello, TechWithTim
@sakethgupta2885
@sakethgupta2885 3 жыл бұрын
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.
@sauvikmondal4828
@sauvikmondal4828 2 жыл бұрын
so you're saying (0 and 0) is 1 cause (- * -) = +
@13bimbou
@13bimbou 8 ай бұрын
1 and 0 is 0
@dan-cj1rr
@dan-cj1rr 3 жыл бұрын
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
@TechnicalRNP
@TechnicalRNP 3 жыл бұрын
Create Chroma Key using OPENCV
@addledanorak8297
@addledanorak8297 3 жыл бұрын
Second
@davidcarlson2481
@davidcarlson2481 2 жыл бұрын
HSV = Hue, Saturation, Value
@hissy_dev
@hissy_dev Жыл бұрын
why do i get white image instead blue
@hissy_dev
@hissy_dev Жыл бұрын
omg i was using blue filter screen
@meFawadIqbal
@meFawadIqbal 2 жыл бұрын
Cuther = Color
@lavia5206
@lavia5206 3 жыл бұрын
First
@manewry66tw
@manewry66tw 3 жыл бұрын
Tim finally showed his evil nature.
@lucasanss3294
@lucasanss3294 3 жыл бұрын
#6 and #7 just got private
@ammartaj4205
@ammartaj4205 3 ай бұрын
cothers
@yrath5034
@yrath5034 3 жыл бұрын
Can I ask why you pronounce "Color" as "Cother"?
@swastiksarkar9856
@swastiksarkar9856 2 жыл бұрын
Exactly. I noticed it too!
@adrien123_
@adrien123_ 3 жыл бұрын
hey
@ArunKumar-ls4bl
@ArunKumar-ls4bl 3 жыл бұрын
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.
@hey9530
@hey9530 2 жыл бұрын
hsv tutorial leftg me confused
@sakethgupta2885
@sakethgupta2885 3 жыл бұрын
I see. I see where this is going FACIAL RECOGNITION AWEEESOMMEEEEEEE.
@Rishikesh-24
@Rishikesh-24 3 жыл бұрын
Use face cascades
@sakethgupta2885
@sakethgupta2885 3 жыл бұрын
Wot
@parthkabra4968
@parthkabra4968 3 жыл бұрын
12:07 u really look weird after coming back to the original world!
@ananthramvijayaraj4554
@ananthramvijayaraj4554 3 жыл бұрын
First
@kikku4304
@kikku4304 3 жыл бұрын
Second
OpenCV Python Tutorial #6 - Corner Detection
21:43
Tech With Tim
Рет қаралды 67 М.
OpenCV Python Tutorial #4 - Drawing (Lines, Images, Circles & Text)
13:51
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30
When Steve And His Dog Don'T Give Away To Each Other 😂️
00:21
BigSchool
Рет қаралды 14 МЛН
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 2,3 МЛН
How to Detect Colors in OpenCV [Python]
6:51
CreepyD
Рет қаралды 38 М.
OpenCV Python Tutorial #3 - Cameras and VideoCapture
17:16
Tech With Tim
Рет қаралды 166 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 790 М.
Object Detection in 10 minutes with YOLOv5 & Python!
10:45
Rob Mulla
Рет қаралды 223 М.
OpenCV Python Tutorial #8 - Face and Eye Detection
16:08
Tech With Tim
Рет қаралды 84 М.
Image Processing with OpenCV and Python
20:38
Rob Mulla
Рет қаралды 127 М.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,4 МЛН
Real time Shape Detection using Contours [9] | OpenCV Python Tutorials for Beginners 2020
20:24
Murtaza's Workshop - Robotics and AI
Рет қаралды 153 М.