Ask Your Question
0

What's the best method for tracking identical objects?

asked 2017-08-16 10:28:45 -0600

ziutoslav gravatar image

Hi all, I'm sorry that my question is so wide, but I will try to explain in detail what is my problem.

So, I just wrote a program, that checks whether two balls of different colors are on the collision track. I use RGB->HSV transform, have one yellow ball, one blue, I check their position on different frames, I calculate their speed, direction etc and after that, I predict if they may collide. So, after that I thought color-based detection is not the best solution, and I want to detect more than 2 objects, So I thought I should use edge filter, or MOG2 algorithm, or something like that I still think about that, but that's not what I wanted to ask (but if anyone could suggest me something, that's gonna be great :) )

So when I will have a binary image with, for example, 2 object-two balls of the same size, and I'm gonna check their position, ok, so in the first frame one object is located has coordinates X1 and Y1 , second one X2 and Y2. Next I'm gonna analyze second frame, so there are gonna be still two the same objects, first has X3 and Y3 coordinates, and second one X4 and Y4, but how my program gonna now that the first object from 1 and 2 frame is the same object, if those 2 objects gonna have the same shape and size, the program will have a problem to correctly assign a new position to the same object because it can assign it to another object. In HSV it was quite easy because when the computer detected for example yellow object, it knew that its the same yellow object as in the previous frame (because it was only one yellow object). I know I described it a bit chaotic, but I hope you understand what I mean

It seems to me that the only thing that will allow the assignment of detected objects from the previous frame is a slight change of their position, but when I started thinking about it, it's not so easy because, for example, checking the distance between newly found objects and those from the previous frame and link them on the basis of the smallest distance may turn out to be in many cases faulty.

So I wonder if such a solution is possible at all and if there is any ready-made algorithm that will allow me to analyze the position in the previous steps of the object.

Thanks for your time and have a nice day :)

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-08-16 20:16:02 -0600

Tetragramm gravatar image

This is an excellent use of the Kalman Filter. It can estimate the position and velocity of the balls, predict where they will be in the future, and give you a confidence interval of how certain the estimates are.

As for which detection is which track, that is called track association. You should be able to get away with something simple like the Hungarian Algorithm and the distance from the Kalman Filter's prediction. The methods can become amazingly complicated though, as you add more constraints.

edit flag offensive delete link more

Comments

Thanks for your answer. Maybe you know any good example or tutorial for this method, because it looks very nice

ziutoslav gravatar imageziutoslav ( 2017-08-21 03:49:23 -0600 )edit
0

answered 2017-08-16 11:30:25 -0600

Ziri gravatar image

Try experimenting with Lucas-Kanade Optical Flow so you can compute motion speed and direction.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-08-16 10:28:45 -0600

Seen: 551 times

Last updated: Aug 16 '17