How to Detect Colors in OpenCV [Python]

  Рет қаралды 38,441

CreepyD

CreepyD

3 жыл бұрын

How to Detect Color in OpenCV [Python]
- a video by CreepyD
In this tutorial video, I'll be showing you how to detect colors in OpenCV. I'll be explaining HSV and how to mask images for color detection using OpenCV. I won't only show you how to detect color in OpenCV Python, but I will also show color tracking OpenCV. Color detection using OpenCV is very useful, and will certainly help with a lot with your Computer Vision projects.
If you have any questions on the topic of Color Detection in Python using OpenCV feel free to ask in the comment section or join my Discord using the link further down below in the description. I would love to help you explain Python OpenCV better, it would also help me improve seeing as I myself don't know everything about the topic.
GitHub page - github.com/CreepyD246/Simple-...
Support me on Patreon - / creepyd
____________
USEFUL DOCUMENTATIONS:
OpenCV: Changing Colorspaces - docs.opencv.org/master/df/d9d...
OpenCV:Contours: Getting Started - docs.opencv.org/master/d4/d73...
OpenCV: Contours Hierarchy - docs.opencv.org/master/d9/d8b...
̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅
____________
OTHER TUTORIALS:
Twitter Bot Tutorial in Python [Selenium] - • How to Create a Twitte...
Installing Python Packages - • How to Install Python ...
̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅
____________
OTHER MEDIA:
Instagram - / creepyd_studios
Twitter - / creepyd_studios
Discord - / discord
̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅

Пікірлер: 57
@FizzyPinepple
@FizzyPinepple 2 жыл бұрын
Jesus fucking christ thank you for this video. Ive been looking for a guide that actually explains the HSV values in opencv for hours now.
@empowercode
@empowercode 3 жыл бұрын
Hey CreepyD, nice to meet you! I just found your channel and subscribed, love what you're doing! I like how clear and detailed your explanations are as well as the depth of knowledge you have surrounding the topic! Since I run a tech education channel as well, I love to see fellow Content Creators sharing, educating, and inspiring a large global audience. I wish you the best of luck on your KZfaq Journey, can't wait to see you succeed! Your content really stands out and you've put so much thought into your videos! Cheers, happy holidays, and keep up the great work!
@diegovalentino2083
@diegovalentino2083 2 жыл бұрын
Wow, tu forma de explicar es genial. Vi cerca de 30 videos diferentes donde no dejaban claro estos temas, pero tú los explicaste en 6 minutos y medio! Muchas Gracias!
@OVERkill578
@OVERkill578 2 жыл бұрын
Damn, good explanation and done in a short amount of time. Well done!
@abdelrazzaqabuhejleh6625
@abdelrazzaqabuhejleh6625 Жыл бұрын
First time watching your videos, it's a 6:50 length video but it contains information that needs hours to obtain by researching. I really appreciate this, thank you!
@CreepyD246
@CreepyD246 Жыл бұрын
Thank you, I appreciate it
@dollarbill3935
@dollarbill3935 2 жыл бұрын
Beautiful! I love it. thank you!!
@8king274
@8king274 2 жыл бұрын
love your short content brooooooo
@g1ll35t.7
@g1ll35t.7 Жыл бұрын
Hello, CreepyD, I am intrigued by your video and how effectively you were capable of developing this colour detection algorithm. However, I have a pertinent question: at 5:13 you demonstrate how the "cv2.CHAIN_APPROX_SIMPLE" method outlines the 4 edges of the mask, then at 5:52 you state that the x, y, z... variables return the coordinates of the bounding rectangle (for example, the bottom right corner is the 100th px by 900th px out of a 1600 px by 1200 px camera). Does this mean that these variables specify the pixel position(s) of the outline and if not, then how? Also, is this code compatible with the AI-Thinker ESP-32 CAM?
@lucaspadilha6721
@lucaspadilha6721 3 жыл бұрын
awesome!!!
@asarma0804
@asarma0804 3 жыл бұрын
The return of the king
@CreepyD246
@CreepyD246 3 жыл бұрын
Thanks dude, it means a lot, I'll be uploading another one shortly lmao
@asarma0804
@asarma0804 3 жыл бұрын
@@CreepyD246 nice man that's cool
@mattska01
@mattska01 Жыл бұрын
hi, thx for the tutorial, but how do i output the coordinates of the rectangle?
@useruseruseruseruseruser5302
@useruseruseruseruseruser5302 2 жыл бұрын
Explained it perfectly. Thank you very much
@beatrixkiddo2757
@beatrixkiddo2757 Жыл бұрын
what if i want to print x, y and the other corners on the live video, what should i do
@matteoetchart7060
@matteoetchart7060 2 жыл бұрын
Micheal reeves just used this same stuff in his new video, good video man : ) Idk why it took him a year to do it and you 6mins
3 жыл бұрын
I was literally starving for ur video in my feed..
@CreepyD246
@CreepyD246 3 жыл бұрын
Means a lot, another one will be uploaded in about 20 minutes xD
@tfue6481
@tfue6481 3 жыл бұрын
What algorithm is used in this project?
@aseelalmarafi193
@aseelalmarafi193 Жыл бұрын
What is the range of detect white object ???
@balbuzio
@balbuzio Жыл бұрын
no joke your teaching style is one of the best ive seen in any programming tutorial
@CreepyD246
@CreepyD246 Жыл бұрын
It means a lot, thanks man
@thinker2411
@thinker2411 2 жыл бұрын
can you do the same thing but instead of rectangle give circle? :)
@samarumugam4833
@samarumugam4833 2 жыл бұрын
Great video bro . How to change Any colour to specific colour or some sort in a jpg or png format.Thanks have a great day.
@tuminh9656
@tuminh9656 2 жыл бұрын
Hi CreepyD, if the background color is similar to the object color, is there a way to detect and draw only the outline of the object?
@CreepyD246
@CreepyD246 2 жыл бұрын
That's quite difficult, but you's probably need to look for the contours (outer edges) of the object. OpenCV has a nice documentation on it
@tuminh9656
@tuminh9656 2 жыл бұрын
@@CreepyD246 Can you give me that documention please?
@LIGHT-68
@LIGHT-68 3 жыл бұрын
NOICE
@pezhman5842
@pezhman5842 2 жыл бұрын
Hi CreepyD, Perfect Video and I was wondering to use from your method to count the object with same color. How can we count the number of contour that you detect through webcam? Thanks for your nice and interesting python code. Bests,
@CreepyD246
@CreepyD246 2 жыл бұрын
You can use the len() function to check how many contours there are. You'd use it right under line number 14, and you'd store it in a variable like this: num_contours = len(contours) This will give you the number of contours detected
@pezhman5842
@pezhman5842 2 жыл бұрын
I understood, The length of contours array is the number of object detected by code :)
@kethmieperera240
@kethmieperera240 3 жыл бұрын
Hello! How do you get the average colour of a selected area?
@CreepyD246
@CreepyD246 3 жыл бұрын
no idea actually, sorry :(
@borallylyl8427
@borallylyl8427 10 ай бұрын
Hello, I'm trying to create a program that detects and counts objects by color, but now I can only count four colors, these are red, blue, green and yellow. I wonder if I can add the whole color scale to the program, how can I do this? I will be very happy if you give back. have a nice day
@Glanmire3
@Glanmire3 2 ай бұрын
You need object detection as well and you can count amount of object by different definied colors. Any colors can be filtered and definied (tagged) by a name, just have to apply more upper/lower HSV values.
@triplet2555
@triplet2555 2 жыл бұрын
how to dêtct color white
@Aloman76
@Aloman76 2 жыл бұрын
This might sound weird.. but I’m trying to build a homemade missile, and have a camera attached to the front. I want the camera to detect red smoke, and send signals to the ailerons of the missile, so it guides the missile towards the smoke. Is this reasonable to do in code?
@CreepyD246
@CreepyD246 2 жыл бұрын
I think it's reasonable, but that it might be really difficult, I've never tried before xD
@kernowbysvyken5600
@kernowbysvyken5600 Жыл бұрын
@@CreepyD246 no kidding you havent tried it before sherlock
@princemajestal8100
@princemajestal8100 2 жыл бұрын
Can you also do it in RGB?
@mattska01
@mattska01 Жыл бұрын
i think u can
@sevindaherath
@sevindaherath 3 жыл бұрын
Do you have a web page ???
@CreepyD246
@CreepyD246 3 жыл бұрын
I don't, but I might make one some time
@sevindaherath
@sevindaherath 3 жыл бұрын
@@CreepyD246 i can make one for you
@CreepyD246
@CreepyD246 3 жыл бұрын
@@sevindaherath I appreciate it very much, thanks :D But I'll make one when I need to, but thanks again for the offer :)
@sevindaherath
@sevindaherath 3 жыл бұрын
@@CreepyD246 ok
@thebowtieguy777
@thebowtieguy777 2 жыл бұрын
i want to build an rc airplane mount a small airsoft turret on it then have it recognize a laser designator to mark targets like imagine trolling people at an airsoft event with your own personal gunship
@jasemshark1917
@jasemshark1917 3 жыл бұрын
Me watching this video knowing for sure i didnt undertsand anything and i need to learn alot of computer shit
@awaylau6140
@awaylau6140 Жыл бұрын
can it recognize fruit?
@Glanmire3
@Glanmire3 2 ай бұрын
That is a bit further, AI can do live object detection. Cheapest way to getting into AI world to buy an NvidiaNano. It's a single board computer like an Arduino but specially made for AI learning with a very powerful graphics processor.
@juniorberard9611
@juniorberard9611 5 ай бұрын
Cam you help me ?
@juniorberard9611
@juniorberard9611 5 ай бұрын
Did you Have a email
@jahahha9491
@jahahha9491 Жыл бұрын
Peepeepoopoo
@jahahha9491
@jahahha9491 Жыл бұрын
this is 1:1 the opencv documentation lol
How to Detect Faces in OpenCV [Python]
4:28
CreepyD
Рет қаралды 1,2 М.
Simple Color recognition with Opencv and Python
32:47
Pysource
Рет қаралды 65 М.
Can You Draw The PERFECT Circle?
00:57
Stokes Twins
Рет қаралды 95 МЛН
小路飞姐姐居然让路飞小路飞都消失了#海贼王  #路飞
00:47
路飞与唐舞桐
Рет қаралды 94 МЛН
The most impenetrable game in the world🐶?
00:13
LOL
Рет қаралды 38 МЛН
Pray For Palestine 😢🇵🇸|
00:23
Ak Ultra
Рет қаралды 29 МЛН
How to Detect Shapes with OpenCV [Python]
7:52
CreepyD
Рет қаралды 20 М.
Image Processing with OpenCV and Python
20:38
Rob Mulla
Рет қаралды 124 М.
I tried to make a Valorant AI using computer vision
19:23
River's Educational Channel
Рет қаралды 1,3 МЛН
Color Detection & Tracking with ESP32 Camera & OpenCV
8:28
How To Electronics
Рет қаралды 28 М.
Color Name Detector in Python
8:35
NeuralNine
Рет қаралды 8 М.
OpenCV Python Tutorial #1 - Introduction & Images
14:52
Tech With Tim
Рет қаралды 327 М.
ФОТОШОП СВОИМИ РУКАМИ (@photoscapesbyclare - IG)
0:30
В ТРЕНДЕ
Рет қаралды 17 МЛН
BUZZ THE PLAYER OR SWIM 😅💦
0:35
Celine Dept
Рет қаралды 13 МЛН