Ask Your Question

Revision history [back]

That piece of code is just plain incorrect. Not sure why the pointer should be there.

KF.transitionMatrix = *(Mat_<float>(4, 4) << 1,0,1,0, 0,1,0,1, 0,0,1,0, 0,0,0,1);

should at least be

KF.transitionMatrix = (Mat_<float>(4, 4) << 1,0,1,0, 0,1,0,1, 0,0,1,0, 0,0,0,1);

as you can see in the official Kalman filter example!

That piece of code is just plain incorrect. incorrect because you are adding a pointer to a smart pointer, which is unusual in C++. Not sure why the pointer should be there.

KF.transitionMatrix = *(Mat_<float>(4, 4) << 1,0,1,0, 0,1,0,1, 0,0,1,0, 0,0,0,1);

should at least be

KF.transitionMatrix = (Mat_<float>(4, 4) << 1,0,1,0, 0,1,0,1, 0,0,1,0, 0,0,0,1);

as you can see in the official Kalman filter example!