code: def __init__(
      self,
      dim_x,
      dim_z,
      pos_variance=10,
      pos_vel_covariance=0,
      vel_variance=1,
      q=0.1,
      r=4,
  ):
      self.dim_z = dim_z
      self.x = np.zeros((dim_x, 1))
  
      # matrix P from Kalman
      self.pos_variance = np.zeros((dim_z, 1)) + pos_variance
      self.pos_vel_covariance = (
          np.zeros((dim_z, 1)) + pos_vel_covariance
      )
      self.vel_variance = np.zeros((dim_z, 1)) + vel_variance
  
      self.q_Q = q
  
      self.default_r = r * np.ones((dim_z, 1))
  
imports: from abc import ABC, abstractmethod
  import numpy
  from filterpy.kalman import KalmanFilter
label_desc: Use image node_id 1 to create a new OptimizedKalmanFilter object  with example: obj = OptimizedKalmanFilter(dim_x, dim_z, pos_variance, pos_vel_covariance, vel_variance, q, r)