tracking an object using kalman filter

hi all, i'm using kalman filter for prediction of a path. suppose i have a ball in an image. now if the ball is falling vertically downwards without any lateral movement, my matrix B=[0 0 0 g]' , but if along with gravitational force, i apply a force at an angle to ball the ball will move in the opposite direction to the applied force. now my question is what will happen to my matrix B?
your help will be very much appreciated and thanks in advance.

4 Comments

also i.m using this code:
clear,clc
% compute the background image
Imzero = zeros(240,320,3);
for i = 1:5
Im{i} = double(imread(['DATA/',int2str(i),'.jpg']));
Imzero = Im{i}+Imzero;
end
Imback = Imzero/5;
[MR,MC,Dim] = size(Imback);
but it is show me an error:
Undefined function or variable 'Imzero'.
Error in extractball (line 8)
Imback = Imzero/5;
i don't know what to do here.. please help me out.. thanks in advance
Zeeshan - it isn't clear to me how the observed error is generated from the code that you gave provided. Could you please attach the extractball.m file that has all the code?
As for using the Kalman Filter, how does your B matrix fit into the algorithm?
the state equation for the kalman filter is x(t+1) = Ax(t) + Bu(t) + Gw(t). where x(t+1) is the present estimate of the ball. x(t) is the previous position of the ball. A is the state matrix. B is the control matirx and u(t) is the control vactor.
Zeeshan - are you still observing the same error message? If so, please post your code to the extractball function.

Sign in to comment.

Asked:

on 8 Jan 2015

Commented:

on 10 Jan 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!