Python OpenCV Color Detection Example

preview_player
Показать описание
Join PyQt6 13 Hours Course in Udemy

Support me in Patreon

My Affiliate Books:
Mastering OpenCV4 with Python

Learn OpenCV4 with Python

In this Python OpenCV video i want to show you Python OpenCV Color Detection.

How does color work on a computer?
So we represent colors on a computers by color-space or color models which basically describes range of colors as tuples of numbers.

Instead of going for each color, we’ll discuss most common color-space we use .i.e. RGB(Red, Green, Blue) and HSV (Hue, Saturation, Value).

RGB basically describes color as a tuple of three components. Each component can take a value between 0 and 255, where the tuple (0, 0, 0) represents black and (255, 255, 255) represents white. For example, if we were to show a pure blue pixel on-screen, then the R value would be 0, the G value would be 0, and the B value would be 255.

Source code:
Рекомендации по теме
Комментарии
Автор

Short, simple and easy to understand. You nailed it!

MaxMustermann-eysc
Автор

Short, simple and easy to understand.

abdurrazzak
Автор

Ok, so we can recognize the colors using this code but what if we want to recognize a color and draw a line on it where ever the color is there?(if that made sense) Can someone help?

padmavathynarasareddygari
Автор

How can I calculate the area of the white parts in the mask?

lucasknorr
Автор

how you calculate the range for specific color?

VishalChauhan-wgud
Автор

Where did you get the upper and lower range for blue @4:12?

chimpspecialist
Автор

Great video you help me a loot but how i can show the original color instead of the white one? Thanks in advance

angeldiazmejia
Автор

how to segment colors other than green yellow blue ?


andinursechfudin
Автор

Is it possible to use python using a point cloud to extract only the road from the colors on both sides of the road (if there is a plantation like grass)?

tharinduheshan
Автор

Nice presentation..i want to know one thing.How can i understand uperlimit and lower limit of specific color?

nikhildevadas
Автор

How do you choose you upper and lower ranges?

MegaKevin
Автор

how to draw lines conneting to the contours from center of image plz help

adilmulla
Автор

Hello, I have images of wheels and I need to know the color of the wheel from the image, for example, if an image contains a black wheel I need to know that the color is black and I only need to these colors to be detected Black, Gray, Silver, White, Bronze, Blue, Red, Green, how can i achieve that?

mahmoudodehodeh
Автор

Is it possible for the cv2 library to determine if the color was actually found or not? How do we do that?

lauram.
Автор

how could i do the same in live video. or track the x and y of a color

dyaa_unison
Автор

Hey can I get the number of dots of a specific color?

siddharthaupase
Автор

Instead of targeting a specific image how can I read my desktop screen and then detect colors on my desktop?

owentheoutlaw_
Автор

Please kindly share how to install opencv?

lizmccord
Автор

What is a mask ? Why is it necessary to create it ?

sandeepvytla
Автор

whats the meaning of lower range and upper range, mask???

dharmilparekh