Camera-LIDAR 联合标定方法总结

本文详细介绍了Camera-LIDAR联合标定的步骤和方法,包括相机内参标定和外参标定,如lidar_camera_calibration、but_calibration_camera_velodyne及Autoware等。此外,还探讨了LIDAR-IMU和Camera-IMU的联合标定技术。
摘要由CSDN通过智能技术生成

项目需要融合雷达和相机,所以要做联合标定,记录下收集的标定方法。

一、总体标定步骤

标定就是找到雷达到相机的空间转换关系,在不同的坐标系之间转换需要旋转矩阵 R 和平移矩阵 T,为后续的雷达和相机数据融合做准备:

Camera-LIDAR 联合标定分为 2 步:

  1. 相机内参标定
  2. 雷达相机外参标定

相机内参标定方法

外参标定:lidar_camera_calibration

由于单目-Lidar融合SLAM实验代码可能因为不同的硬件设备软件环境而有所不同,这里提供一份基于Matlab的单目-Lidar融合SLAM实验代码供参考。 代码主要分为以下几个部分: 1. 相机Lidar的标定以及数据读取(使用Matlab内置的相机标定工具箱Velodyne的驱动程序) 2. 特征点提取匹配(使用SURF算法暴力匹配) 3. 运动估计地图构建(使用基于PnP的位姿估计方法基于Octree的点云地图构建方法) 代码如下: ```matlab % Camera-Lidar SLAM with SURF feature matching clear all close all % Camera calibration parameters load('cam_calib.mat'); K = cameraParams.IntrinsicMatrix'; D = [cameraParams.RadialDistortion cameraParams.TangentialDistortion 0]; % Lidar calibration parameters lidar = velodyneFileReader('lidar_data.pcap'); lidar.ScanDirection = 'Forward'; lidar.AzimuthOffsetCorrection = -45; lidar.ElevationAngleOffsetCorrection = 0; % SURF feature detection detector = vision.CascadeObjectDetector('NumScaleLevels',4,'ScaleFactor',1.2,'MergeThreshold',30); pointsPrev = []; featuresPrev = []; % Octree parameters octreeRes = 0.1; octreeMaxPts = 500; % SLAM loop while hasFrame(lidar) % Read camera and Lidar data img = read(lidar); ptCloud = velodyne2pc(img,'Columns',{'x','y','z','intensity'}); % Camera-Lidar calibration [R,t] = extrinsics(ptCloud.Location,K,D); T_lidar2cam = [R t';0 0 0 1]; % SURF feature matching bbox = step(detector,img); points = detectSURFFeatures(rgb2gray(img),'ROI',bbox); [features,points] = extractFeatures(rgb2gray(img),points); if ~isempty(pointsPrev) indexPairs = matchFeatures(features,featuresPrev,'Method','Exhaustive','MatchThreshold',50); matchedPoints = points(indexPairs(:,1),:); matchedPointsPrev = pointsPrev(indexPairs(:,2),:); end pointsPrev = points; featuresPrev = features; % PnP pose estimation if exist('matchedPoints','var') worldPoints = lidar2world(matchedPoints.Location,T_lidar2cam)'; imagePoints = matchedPointsPrev.Location; [R_cam2world,t_cam2world] = extrinsics(imagePoints,worldPoints,K); T_cam2world = [R_cam2world t_cam2world';0 0 0 1]; else T_cam2world = eye(4); end % Octree map building ptCloudLidar = pointCloud(ptCloud.Location); ptCloudLidar = pctransform(ptCloudLidar,@(x) T_lidar2cam*[x';ones(1,size(x,1))]); octree = pcfitoctree(ptCloudLidar,'MaxNumPoints',octreeMaxPts,'BlockSize',octreeRes); map = octree2world(octree,T_lidar2cam,T_cam2world,octreeRes); % Visualization figure(1) pcshow(ptCloudLidar,'MarkerSize',10) hold on pcshow(map,'MarkerSize',30,'MarkerColor',[1 0 0]) hold off end ``` 代码中的`cam_calib.mat`是用Matlab内置的相机标定工具箱进行的相机标定后保存的文件,`lidar_data.pcap`是Velodyne采集到的Lidar数据。 代码实现了基于SURF特征匹配的单目-Lidar融合SLAM,其中相机Lidar的标定使用Matlab内置的相机标定工具箱Velodyne的驱动程序,特征点提取匹配使用SURF算法暴力匹配,运动估计地图构建使用基于PnP的位姿估计方法基于Octree的点云地图构建方法。在SLAM循环中,程序会读取Lidar数据,进行相机Lidar的标定,进行SURF特征匹配,进行PnP位姿估计,进行Octree点云地图构建,并可视化结果。 需要注意的是,这份代码只是一个简单的示例,实际情况下需要根据具体的硬件设备软件环境进行修改优化。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值