相机标定
相机内参标定
- 首先采集不同位置的标定板照片
- matlab工具箱选择
Camera Calibrator
工具

- 导入采集好的标定图片

- 输入标定板尺寸

- 检查每个图片的坐标系是否一致,剔除不一致的图片
- 检查完之后,选择这几个按钮,点击标定

- 剔除误差大的值,直到所有误差值均小于0.5

- 导出内参

相机单应矩阵标定
标定世界坐标系
在相机画面中选择四个标定点,测得四个标定点的真实距离,如下示例:

测量示例中 1、2、3、4
位置的像素坐标以及各个点之间的真实距离,调用 cv::findHomography
方法获取单应矩阵。
homographyMatrix = cv::findHomography(pixelCoords, worldCoords, 0);
其中 pixelCoords
为 1、2、3、4
位置像素坐标:worldCoords = {{x1, y1}, {x2, y2}, {x3, y3}, {x4, y4}};
worldCoords
为 1、2、3、4
位置对应的世界坐标信息,怎样生成worldCoords
数组?
此处假设 1、2、3、4
点构成矩形,且矩形宽高为L、H,将坐标原点建立在位置 1
处,则 1、2、3、4
位置的世界坐标为:worldCoords = {{0, 0}, {L, 0}, {L, H}, {H, 0}};
当然坐标原点也可以选择其他位置,worldCoords
内的位置信息改距坐标原点的信息即可。
也可以实现像素坐标转GPS坐标,不需要建立原点,只需将 worldCoords
中四个点的位置坐标改为对应的GPS坐标即可。
雷达相机联合标定
LIDAR2Camera 手动标定
标定工具:https://github.com/PJLab-ADG/SensorsCalibration/tree/master/lidar2camera
依赖库:
- Pangolin(0.6版本):https://github.com/stevenlovegrove/Pangolin/tree/v0.6
# PCL(1.9.1版本)
sudo apt remove libpcl-dev
# 避免版本冲突
git clone -b pcl-1.9.1 https://github.com/PointCloudLibrary/pcl.git
cd pcl
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
然后编译 /lidar2camera/manual_calib/
程序就好了。
autoware标定工具
安装标定工具
git clone https://github.com/FENGZHANG123/autoware_camera_lidar_calibrator
catkin_make
source devel/setup.bash
rosrun calibration_camera_lidar calibration_toolkit
安装依赖库
sudo apt install ros-noetic-jsk-recognition-msgs
sudo apt install ros-noetic-jsk_footstep_msgs
安装nlopt
# 下载:
https://github.com/stevengj/nlopt/archive/v2.7.1.tar.gz
cmake .. && make && sudo make install
修改 calibration_camera_lidar/CMakeLists.txt
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories( /usr/local/include)
link_directories(/usr/local/lib)
matlab标定
- 采集同一时刻雷达与图像的标定板数据

- 与相机内参标定类似,导入图片与pcd点云文件,并设置棋盘格大小

- 绘制感兴趣区域,这样可以降低雷达检测范围,可以通过
Dimension Tolerance、Cluster Threshold
控制标定板检测结果,然后点击Calibrate
标定,将旋转、平移与重投影误差误差降低到设定范围内,导出外参即可。
