I have a few questions:
For the example specified in the openCV document:
/ * generate measurement * / cvMatMulAdd (kalman-> measure_matrix, state, measurement, measurement);
It is right? In the tutorial: An introduction to the Kalman filter from Welch and Bishop in Equation 1.2 says that measurement = H * state + noise measurement
It seems that both are not the same.
- I tried to implement scanned ball tracking for one ball. I tried the following: (Please indicate if I am doing this incorrectly.)
To measure, I measure two things: a) xb) y the centroid of the ball.
I just mention lines that are different from the example given in the opencv documentation.
CvKalman* kalman = cvCreateKalman( 5, 2, 0 ); const float A[] = { 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1}; CvMat* state = cvCreateMat( 5, 1, CV_32FC1 ); CvMat* measurement = cvCreateMat( 2, 1, CV_32FC1 ); //initialize the state of kalman filter state->data.fl[0] = mean_c; state->data.fl[1] = mean_r; state->data.fl[2] = mean_c - prev_mean_c; state->data.fl[3] = mean_r - prev_mean_r; state->data.fl[4] = 9.81;
after initialization, this is what fails
cvMatMulAdd (kalman-> transition_matrix, state, kalman-> process_noise_cov, state);