nwojke / deep_sort

Simple Online Realtime Tracking with a Deep Association Metric
GNU General Public License v3.0
5.16k stars 1.45k forks source link

Edit Kalman Filter #302

Open Mr-Akbari opened 1 year ago

Mr-Akbari commented 1 year ago

Thanks for sharing your work. I want to use Kalman filter with this input : (x, y, vx, vy). Contains the bounding box center position (x, y) and their respective velocities. (without aspect ratio a and height h) So I edit your code :

class KalmanFilter(object):
    def __init__(self):
        ndim, dt = 2, 1.
        self._motion_mat = np.eye(2 * ndim, 2 * ndim) 
        ...
    def initiate(self, measurement):
        ...
        std = [
            2 * self._std_weight_position,
            2 * self._std_weight_position,
            10 * self._std_weight_velocity,
            10 * self._std_weight_velocity]
        ...
    def predict(self, mean, covariance):
        std_pos = [
            self._std_weight_position,
            self._std_weight_position]
        std_vel = [
            self._std_weight_velocity,
            self._std_weight_velocity]
        ...
    def project(self, mean, covariance, confidence=.0):
        std = [
            self._std_weight_position,
            self._std_weight_position]
        ...

But it is not working well. I really appreciate it if you answer these questions. Thanks very much.