ByteTrack-cpp icon indicating copy to clipboard operation
ByteTrack-cpp copied to clipboard

The rect of the STrack should be updated in the predict function

Open teststation5 opened this issue 7 months ago • 0 comments

I believe without the updateRect noted below in the Strack predict function, the Kalman filter is basically ignored for matching the object rect from frame to frame. It still works to a point if the objects don't move much (basically predicting the object stays in the same spot), but it falls apart with objects moving a moderate amount from frame to frame.

void byte_track::STrack::predict() { if (state_ != STrackState::Tracked) { mean_[7] = 0; } kalman_filter_.predict(mean_, covariance_);

//need to add this missing call here
updateRect(); 

}

In the code this project was derived from [ByteTrack-CPP-ncnn], the strack predict function was fixed with commit https://github.com/FoundationVision/ByteTrack/commit/b500c6f3abd7d536b8786f9c7ead33b4c4c13855 that added:

stracks[i]->static_tlwh(); stracks[i]->static_tlbr();

after the kalman_filter.predict call

teststation5 avatar Jun 27 '25 20:06 teststation5