Common dependencies like numpy
, matplotlib
, PIL
File | Description |
---|---|
kitti_demo_notebook.ipynb |
Jupyter Notebook with dataset visualisation routines and output. |
Kitti.py |
Methods for parsing labels, calibration information, image and lidar point clouds. |
utils.py |
Method for projecting 3D to 2D and its invers transformation. |
Download the data (calib, image_2, label_2, Velodyne) from KITTI website.
And place it in your data folder at Kitti
. The folder structure is as following:
kitti
training
calib
000000.txt
image_2
000000.png
label_2
000000.txt
velodyne
000000.bin
pred
000000.txt
For a implementation demo see notebook. For more exploration and implementation details see Kittp.py and utils.py.
- 3D boxes on LiDar point cloud in velodyne coordinate. Implemented by
draw_3DBBox_in_velo()
. RESULT. - 2D and 3D boxes on in image2 coordinate. Implemented by
draw_2DBBox_in_rgb()
anddraw_3DBBox_in_rgb()
. 2D_RESULT and 3D_RESULT. - Point clouds visualize in velodyne coordinate. Implemented by
draw_pointclouds_in_velo()
. RESULT. - LiDar data on Camera image. Implmented by
draw_pointclouds_in_rgb()
. RESULT.
- 3d XYZ in <label>.txt are in rect camera coord.
- 2d box xy are in image2 coord
- Points in <lidar>.bin are in Velodyne coord.
y_image2 = P^2_rect * x_rect
y_image2 = P^2_rect * R0_rect * Tr_velo_to_cam * x_velo
x_ref = Tr_velo_to_cam * x_velo
x_rect = R0_rect * x_ref
P^2_rect = [f^2_u, 0, c^2_u, -f^2_u b^2_x;
0, f^2_v, c^2_v, -f^2_v b^2_y;
0, 0, 1, 0]
= K * [1|t]
image2 coord:
----> x-axis (u)
|
|
v y-axis (v)
Velodyne coordinate system:
front x, left y, up z
# 7 -------- 4
# /| (z) /|
# 6 ---|---- 5 .
# | | | | |
# . 3 -|------ 0
# |/ .- - -|/ - - -> (y)
# 2 --/------- 1
# /
# /
# (x)
rect/ref camera coord:
right x, down y, front z
# 7 -------- 4
# /| /|
# 6 -------- 5 .
# | | | |
# . 3 -------- 0
# |/ .- - -|/ - - -> (x)
# 2 --/-|----- 1
# / |
# / | (y)
# (z)
Ref (KITTI paper): http://www.cvlibs.net/publications/Geiger2013IJRR.pdf