BrownBiomechanics / Autoscoper

Autoscoper is a 2D-3D image registration software package.
https://autoscoper.readthedocs.io
Other
8 stars 5 forks source link

Splining The Euler Angles #226

Closed DajungYoon closed 8 months ago

DajungYoon commented 11 months ago

This is the interpolation between key frames 128 and 140. The interpolation of the signals (X,Y,Z,Yaw,Pitch,Roll) look smooth but there is a strange translation happening between frames.

@mjrainbow - Is it splining Euler angles or does it convert to quaternions internally to do the spline? I ask because splining the Euler angles could be problematic.

https://github.com/BrownBiomechanics/Autoscoper/assets/93012111/1b8a557a-5e1b-4542-918d-5a976257ccd0

NicerNewerCar commented 11 months ago

The interpolation is being performed on the Euler angles. Below is the libautoscoper::KeyCurve class that handles the keyframes, interpolation, and tracking curves. This class is generalized to work on all six DOF, it does not look like there is any special case for the Euler angle curves.

https://github.com/BrownBiomechanics/Autoscoper/blob/73eb359dcd70878c4b4c28471fd2684c08bd3014/libautoscoper/src/KeyCurve.cpp#L174-L220

This page provides a couple of great visuals for why we shouldn't perform interpolation directly on Euler angles.

Luckily, a quaternion implementation is already in the Autoscoper codebase.