sort icon indicating copy to clipboard operation
sort copied to clipboard

Why is dim_x set to 7 in KalmanFilter

Open litingfeng opened this issue 5 years ago • 3 comments

Hi,

Thanks for your great work.

I was trying to understand the parameter here in this line: self.kf = KalmanFilter(dim_x=7, dim_z=4)

From the document here, dim_x means

Number of state variables for the Kalman filter.

dim_z means

Number of of measurement inputs.

From my understanding, dim_z=4, because there are 4 measurements x,y,s,r .

But why is that dim_x=7?

Thanks,

litingfeng avatar Mar 28 '20 21:03 litingfeng

The latent state of the Kalman filter also estimates the velocity of the object. This can be thought of as a delta applied at each time-step to update the position (x, y) and scale (s). The aspect ratio (r) is assumed to be constant. See section 3.2 of the SORT paper.

abewley avatar Apr 19 '20 20:04 abewley

@abewley If I may ask is there a motivation behind a constant aspect ratio assumption other than reducing complexity? Great work btw.

Thanks

nihalsangeeth avatar Aug 03 '21 17:08 nihalsangeeth

In SORT paper, it says these 7 states are : image @nihalsangeeth, I think the reason is not naively to reduce complexity, but the reality is that ratio of an object should not grow linearly. The sort paper and the code both assume the motion model is linear velocity model, imaging the car dirve on the road towards you, its u, v, s can grow linearly, but the ratio can not grow linearly(or grow linearly very very slow). By the way, if the ratio grow linearly and take it into account, the state transition matrix will change to :

        self.kf.F = np.array([ 
            [1, 0, 0, 0, 1, 0, 0, 0], 
            [0, 1, 0, 0, 0, 1, 0, 0], 
            [0, 0, 1, 0, 0, 0, 1, 0], 
            [0, 0, 0, 1, 0, 0, 0, 1],
            [0, 0, 0, 0, 1, 0, 0, 0], 
            [0, 0, 0, 0, 0, 1, 0, 0],
            [0, 0, 0, 0, 0, 0, 1, 0]])

What it means behind is r = r + dr * Δt

wwdok avatar May 08 '22 16:05 wwdok