Search code examples
opencvmatrixlinear-algebraalgebrakalman-filter

O'Reilly book clarification on 2D linear system


The Oreilly book "Learning OpenCV" states at page 356 :

Quote

Before we get totally lost, let’s consider a particular realistic situation of taking measurements on a car driving in a parking lot. We might imagine that the state of the car could be summarized by two position variables, x and y, and two velocities, vx and vy. These four variables would be the elements of the state vector xk. Th is suggests that the correct form for F is:

x = [ x; 
      y;
      vx;
      vy; ]k

F = [ 1, 0, dt, 0;  
      0, 1, 0,  dt;
      0, 0, 1,  0;
      0, 0, 0,  1; ]

It seems natural to put 'dt' just there in the F matrix but I just don't get why. What if I have a n states system, how would I spray some "dt" in the F matrix?


Solution

  • The dts are coefficients of the velocities with the corresponding positions. If you write your state update after time dt has elapsed:

    x(t+dt) = x(t) + dt * vx(t)
    y(t+dt) = y(t) + dt * vy(t)
    vx(t+dt) = vx(t)
    vy(t+dt) = vy(t)
    

    You can read F off of these equations pretty easily.