# using Kalman Filter

Hi folks,

I write a project to track points with Kalman Filter. There are 4 points, each with x,y coordinates. So, in my case, it's neater if I use a 2x4 Mat as state or measurement matrices.

OpenCV Kalman FIlter works well with 1D Mats as matrices. But in my case, it crashes.

Is this because OpenCV Kalman Filter doesn't work with 2D matrices??

edit retag close merge delete

Sort by ยป oldest newest most voted

A Kalman filter does not know of your points's x and y coordinates. It can handle any N-dimensional space, but it's up to you to define it. In your case, you have 4 points with 2 coordinates, that means 8 different inputs to the filter. So you define a 8x1 input matrix, and assign the 1st coordinate to p[0].x, 2nd coordinate to p[0].y, and so on.

more

actually, I've found the answer from reading source code that implements KalmanFilter algorithm. The code is in module video/kalman.cpp which clearly defines what DynamParam, MeasureParam, ControlParam are and how the matrices are defined

more

one question related to kalman filter, is there any example related to multiple tracking of points or blobs because as long as i searched i couldn't find anything...:-(

more

Try looking at particle filters when tracking multiple points

( 2012-11-21 15:31:28 -0600 )edit

theodore, this faq site does not allow for discussions on a question thread, like a regular forum. It is a question - first paragraph, then ONLY answers are accepted below. You can use comments for short, objective additions to an answer/question, but if you have a new question the RULE is to ask a new Question http://answers.opencv.org/questions/ask/

( 2012-11-22 00:30:45 -0600 )edit

It does work with 2D matrices, here is a link to someone that has got it working.

more

the mouse tracking is cool, man!! :D. and I also believe it does not work with 2D matrcies

( 2012-10-15 01:48:45 -0600 )edit

Official site

GitHub

Wiki

Documentation