OpenCV Python Tutorial #5 - Colors and Color Detection

  Переглядів 105,264

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 UKposts 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
@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.
@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
@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!!!
@smoothrain
@smoothrain 3 роки тому
Hello Tim you’re such an amazing youtuber keep it up👏👏👏👏. From Kenya love you❤️💖
@Doraredora
@Doraredora 3 роки тому
You deserve this 🙏 Tim proud to be your subscriber
@timsosnora2151
@timsosnora2151 3 роки тому
Thank you so much for your tutorials !!!!
@theebookkeeper
@theebookkeeper 3 роки тому
this is educative. great work.
@arjunsahlot
@arjunsahlot 3 роки тому
HSV stands for hue, saturation, value. 1:10
@ryuzu438
@ryuzu438 3 роки тому
lmao i was gonna comment that ahahaha
@acm1812
@acm1812 3 роки тому
Great video Tim!👍
@index-zero
@index-zero 3 роки тому
Awesome as always 👍
@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!
@fionanathanson6580
@fionanathanson6580 3 роки тому
Awesome video Tim 👍
@johngroebe9373
@johngroebe9373 9 місяців тому
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?
@SAMETELMACI
@SAMETELMACI 3 роки тому
youre awesome dude, please keep going
@learnwithnawf246
@learnwithnawf246 3 роки тому
Cheers Tim :)
@johnvincentrajc6282
@johnvincentrajc6282 2 роки тому
Very Interesting video series
@jaimehernandezprado6356
@jaimehernandezprado6356 2 роки тому
Great tutorials. Is there one for shadow detection and substraction?
@parthkabra4968
@parthkabra4968 3 роки тому
i am watching this in a flow!!
@Life-zx5wp
@Life-zx5wp 2 роки тому
thank you my big fan 😃
@drydenstewartinc.7710
@drydenstewartinc.7710 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!
@nadraibrahim6400
@nadraibrahim6400 Рік тому
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.
@naokimc
@naokimc 2 роки тому
now i finally know how green screen works, yay!
@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
@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
@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
@tuminh9656
@tuminh9656 Рік тому
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
@lukajeliciclux3074
@lukajeliciclux3074 3 роки тому
@TechWithTim V in HSV mean value for value of brightness
@malek3764
@malek3764 3 роки тому
Can you add this video to the OpenCV playlist?
@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?
@dreamwork69
@dreamwork69 Рік тому
V is stand for Value in Graphic Field it means Brightness
@ramandeepsingh8896
@ramandeepsingh8896 3 роки тому
how you get the minimum and maximum pixel value for blue color....pls help.
@Malkawi_FTP
@Malkawi_FTP 2 роки тому
V in HSV stands for vibrance
@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?
@lifesgood5065
@lifesgood5065 3 роки тому
next video tutorial series How to solve the rubics cube?
@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...
@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?
@sercanalnca1962
@sercanalnca1962 10 місяців тому
Hi everyone. Is it possible to fill the area with any number that contains the same color?
@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.
@_shivi_7425
@_shivi_7425 Рік тому
please help i am getting the following error "module 'cv2' has no attribute 'bitswise_not'"
@oskarkottom8365
@oskarkottom8365 Рік тому
hsv means hue saturation and value
@rwtNitin
@rwtNitin 3 роки тому
How can u convert a black and white image to colored image
@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
@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 7 місяців тому
1 and 0 is 0
@teacheronat
@teacheronat Рік тому
BGR of Color: [[[255 0 0]]] HSV of Color: [[[120 255 255]]] Lower Limit: (110, 100, 100) Upper Limit: (130, 255, 255)
@KrishuBrawlStars
@KrishuBrawlStars 3 роки тому
Sir full tutorial of flask!!!! Plzz..... 🥺🥺🙏🏼🙏🏼🙏🏼
@yuvaraj_i
@yuvaraj_i 3 роки тому
Check the playlist
@DGHere12
@DGHere12 3 роки тому
Hello, TechWithTim
@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
@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
@hissy_dev
@hissy_dev Рік тому
why do i get white image instead blue
@hissy_dev
@hissy_dev Рік тому
omg i was using blue filter screen
@TechnicalRNP
@TechnicalRNP 3 роки тому
Create Chroma Key using OPENCV
@davidcarlson2481
@davidcarlson2481 2 роки тому
HSV = Hue, Saturation, Value
@addledanorak8297
@addledanorak8297 3 роки тому
Second
@lucasanss3294
@lucasanss3294 3 роки тому
#6 and #7 just got private
@lavia5206
@lavia5206 3 роки тому
First
@meFawadIqbal
@meFawadIqbal 2 роки тому
Cuther = Color
@ArunKumar-ls4bl
@ArunKumar-ls4bl 2 роки тому
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.
@ammartaj4205
@ammartaj4205 2 місяці тому
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
@hey9530
@hey9530 Рік тому
hsv tutorial leftg me confused
@manewry66tw
@manewry66tw 3 роки тому
Tim finally showed his evil nature.
@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
Переглядів 66 тис.
Detecting Colour in an Image using OpenCv and Python
14:34
Propagate Knowledge
Переглядів 38 тис.
ISSEI funny story😂😂😂Strange World | Magic Lips💋
00:36
ISSEI / いっせい
Переглядів 43 млн
OpenCV Python Tutorial #1 - Introduction & Images
14:52
Tech With Tim
Переглядів 321 тис.
Fast Window Capture - OpenCV Object Detection in Games #4
30:48
Learn Code By Gaming
Переглядів 221 тис.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Переглядів 1,4 млн
Realtime Color Detection (Webcam) [8] | OpenCV Python Tutorials for Beginners 2020
17:35
Murtaza's Workshop - Robotics and AI
Переглядів 40 тис.
OpenCV Python Tutorial #7 - Template Matching (Object Detection)
22:22
Tech With Tim
Переглядів 92 тис.
How To Actually Make $10k A Month Coding
14:54
Tech With Tim
Переглядів 35 тис.
OpenCV Python Tutorial #8 - Face and Eye Detection
16:08
Tech With Tim
Переглядів 82 тис.