class_docstr: A simple Kalman filter for tracking bounding boxes in image space.
  
  The 8-dimensional state space
  
      x, y, a, h, vx, vy, va, vh
  
  contains the bounding box center position (x, y), aspect ratio a, height h,
  and their respective velocities.
  
  Object motion follows a constant velocity model. The bounding box location
  (x, y, a, h) is taken as direct observation of the state space (linear
  observation model).
class_docstr_tok: ["A","simple","Kalman","filter","for","tracking","bounding","boxes","in","image","space",".","The","8-dimensional","state","space","x",",","y",",","a",",","h",",","vx",",","vy",",","va",",","vh","contains","the","bounding","box","center","position","(","x",",","y",")",",","aspect","ratio","a",",","height","h",",","and","their","respective","velocities",".","Object","motion","follows","a","constant","velocity","model",".","The","bounding","box","location","(","x",",","y",",","a",",","h",")","is","taken","as","direct","observation","of","the","state","space","(","linear","observation","model",")","."]
docstr: Run Kalman filter correction step.
  
  Args:
      mean (ndarray): The predicted state's mean vector (8 dimensional).
      covariance (ndarray): The state's covariance matrix (8x8 dimensional).
      measurement (ndarray): The 4 dimensional measurement vector
          (x, y, a, h), where (x, y) is the center position, a the aspect
          ratio, and h the height of the bounding box.
  
  Returns:
      The measurement-corrected state distribution.
docstr_tok: ["Run","Kalman","filter","correction","step",".","Args",":","mean","(","ndarray",")",":","The","predicted","state","'s","mean","vector","(","8","dimensional",")",".","covariance","(","ndarray",")",":","The","state","'s","covariance","matrix","(","8x8","dimensional",")",".","measurement","(","ndarray",")",":","The","4","dimensional","measurement","vector","(","x",",","y",",","a",",","h",")",",","where","(","x",",","y",")","is","the","center","position",",","a","the","aspect","ratio",",","and","h","the","height","of","the","bounding","box",".","Returns",":","The","measurement-corrected","state","distribution","."]
code: def update(self, mean, covariance, measurement):
      """
      Run Kalman filter correction step.
  
      Args:
          mean (ndarray): The predicted state's mean vector (8 dimensional).
          covariance (ndarray): The state's covariance matrix (8x8 dimensional).
          measurement (ndarray): The 4 dimensional measurement vector
              (x, y, a, h), where (x, y) is the center position, a the aspect
              ratio, and h the height of the bounding box.
  
      Returns:
          The measurement-corrected state distribution.
      """
      projected_mean, projected_cov = self.project(mean, covariance)
  
      chol_factor, lower = scipy.linalg.cho_factor(
          projected_cov, lower=True, check_finite=False
      )
      kalman_gain = scipy.linalg.cho_solve(
          (chol_factor, lower),
          np.dot(covariance, self._update_mat.T).T,
          check_finite=False,
      ).T
      innovation = measurement - projected_mean
  
      new_mean = mean + np.dot(innovation, kalman_gain.T)
      new_covariance = covariance - np.linalg.multi_dot(
          (kalman_gain, projected_cov, kalman_gain.T)
      )
      return new_mean, new_covariance
  
file_path: PaddleHub/modules/video/multiple_object_tracking/jde_darknet53/modeling/mot/motion/kalman_filter.py
imports: import numpy
  import scipy.linalg
label_desc: Use image node_id 6 for calling the KalmanFilter obj's underlying member method code with example usage: obj.update(mean, covariance, measurement) and returns: new_mean,  new_covariance