public void KalmanFilter() { mousePoints = new List <PointF>(); kalmanPoints = new List <PointF>(); kal = new KalmanFilter(4, 2, 0); syntheticData = new SyntheticData(); Matrix <float> state = new Matrix <float>(new float[] { 0.0f, 0.0f, 0.0f, 0.0f }); /* * kal.CorrectedState = state; * kal.TransitionMatrix = syntheticData.transitionMatrix; * kal.MeasurementNoiseCovariance = syntheticData.measurementNoise; * kal.ProcessNoiseCovariance = syntheticData.processNoise; * kal.ErrorCovariancePost = syntheticData.errorCovariancePost; * kal.MeasurementMatrix = syntheticData.measurementMatrix; */ state.Mat.CopyTo(kal.StatePre); syntheticData.transitionMatrix.Mat.CopyTo(kal.TransitionMatrix); // kal.TransitionMatrix = syntheticData.transitionMatrix; syntheticData.measurementNoise.Mat.CopyTo(kal.MeasurementNoiseCov); // kal.MeasurementNoiseCovariance = syntheticData.measurementNoise; syntheticData.processNoise.Mat.CopyTo(kal.ProcessNoiseCov); // kal.ProcessNoiseCovariance = syntheticData.processNoise; syntheticData.errorCovariancePost.Mat.CopyTo(kal.ErrorCovPost); // kal.ErrorCovariancePost = syntheticData.errorCovariancePost; syntheticData.measurementMatrix.Mat.CopyTo(kal.MeasurementMatrix); // kal.MeasurementMatrix = syntheticData.measurementMatrix; }
public void KalmanFilter() { mousePoints = new List<PointF>(); kalmanPoints = new List<PointF>(); kal = new Kalman(4, 2, 0); syntheticData = new SyntheticData(); Matrix<float> state = new Matrix<float>(new float[] { 0.0f, 0.0f, 0.0f, 0.0f }); kal.CorrectedState = state; kal.TransitionMatrix = syntheticData.transitionMatrix; kal.MeasurementNoiseCovariance = syntheticData.measurementNoise; kal.ProcessNoiseCovariance = syntheticData.processNoise; kal.ErrorCovariancePost = syntheticData.errorCovariancePost; kal.MeasurementMatrix = syntheticData.measurementMatrix; }
public KalmanTracker() { kalmanPoints = new List <PointF>(); kal = new Kalman(4, 2, 0); syntheticData = new Kalman_Filter.SyntheticData(); Matrix <float> state = new Matrix <float>(new float[] { 0.0f, 0.0f, 0.0f, 0.0f }); kal.CorrectedState = state; kal.TransitionMatrix = syntheticData.transitionMatrix; kal.MeasurementNoiseCovariance = syntheticData.measurementNoise; kal.ProcessNoiseCovariance = syntheticData.processNoise; kal.ErrorCovariancePost = syntheticData.errorCovariancePost; kal.MeasurementMatrix = syntheticData.measurementMatrix; }