Ask Your Question
1

using Kalman Filter

asked 2012-10-08 07:17:15 -0600

TSL_ gravatar image

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??

OpenCV documentation does not tell clearly about this. Anyone has tried, plz give me a hint

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
6

answered 2012-10-08 12:15:07 -0600

sammy gravatar image

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.

edit flag offensive delete link more
1

answered 2012-10-15 01:51:54 -0600

TSL_ gravatar image

updated 2012-10-15 01:53:12 -0600

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

edit flag offensive delete link more
0

answered 2012-11-21 04:24:41 -0600

theodore gravatar image

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...:-(

edit flag offensive delete link more

Comments

Try looking at particle filters when tracking multiple points

imran gravatar imageimran ( 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/

sammy gravatar imagesammy ( 2012-11-22 00:30:45 -0600 )edit
0

answered 2012-10-08 07:53:31 -0600

imran gravatar image

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

http://www.morethantechnical.com/2011/06/17/simple-kalman-filter-for-tracking-using-opencv-2-2-w-code/

edit flag offensive delete link more

Comments

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

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

Question Tools

2 followers

Stats

Asked: 2012-10-08 07:17:15 -0600

Seen: 3,024 times

Last updated: Nov 21 '12