Cameshift 卡爾曼追蹤 //kalman初始化 CvKalman* InitializeKalman(CvKalman* kalman) { const float A[] = {1,0,1,0, 0,1,0,1, 0,0,1,0, 0,0,0,1}; kalman = cvCreateKalman( 4, 2, 0 ); memcpy( kalman->transition_matrix->data.fl, A, sizeof(A));//A cvSetIdentity( kalman->measurement_matrix, cvScalarAll (1) );//H cvSetIdentity( kalman->process_noise_cov, cvScalarAll(1e-5) );//Q w ; cvSetIdentity( kalman->measurement_noise_cov, cvScalarAll(1e-1) );//R v cvSetIdentity( kalman->error_cov_post, cvScalarAll(1));//P return kalman; } (1) );//H cvSetIdentity( kalman->process_noise_cov, cvScalarAll(1e-5) );//Q w ; cvSetIdentity( kalman->measurement_noise_cov, cvScalarAll(1e-1) );//R v cvSetIdentity( kalman->error_cov_post, cvScalarAll(1));//P return kalman; }