ClementPinard / SfmLearner-Pytorch

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

About loading the intrinsics in kitti_raw_loader.py #64

Closed gengrui1983 closed 5 years ago

gengrui1983 commented 5 years ago

Hi Clement,

Sorry that this might be an easy question but it is really the one confusing me quite a while.

This is how you get the intrinsic. https://github.com/ClementPinard/SfmLearner-Pytorch/blob/94b261942a618cfbfa612a91c46c1922adbb3320/data/kitti_raw_loader.py#L178

I remember the P_rect is a 3x4 matrix, but why the P_rect[:, :3] is the intrinsic? Could you please help to give more details on it?

Thank you very much.

Regards, Rui

ClementPinard commented 5 years ago

P_rect IS the intrinsics matrix of rectified frames. The last row is the lateral shift between left frame and right frame (in terms of pixels, relative to the focal length).

In the metadata there are several matrices, most of them are regular rotation translation matrices, like R_rect. The P matrix on the contrary is related to the frame space.

gengrui1983 commented 5 years ago

Thank you @ClementPinard !