Advertisement
lamiastella

Kalman filter for SR300

Jun 8th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1.     dists = new float[3 * numPixels]; // Dists contains XYZ values. needs to be 3x the size of numPixels
  2.     amps = new float[numPixels];
  3.     //frame = cvCreateImage(cvSize(depth_width, depth_height), 8, 3); // Create the frame
  4.     frame = cv::Mat(cv::Size(depth_width, depth_height), CV_8UC3);
  5.  
  6.     KF.init(6, 3, 0);
  7.     KF.transitionMatrix = (cv::Mat_<float>(6, 6) << 1, 0, 0, 1, 0, 0,
  8.         0, 1, 0, 0, 1, 0,
  9.         0, 0, 1, 0, 0, 1,
  10.         0, 0, 0, 1, 0, 0,
  11.         0, 0, 0, 0, 1, 0,
  12.         0, 0, 0, 0, 0, 1);
  13.     measurement = cv::Mat_<float>::zeros(3, 1);
  14.  
  15.     //Initaite Kalman
  16.     KF.statePre.setTo(0);
  17.     setIdentity(KF.measurementMatrix);
  18.     setIdentity(KF.processNoiseCov, cv::Scalar::all(.001)); // Adjust this for faster convergence - but higher noise
  19.     setIdentity(KF.measurementNoiseCov, cv::Scalar::all(1e-1));
  20.     setIdentity(KF.errorCovPost, cv::Scalar::all(.1));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement