The first just does detection by background subtraction. This can be considered as the ground truth.
The second feeds the detection output into a Kalman filter. The predicted position from the kalman filter (red) is compared against the actual ground truth position (green).
I don't know whether i have misunderstood or not, but some of the important codes are wrong.
In the line 51 of file kalman.m, x(i,:) = (xp + K*([cc(i),cr(i)]' - H*xp))', you just predicte the current position with the current real position and plot them in the same time.
That's why you get such a perfect result.
And I take a reference to other version of Kalman code like this one.
Just change it to the following code:
x(i+1,:) = (xp + K*([cc(i),cr(i)]' - H*xp))';
Correct me if i'm wrong.
Please correct me if I miss something.
I think your code is wrong, though it is working.
The state prediction:
xp=A*x(i-1,:)' + Bu
will give as a result the same vector x with the g in the last element.
xp = [MC/2,MR/2,0,0]'.
It is a bit pointless, since the dt elements will always be cancel out by the last zeros. Then you do correctly the observation step and the algorithm is working, but the prediction practically doesn't exist.
Good work! Could you send me a link or a document with the explanation of the algorithm?
I don´t know why you include some variables that not are included in Matlab examples. For example: Bu.
The matrix dimensions are also different...
Link to this code: http://codeviewer.org/view/code:2b99
hi sir i am doing project on system identification by measuring RSS values and i wil compare it with the offline values and i have to calculate the distance by kernel and kalman can you tel me or send me the code please.
My ID firstname.lastname@example.org
Some further explanation of some of the functions would be greatly appreciated!!! I am working on a thesis comparing different methods of object tracking, one is using the Kalman filter.
I am trying to use the same code for a simple video of a person walking past a security camera, the camera is looking straight at the relevant object. When I run the detect.m file using my own video, it starts off great, with the green circle tracking the object, once it goes half way through the video images, the green circle increases in size and the tracking is incomplete. can anyone help me please???
Thanks for sharing the code.
Please can you say how kalman filter helps in tracking .
In this code you have done detection in every frame and this output is provided as the input to the kalman filter.So background subtraction and kalman filter will give similar results.So please can you explain the use of kalman filter here.