OpenCV Tutorial: Adding an Automatic Colour Filter for Object Tracking

preview_player
Показать описание
Found this video useful? Donations are very much appreciated, thank you.
BTC: 18Hysn4veDCCkhKtkqBiigJ8HfhjkzWDta
Ethereum: 0x97267a8d15d35012FaA9B07be4ac5Ff935876E10

In this video we add code to automatically tune an HSV filter from a user selected region.

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

You should do more videos, I learnt a lot here

Neon-lens
Автор

Thank you for your wonderful tutorials. I am a java guy and new to opencv, but this tutorials have helped my understanding of basic image processing techniques even though my language of choice is different.

Did have a few questions that I cant seem to get an answer to/understanding anywhere.

1) you use

erode(thresh, thresh, erodeElement); x2
dilate(thresh, thresh, dilateElement); x2

in sequence. Why twice

2) I saw many articles that pointed to morph operations of

Opening = dilate(erode(img))
Closing = erode(dilate(img))

in light of those definitions, number#1 gets even more confusin to me. Could you help me understand.

3) In this tutorial "OpenCV Tutorial: Adding an Automatic Colour Filter for Object Tracking", you use a different kernal size for erode vs. dilate? What is the reasoning behind it? And if you know the estimate size of your object of interest how do you pick the right size kernel.

4) Lastly, and most importantly, the user provided selection for HSV min max values seems like an awesome way to increase the accuracy/convenience of color selection. Since the user is providing a selection and specifying an estimated initial bounds/size for our tracked object in the process, can we base a kernel size on user selection bounds also?

5) To other readers, it does look like there are functions that will do the opening and closing directly: morphologyEx(...)

Just wanted to understand more of the practical techniques you have shared in your awesome tutorials. Thank you for sharing your knowledge.

klancaster
Автор

Hi Kyle,
Excellent!
With minimal adaptation it runs perfectly well on a Raspberry Pi with opencv3.0.0 and the raspcam libraries for the camera module. Under Raspbian Jessie to be precise.

gillesmacherey
Автор

Thank you! Hello from Russia, cool tutorial, and you cool! Great coder comrade :)

Zombine
Автор

love this one kyle very useful, tho i have one error

Error 1 error MSB4044: The "CheckRuntimeLibrary" task was not given a value for the required parameter "RuntimeLibrary". 65 5 AutoColourF

what do you think that error is for?

FrankLopezx
Автор

hello sir,
your videos are really very impressive and well explained. I really want to ask you about an another way for doing this correct me if i am going on a wrong path, rather than doing iterations and all that stuff with the vectors cant we simply use the function minMaxIdx() provided in the library and instantly get the min and max values for a particular colour, is this approach is better or the iterating through the matrix will be better in terms of speed and complexity.

lakshayjain
Автор

Thank you so much for ALL of these tutorials, you have helped me with my project in so many ways!

sumeetbatra
Автор

std::min_element and std::max_element. Do we have the same method in python ?

utcuong
Автор

how did you learn all the computer vision stuff? it seems so intense

richardqqq
Автор

Thanks for the great tutorial! You are amazing! (y)

AniketSharmacodes
Автор

Hello Brother, Could please help us how to replace the color of the detected OBJECT with another color or Video (please or give us some sample code)

SayeedUddin
Автор

Hi Kyle. Thanks for your time! I got the error below. Do you have a clue? I didn't change anything in your code.

OpenCV Error: Assertion failed ((scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F)) in cv::cvtColor, file C:\builds\2_4_PackSlave-win32-vc12-shared\opencv\modules\imgproc\src\color.cpp, line 3961

kantrys
Автор

Hey @Kyle thank you for the good work but i am getting NRL2019 error what should i do to solve this ?
I am using visual studio 2015

ZaidQureshi
Автор

Hey Kyle

I am using 4 different colourd balls to uniquely estimate the pose of an RC helicopter.
Do you know of a method to track the same object using just 1 or 2 colours?
The problem is that contours doesnt keep track of a blob as it is rotated W.R.T the Z axis

unqtrunqmegawatt
Автор

hi Kyle, how would the routine look like, if i want to sent the x/y coordinates to a arduino uno, for 2x Servo controll?

Kaiju
Автор

It sounds that your microphone has some problem, that makes me feel a little headache

jaminge
Автор

hi Kyle, I like your channel and your projects, but i have an problem.
How can i get rid of this error, have this error on your previous project MultipleObjectTracking. Would be nice if you can help me:


get error than i set false to true | bool trackObjects = false;


Debug Assertion Failed!

Program:
File:
Line: 1424

Expression: _pFirstBlock == pHead

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

PHAMous