Project the PointCloud to the image & Generate the LiDAR PointCloud with color.
This code is to porject the LiDAR point cloud to the image & generate the point cloud with color
Calib files
Support two kinds of calib files’ type.
- R_rect: shape 3*3
- P_rect: shape 3*4
- Tr: shape 3*4
The parameters are stored in two files. One is for the camera, the other is for LiDAR2Cam. e.g. KITTI raw
- R_rect: shape 3*3
P_rect: shape 3*4
R: shape 3*3
- T: shape 3*1
Put all the images into img, and put all the point cloud files into lidar(Notice: The filename of the image and the corresponding point cloud file should be the same.). Put the calib file into calib
Set the parameters in main.py.
CALIB_TYPE: 0:All parameters in one file; 1:Parameters are stored in two files
If CALIB_TYPE == 0:
- CALIB: Path of the calib file
If CALIB_TYPE == 1:
- CAM2CAM: Path of the calib file for camera
- LIDAR2CAM: Path of the calib file for LiDAR2Cam
For the multi-camera sensor system like KITTI, you need to set it to the ID of the camera. For the system which only has one camera, it is set to be 0.
Run main.py to get the result.
python main.py
The result image is saved in the path you set
python pcd_vis.py
The BEV & FV is saved in the path you set