I'm new to Kalman filtering, but is it possible to apply kalman filter for prediction and tracking of objects in video frames using MATLAB?
Further info: I have a sequential set of 20 images of a bullet coming out of a gun (A burst shot of images). I did some image processing on the frames and now i'm able to indicate the bullet as a point. Can I predict the bullet's position in the 21st frame?
NOTE: I got to know that, I need to loop the image frames and make a video and then put it for kalman filter prediction. But is it possible to do the prediction without making the frames into a video.
Thank you.
If you have applied Kalman filter for the starting 20 frames, then you will understand the following answer.
If you don't have the 21st frame.
Then X(t+1) = A*X(t)+B(u)+Noise
This is the predict statement, and you can predict the value at frame 21st. A= state ,atrix, B= control matrix. X(t) = position of the bullet in the 20th frame assigned by the kalman filter.
If u dont have the 21st frame, then you can use the above value to show the bullet in the 21st frame. This is one of the main features of kalman filter i.e even if you don't have observation value, still you can predict the value in the next frame., which is a very common practical case, because most of the time the sensors don't pick the objects, and there is no observation value.
And if you get the 21st frame, then take the observation value and update your prediction.
I would recommend to check Student dave tutorial on youtube for kalman filter and tracking. And go to the udacity course on Udacity link.
A kalman filter function for your problem would like
void Kalman_Filter(float *Zx, float *Zy)
{
Mat Zt = (Mat_<float>(2, 1) << *Zx, *Zy);
//prediction
Predict = A*Prior;// +B*a;
//covariacne
P = P*P*A.t() + Ex;
//measurement uopdate
Mat Kt = P*H.t()*(H*P*H.t() + Ez);
//
Prior = Predict + Kt*(Zt - H*Predict);
//
P = (I - Kt*H)*P;
//
*Zx = Prior.at<float>(0, 0);
*Zy = Prior.at<float>(1, 0);
//
return;
}
here *Zx and *Zy are the observation values and contains the x and y position of the point size bullet,which you have found out.