Detecting colors (Hsv Color Space) - Opencv with Python

  Рет қаралды 88,867

Pysource

Pysource

Күн бұрын

We’re going to see in this video how to detect colors through HSV Color space on Opencv with Python.
Instructions and source code: pysource.com/2019/02/15/detec...
➤ Full Videocourses:
Object Detection: pysource.com/object-detection...
➤ Follow me on:
Instagram: / pysource7
LinkedIn: / pysource
➤ For business inquiries:
pysource.com/contact

Пікірлер: 74
@dikshabagade5542
@dikshabagade5542 3 жыл бұрын
You are such a saviour, thank you so much man. I wanted this so bad
@NiVofHiR
@NiVofHiR 4 жыл бұрын
Great video tutorial, thanks for sharing!
@rverm1000
@rverm1000 4 жыл бұрын
Very good job. Works well
@sudiptachatterjee5862
@sudiptachatterjee5862 4 жыл бұрын
You are great brother.................
@samsepiol5267
@samsepiol5267 3 жыл бұрын
hi sergio, can i ask something, if i wanna actuate a servo motor, after the camera detected one particular color, what function should i use ?
@wisdom_wellness365
@wisdom_wellness365 4 жыл бұрын
Brilliant!
@cybercribe2460
@cybercribe2460 Жыл бұрын
Nice tutorial but a doubt how did you detect the values of lower_red,blue,green and upper_red,blue,green??
@halilavc737
@halilavc737 3 жыл бұрын
Thanks bro . Amazing . Thank you so much
@mauriziovetere1956
@mauriziovetere1956 4 жыл бұрын
Nice tutorial! Is there a way to detect all chosen colors on one screen sweep instead of repeating the operation for each of them? I'm talking about the inRange() and bitwise_and() parts, I ask for performance purposes
@johntran468
@johntran468 3 жыл бұрын
Hi, what if I only want to detect only the white color, can you tell me what is the threshold or someway to calculate it? Thank you
@mounahammouda1641
@mounahammouda1641 3 жыл бұрын
Thank you for this video, have you an idea how i can detect white cracks in a white surface, but the saturation of the surface and cracks are not similar. thanks
@machain1996
@machain1996 4 жыл бұрын
nice video, man.
@rajvindermann7655
@rajvindermann7655 2 жыл бұрын
Hi, may i know how to detect the object which has similar colour to the background? Thank you.
@vijaybhanushali9696
@vijaybhanushali9696 4 жыл бұрын
thanks ✌✌
@claudiolossinno1677
@claudiolossinno1677 4 жыл бұрын
great!
@coursfiliereeln4592
@coursfiliereeln4592 Жыл бұрын
hello thank you for the video it's helpful.. i have a question? if we need to apply this with depth images how i can do this?
@abdelrhmanshokr7546
@abdelrhmanshokr7546 2 жыл бұрын
great video thanks a lot but I've an issue here no matter what ranges of colours I pass as high and low I keep getting a black image as a result and I don't really get why can anyone help me understand why this is happening (I am trying to block all colours except for black) but again I wrote the same code with the same values to make sure that the problem isn't with my ranges but the same result always pops up a black image with rgb = 0, 0, 0 and as I said I don't get it
@kevinliem6284
@kevinliem6284 3 жыл бұрын
hi bro nice tutorial, i want to ask something, how if we want to add more color on it? lets say we want to add secondary color, like purple, maroon or something else? how is it?
@NeilSummersgill
@NeilSummersgill Жыл бұрын
cv2.createTrackbar for HSV is very useful for getting the ranges correct
@stanleychen6710
@stanleychen6710 Жыл бұрын
Teach me how Neil!!!
@ramadhaniramadhani5592
@ramadhaniramadhani5592 2 жыл бұрын
Hello sir, why i can't run cV2.bitwise_and on my PC. Can you explain about it?
@lokeshsaha8875
@lokeshsaha8875 4 жыл бұрын
Hey, can you please help me how to detect background color of an image?
@aliihsancukur6866
@aliihsancukur6866 5 жыл бұрын
can you do applications with some more advanced functions ? for example imutils related to thank you
@stanleychen6710
@stanleychen6710 Жыл бұрын
Hi Sergio! Can you tell us what that cool software for picking colors is called? I really need it. Thanks
@raghuld3635
@raghuld3635 5 жыл бұрын
I'm doing a similar project with OpenCV. Could you help me with that, sir????
@junlizhang876
@junlizhang876 3 жыл бұрын
veli good.
@francescopistone4086
@francescopistone4086 4 жыл бұрын
Does somebody know how to make that in C++(Visual Studio)?
@ankor2998
@ankor2998 4 жыл бұрын
If Color is detected the it show message like image is detected...How i print that message
@Gabo_1457
@Gabo_1457 5 жыл бұрын
Hello! I want to create a function that for example, that if it detects a color that prints hello or something, how can i do that?
@pysource-com
@pysource-com 5 жыл бұрын
Hello, It's simple. You can check the size of the mask. 1) You calculate the area of each mask, you can simply do that by counting the number of white pixels in the mask (check one of my video about finding dirrerences between two images to see how to do that). 2) Then you can define the if the size is above a certain number of pixel, the color is detected.
@heisenolf13
@heisenolf13 3 жыл бұрын
@@pysource-com hey can you elaborate that please, we are not using images here how can we calculate the are of the live cam mask
@suphasud
@suphasud Жыл бұрын
Bravoooooooooooooooooo
@brunorafaelalmeida2083
@brunorafaelalmeida2083 2 жыл бұрын
Thanks for the video concepts, but here for me the jupyter notebook (where I use to develop these types of programs) gives an error after I finish the program, and to get around this it is good practice to destroy the images and data that will not be most used after the end of the program. After doing this, the error in my kernel stopped showing up. This destruction of data that will not be used after the end of the program can be done by the following lines at the end of the program and outside the loop and conditional: cap.release() cv2.destroyAllWindows() PS: Hope this is helpful to someone.
@lymtics88
@lymtics88 4 жыл бұрын
I wrote the same code as yours but the 'mask' interface is always black. What is the problem? Thanks a lot
@abdelrhmanshokr7546
@abdelrhmanshokr7546 2 жыл бұрын
yeah same here no matter what values I pass in high and low I keep getting a black image as a result with rgb values 0, 0, 0 and I don't get it did you find a solution to it ? if so please let me know
@pedrobb7
@pedrobb7 5 жыл бұрын
When you selected low_red and high_red in which format the colors are? RGB, BGR, HSV?
@Jbc1507
@Jbc1507 4 жыл бұрын
hsv, look the first argument passed to cv2.inRange()
@gabeitch9460
@gabeitch9460 4 жыл бұрын
@@Jbc1507 Is it though? Because saturation and value can only have a maximum number of 100 since they are percentage values but the variable 'high_red' has a saturation and value number of 255 and 255. I'm not sure what format the colours are in either. Anyone else know?
@lymtics88
@lymtics88 4 жыл бұрын
@@gabeitch9460 The same question! And also, the RGB color of python is different from that from google...
@ndxs
@ndxs 4 жыл бұрын
stackoverflow.com/questions/10948589/choosing-the-correct-upper-and-lower-hsv-boundaries-for-color-detection-withcv
@trolleyproblem4318
@trolleyproblem4318 3 жыл бұрын
Can you try with LAB?
@tuminh9656
@tuminh9656 2 жыл бұрын
Hi Pysource, if the background color is similar to the object color, is there a way to detect and draw only the outline of the object?
@pysource-com
@pysource-com 2 жыл бұрын
In this case, either you tune the parameters to detect correctly only the color you're focusing on, or probably this method is not good for your specific case. I recommend to watch this free crash course: Computer Vision Blueprint pysource.com/register-to-watch-the-computer-vision-blueprint-workshop/ where I talk about 5 different object detection methods and color detection is only one of them
@tuminh9656
@tuminh9656 2 жыл бұрын
@@pysource-com Thank you so much
@SW1NDLER_TR1CKSTER
@SW1NDLER_TR1CKSTER 4 жыл бұрын
Is this possible on a raspberry pi?
@AgeloszInonos
@AgeloszInonos 3 жыл бұрын
The color ranges. I have trouble calculating for other colors like yellow, How do you calculate upper and lower bounds for all colors?
@pysource-com
@pysource-com 3 жыл бұрын
hi, I have a video where I show how to calculate the ranges: kzfaq.info/get/bejne/ibBzqJSVmd7Fm4U.html&pp=qAMBugMGCgJpdBAB
@hassanahmed9886
@hassanahmed9886 3 жыл бұрын
low_red = np.array([161, 155, 84]) , how you found these values (161,155,84).. How these values has been obtained?
@lolsword7
@lolsword7 3 жыл бұрын
The values seem to be a subjective choice It would seem Pysource viewed a series of colours with different HSV parameters in Gimp. From his eyes, anything less than [161, 155, 84] does not resemble red
@priyanshujain5215
@priyanshujain5215 4 жыл бұрын
Is there a reason red color in background picture is not visible? because similar thing happens when i try detecting color that are at distance , idk why?
@pysource-com
@pysource-com 4 жыл бұрын
It's not about the distance, but about its luminance. you can adjust the low and higher ranges to include also that color. check this video to understand better how to adjust the ranges in real time. kzfaq.info/get/bejne/ibBzqJSVmd7Fm4U.html
@venkatasubramaniamr6982
@venkatasubramaniamr6982 2 жыл бұрын
Hi nice video for leaning for color deduction. I want to know what is the logic to find color lower and upper hsv value without any tool. Can you share the easy logic to find that . Example for green how to find low and high
@patrickeidemuller2757
@patrickeidemuller2757 2 жыл бұрын
i also would like to know that
@LoperDavis
@LoperDavis Жыл бұрын
I would also like to know
@GodLikeChannel.
@GodLikeChannel. 4 жыл бұрын
Could you make to it with unity and build to android?
@thephiluong1893
@thephiluong1893 4 жыл бұрын
excuse me can you tell me what software you use to determined range of colors
@Benozaur
@Benozaur 3 жыл бұрын
they are guessing i belive. It SUCKS!
@cheems6559
@cheems6559 3 жыл бұрын
Use trackbars to decide the colour
@lipikams2886
@lipikams2886 2 жыл бұрын
It shows can't find camera device..could someone help me...
@hrithiks680
@hrithiks680 3 жыл бұрын
Which webcam are you using???
@pysource-com
@pysource-com 3 жыл бұрын
logitech c922 pro
@AafthabNt
@AafthabNt 3 жыл бұрын
can u make a video on extraction of nail using image segnmentation
@AafthabNt
@AafthabNt 3 жыл бұрын
from image
@knowcode6374
@knowcode6374 4 жыл бұрын
hello sir i want to extract skin color and put it to another person ,how to do it sir?
@chadlee3401
@chadlee3401 3 жыл бұрын
Wtf lol
@knowcode6374
@knowcode6374 3 жыл бұрын
@@chadlee3401 fuck off 🖕 ,I already did this
@edilgin622
@edilgin622 3 жыл бұрын
thats racist
@ApplySkills
@ApplySkills 4 жыл бұрын
how the hell can i learn how to set the correct range numbers?
@dimitarvel1441
@dimitarvel1441 4 жыл бұрын
*pulls out yellow box* - a green one
@sterlingarcher3981
@sterlingarcher3981 4 жыл бұрын
It's more of a lime green
Real time shape detection - Opencv with Python 3
35:59
Pysource
Рет қаралды 63 М.
ONE MORE SUBSCRIBER FOR 6 MILLION!
00:38
Horror Skunx
Рет қаралды 13 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 43 МЛН
Cat story: from hate to love! 😻 #cat #cute #kitten
00:40
Stocat
Рет қаралды 14 МЛН
Real time Shape Detection using Contours [9] | OpenCV Python Tutorials for Beginners 2020
20:24
Murtaza's Workshop - Robotics and AI
Рет қаралды 153 М.
Realtime Color Detection (Webcam) [8] | OpenCV Python Tutorials for Beginners 2020
17:35
Murtaza's Workshop - Robotics and AI
Рет қаралды 40 М.
Live Object Detection in Python
25:06
NeuralNine
Рет қаралды 137 М.
HSV Color Range Thresholding - OpenCV Object Detection in Games #6
22:48
Learn Code By Gaming
Рет қаралды 47 М.
ONE MORE SUBSCRIBER FOR 6 MILLION!
00:38
Horror Skunx
Рет қаралды 13 МЛН