Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R_rect_00 missing from loaded odometry calibration data #72

Open
owlshrimp opened this issue Mar 24, 2023 · 1 comment
Open

R_rect_00 missing from loaded odometry calibration data #72

owlshrimp opened this issue Mar 24, 2023 · 1 comment

Comments

@owlshrimp
Copy link

owlshrimp commented Mar 24, 2023

Hello,

I am trying to project velodyne (and eventually SLAM) 3D points to 2D image coordinates (say, for camera 0) for the kitti odometry dataset. https://www.cvlibs.net/datasets/kitti/eval_odometry.php

From [1] page 4-5, the appropriate stackup of matrices for projecting velodyne data seems to be:
2D_point = P_rect_00 * R_rect_00 * T_cam0_velo * 3D_velo_point

However, this doesn't seem to directly apply to the odometry dataset. For example:
dataset_path = "......../dataset"
sequence = '00'
dataset = pykitti.odometry(dataset_path, sequence, frames=range(0, 20, 5))
print("dataset.P_rect_00:\n{}".format(dataset.calib.P_rect_00)) # prints out a 3x4 matrix
print("dataset.R_rect_00:\n{}".format(dataset.calib.R_rect_00)) # throws an error because R_rect_00 doesn't exist

Simply put, https://github.com/utiasSTARS/pykitti/blob/master/pykitti/raw.py defines P_rect_00, R_rect_00, T_cam0_velo, and K_cam0
Meanwhile, https://github.com/utiasSTARS/pykitti/blob/master/pykitti/odometry.py only defines P_rect_00, T_cam0_velo, and K_cam0

From the latter, R_rect_00 is missing. Is this term somehow folded into the other matrices, or otherwise not needed? ie:
2D_point = P_rect_00 * T_cam0_velo * 3D_velo_point

Should it be grabbed from the raw API? (it's not immediately clear to me which R_rect_00 should be used, if so)

It would be very helpful if someone could shed light on this, as it seems projection of 3D points to 2D for the odometry dataset specifically is completely undocumented on the internet.

Thanks,
-Matthew

[1] https://www.cvlibs.net/publications/Geiger2013IJRR.pdf Vision meets Robotics: The KITTI Dataset
https://www.cvlibs.net/publications/Geiger2012CVPR.pdf is sparse on equivalent instructions.

@owlshrimp
Copy link
Author

owlshrimp commented Mar 24, 2023

I did also notice that there exists "Compute the rectified extrinsics from cam0 to camN" on line 166:
https://github.com/utiasSTARS/pykitti/blob/master/pykitti/odometry.py#L166
which is used (only) in the computation of T_cam1_velo/T_cam2_velo/T_cam2_velo and not made directly available. It is derived from P_rect_xx.

I can only guess that maybe the rectification has already been done or is already incorporated into the odometry dataset's data?
That would suggest that perhaps R_rect_00 could be skipped over as above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant