Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

filtering noise from a transformation matrix, vs a quaternion

I am tracking an object, with opencv, in a video stream. The returned values are noisy, so I want to filter them to smooth out the animation curve.

Currently, i have the data as an Eigen::vector3d for position, and an Eigen::Quaterniond for rotation.

The kalman filtering that I use only takes one value at a time, so i create an instance of the filter for position X, one for position Y, one for position Z.

that bit is easy. My question is:

Am I likely to see any weirdness if I take this same approach with a quaternion? I imagine yes, as the values will change from the filtering, and screw up the rotation.

So, am i better to:

Create a 4x4 transformation matrix from my vector3d and quaternion3d. filter each of these values. recreate my quat and vector.

or:

filter the quaternion in a different way.

or:

convert to euler, filter each axis, then convert back.

None of these options seem ideal. But which is most likely to give a decent result?

thank you!