Quote: Use the Force, Luke.
(Courtesy of fortune cookies)

Welcome to the Cool Spot of the Sun

Under Construction : This page bore out of a small explanation I had with a good friend of mine Sanket.

Computer vision is a very interesting topic and one of the most important and researched topic is Computer-Tracking of objects some links to research sites
Tracking
Multi-object Tracking

A very Important method of computer tracking is by using the Kalman Filter. A good site on Kalman is here. A visual tool for doing the same here and some slides here.

The slides are really interesting...Anyways kalman filtering is a very vast topic. I will give a brief intro here first starting with an example

Part-1:The Cause of all filters ERRORS

        Consider that you are sailing in a boat in the sea and taking the north star as your reference. Though north star position is static(relatively it also moves a litlle bit in million of years). If you are moving in certain direction at a speed that looks to be somewht constant, how do you measure how much you have moved.
        Recall 7th Grade maths? You take time and the velocity into consideration and then calculate via
distance travelled=time*velocity.
        Considering that you are in a sea so your velocity is not constant but in some /- range. You might be tempted to take average velocity into account, which though quite near the expected answer will introduce sometype or error in the whole calculatation. this makes the Distance travelled very much like say 150miles /-15 miles(considering a /-10% velocity error)
        Such error are permissible if you are not doing a very important calculation but in places like automated guidance missiles or say when you are flying an aircraft and you have to down an enemy plane somewhat away(like 2-3 miles atleast), this error should be in the range of cms, even tens of cms is not permissible. Otherwise you will be a sitting duck!
        Let's go to the first example of the boat in the sea and analyse the causes of error. The main evident cause of our problem was the error/noise in the instrument. What if we had a very very accurate instrument that can calculate.
        Even then there is a chance of error! Why??? because of the environment, Though our instrument may say that we have travelled so much distance, it might be fundamentally be wrong because we are in sea and we have to take into consideration the wind and the sea waves too. SO you see the problem, error/noise is introduced both by the system and the instrument(model). So what you do is if possible you can estimate the noise/error in both it will give more accuracy.
        A note here that the model or intrument noise is easy to gauge, like buy a better odometer to calc distance, with lesser error, but the environmental/system noise is hard to estimate. Normally the noise/error is estimated in form of variances(difference from the calculated)
        Lets take a simple example of a stationary ball being viewed by a camera and noting its position in each frame. If nothing changes the position in(x,y,z) is constant everytime. This is a simple P (position is constant) example.

P=constant everytime in all frames P1-P2 =0, P2-P3=0 ,etc PX represents Position in Xth frame. 

Now we can predict that in say 1000th frame, where the ball will be,

BUT Suppose there is an earthquake(system noise) occurs and thus
                    Px-Py !=0. this is system noise.
Similarly if the ball starts to move than for all x and y frames
                    Px-Py !=0

    [Note: In both above example Px and Py are position at instant 'x' and 'y']

Now you see that the ball once in motion we need to describe the movement too. 

 

          Remember the equation for distance:  d=p v*t
where,
    p=initial position
    v=constant velocity
    t=time

        Once this is taken into consideration, and assuming that the ball is moving constantly the distance travelled between frames will be the same, considering velocity and time between frames is constant. So if you want to predict that where the ball was in the next frame all you need to do is to fill values in the equation and solve.
which will be very easy like,

Say initial Po=0,v=1and t=1 then D1=1,D2=2,D3=3,D4=4 and so on for distance Di at time i. 

But seldom the world is fixed velocity, what if the ball is accelerating at some times than we need to account that too.
Our Original distance formulae changes to: d=p+v*t+a*t*t

        As you can see the model is becoming more complex as we try to increase the accuracy. Also see at this point that the model is recursive that is you can put the whole formulae stuff in a loop!
        This is all due to errors in the model, we can go more and more than we would need double triple and more differnetiation of accelaration and we dont have tools to estimate such high values. all we can do is find velocity and acceleration using those tools.
        But now we start depending more on the tools! its also bad as the tools have all errors. So we need to design a system that takes into consideration the measured values and the predicated values using formulaes and estimate the real correct world values. And that is wht kalman filter does
 

Kalman Filter Pseudo code

it goes into a loop
while(1)
{
        if(we are starting)using intital measurement find the predicted values
        get measurement
        difference = (predicted - measured)
        kalman gain = function of(predicted,measured)
        next predicted value = function of (current value,kalman gain)
}
    With each iteration it will go more and more better and it's an optimal or best filter possible!. Also remember that it would take all noises into consideration and would try to give the world values or the correct values(remember everything will give error in some degrees).
    World values are more important than anything when you are considering that we are say working to estimate GPS position,etc.
 

Now we go to the next part for a detailed analysis and working of the Kalman filter with a small example
Part-2:Kalman Filter

The best explanation for this is my project report on Kalman Filter



Get Firefox!  Use OpenOffice.org lastRSS.php - RSS parser for PHP Valid HTML 4.01! Valid CSS! IP Address Lookup


The visitor number 13195
Disclaimer