ClementPinard / SfmLearner-Pytorch

Pytorch version of SfmLearner from Tinghui Zhou et al.
MIT License
1.01k stars 226 forks source link

how to understand 'odo_pose = imu2cam @ np.linalg.inv(origin) ...........' , #83

Closed AdamAsh2019 closed 4 years ago

AdamAsh2019 commented 4 years ago

why imu2cam and its inverse are used at the same time?

ClementPinard commented 4 years ago

Hi, this is a classic formula for change of basis.

The main idea is that the rotation is given with respect to imu. As such, for a point given with respect to camera, you need to transfer it to coordinates wrt imu, rotate it with the matrix, and then transfer it back to coordinates wrt to camera. As such, if P is the matrix related to the change of base from imu to camera, and R the rotation with respect to imu coordinates, the rotation camera with respect to camera coordinates (the one we actually want) will be PRP^-1

See more info e.g. here : https://en.wikipedia.org/wiki/Change_of_basis#Change_of_basis