filtering noise from a transformation matrix, vs a quaternion

asked 2017-06-07 09:23:43 -0500

antithing gravatar image

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.


filter the quaternion in a different way.


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!

edit retag flag offensive close merge delete



In my opinion:

  1. filtering each value of the 4x4 transformation matrix is not correct for the rotation part (the rotation matrix should keep some properties: determinant=1, etc.)
  2. should be the preferable solution but you will have to search in the literature and probably use an extended (or any non-linear) Kalman filter
  3. should be more or less ok and quite easy to implement
Eduardo gravatar imageEduardo ( 2017-06-07 09:54:33 -0500 )edit

Thank you. I have been trying to extend the kalman i am using to take multiple values and quats, but it is making my brain explode. If 1 is out, i will try 3. thanks again.

antithing gravatar imageantithing ( 2017-06-07 11:27:56 -0500 )edit