Ask Your Question
0

Problem with exact measurement of tracking balls

asked 2017-07-29 09:59:40 -0600

ziutoslav gravatar image

Hi, I'm new here and new in OpenCV, so i hope you're not gonna be too hard for me

In my project I want to check the collision tracks two balls on minibilard table gonna cross, assume that they are moving in a uniformly delayed rectilinear motion. So, first i tried detect one of them by HSV model, and it worked out, then I calculated time between frames, speed, acceleration and direction by comparing the last three frames, and based on this I wanted to calculate the expected time and position of the ball when it gonna stop. Unfortunately the results are not satisfactory, I can see that speed is decreasing, but latency is not constans, so the expected position of the ball is diffrent in every new frame, and for the vast majority is not close to the position sought. I know that maybe it's becouse poor quality of my webcamera, time between frames is about 78 msec and the sharpness of the image is not the best.

So, next I tried to use Canny filter, but the result was weak, I had a trouble with detect object, so I did not even try to calculate the final position of the ball. Now I'm thinking about tracking method like Horn-Shunck or Lukas-Kanade methods, but i don't know if final result gonna be better then detecting ball by HSV method.

I know my question is very broad. Are there any methods that will allow me to measure the latency and speed accurately, with the quality of a regular webcam? We are talking for example about 30pixel/msec speed.

I will be grateful for any help given Sorry for poor English Have a nice day :)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-07-29 13:15:29 -0600

Tetragramm gravatar image

It's likely that your measurements are noisy, but if you've got more than 3, you can use something called a Kalman Filter.

You can use this to get accurate estimates of noisy measurements. Set up the filter correctly, input the position of the ball every time you measure it, and read the sate for estimates of position, speed, and acceleration.

It's beyond the scope of this forum to explain how to use it, but there are many tutorials on the internet, and the OpenCV syntax is explained in the documentation (linked above) and the kalman.cpp example.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-07-29 09:59:40 -0600

Seen: 209 times

Last updated: Jul 29 '17