
3D激光雷达与相机自动外参标定方法
ILCC是一个开源项目,提供基于激光反射强度的3D激光雷达和相机自动外参标定方法。项目功能包括点云分割、棋盘格检测、角点提取和外参优化,支持多种激光雷达型号。ILCC适用于全景和单目相机标定,提供3D点云可视化工具。项目附有使用说明和示例数据,便于研究人员使用。
如果您觉得我们的代码和方法对您的工作有用,请考虑引用本文:
@Article{WANG2017Lidar_camera_cali,
AUTHOR = {Wang, Weimin and Sakurada, Ken and Kawaguchi, Nobuo},
TITLE = {Reflectance Intensity Assisted Automatic and Accurate Extrinsic Calibration of 3D LiDAR and Panoramic Camera Using a Printed Chessboard},
JOURNAL = {Remote Sensing},
VOLUME = {9},
YEAR = {2017},
NUMBER = {8},
ARTICLE-NUMBER = {851},
ISSN = {2072-4292},
DOI = {10.3390/rs9080851}
}
这是一个基于激光反射强度的3D-LiDAR和相机全自动精确外参标定的Python实现。<br> 论文可在此处获取。<br> 此实现的主要特点是:<br>
brew install opencv3 echo /usr/local/opt/opencv3/lib/python2.7/site-packages >> /usr/local/lib/python2.7/site-packages/opencv3.pth
git clone https://github.com/opencv/opencv.git cd opencv && mkdir build && cd build && cmake .. && make -j4 && make install
git clone https://github.com/mfxox/opengv cd opengv mkdir build && cd build && cmake .. && make && make install
brew install pcl
或从源码构建sudo apt-get install libpcl-1.7-all
git clone https://github.com/mfxox/python-pcl cd python-pcl python setup.py install
cd "matlabroot/extern/engines/python" python setup.py install
config.yaml中的__backend__参数设置,但OpenCV可能无法检测到角点。您也可以使用样本数据中的示例文件(output/img_corners)中检测到的角点来尝试标定。brew install vtk
git clone --recurse-submodules https://github.com/mfxox/ILCC cd ILCC python setup.py install
config.py:参数设置 <br>
img_corners_est.py:使用OpenCV或MATLAB从图像估计棋盘格角点<br>
pcd_corners_est.py:从点云估计棋盘格角点<br>
LM_opt.py:加载对应的2D-3D角点,使用PnP方法计算初始值,用LM方法优化结果<br>
utility.py:用于各种可视化的实用函数
创建一个文件夹,例如命名为__DATA__,并创建图像和点云文件夹__DATA/img__ 和__DATA/pcd__。
将全景图像放入__DATA/img__,点云文件放入__DATA/pcd__。文件应该命名为00XX.png或00XX.csv。
cd DATA 并将config.yaml复制到__DATA__,然后根据您的情况修改config.yaml。
从图像中检测角点。<br>
from ILCC import img_corners_est img_corners_est.detect_img_corners()
图像中角点的坐标保存在 DATA/output/img_corners 文件夹中,文件名为 00XX_img_corners.txt。如果在 config.yaml 中将 'output_img_with_dectected_corners' 设置为 True,则标记了角点的图像也会保存在同一文件夹中,文件名为 00XX_detected_corners.jpg,如下图所示。
from ILCC import pcd_corners_est pcd_corners_est.detect_pcd_corners()
点云中角点的坐标保存在 output/pcd_seg 文件夹中,文件名为 00XX_pcd_result.pkl。每个点云的分割结果输出到 /DATA/output/pcd_seg/00XX 文件夹中。
from ILCC import LM_opt LM_opt.cal_ext_paras()
外部标定结果在处理结束时输出,并以文件名 YYYYMMDD_HHMMSS_calir_result.txt 保存。如果将 'back_proj_corners' 设置为 True,使用计算得到的参数反投影3D角点的图像会保存到 DATA/output 文件夹中,如下图所示。
<div style="text-align: center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/da3d9f52-a22f-41e0-80cf-22e69b4ce6f8.jpg" width = "50%" /> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/e1d80be6-6767-467a-88f2-fe5b876cb104.jpg" width = "24.35%" /><br> </div>from ILCC import utility utility.vis_back_proj(ind=1, img_style="orig", pcd_style="dis", hide_occlussion_by_marker=False) utility.vis_back_proj(ind=1, img_style="orig", pcd_style="dis", hide_occlussion_by_marker=True) utility.vis_back_proj(ind=1, img_style="edge", pcd_style="intens", hide_occlussion_by_marker=True)
使用计算得到的外部参数反投影点云的图像(见下图)将会显示,按"s"键保存。img_style 可以是 "edge"(边缘提取)或 "orig"(原始图像),pcd_style 可以是 "dis"(按距离着色)或 "intens"(按强度着色)。
<div style="text-align: center"> <p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/fd022de8-47d2-4fc8-9b54-0e83edbb7471.jpg" width = "80%" /><br> <em>将点投影到原始图像上,按距离着色。棋盘格遮挡的部分未隐藏。</em> <br> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/fc215d7e-f3c5-4606-8dd1-ea5a57d33517.jpg" width = "80%" /><br> <em>棋盘格遮挡的部分已隐藏。通过将参数 hide_occlussion_by_marker 设置为 True 来隐藏棋盘格遮挡的部分。</em> <br> 对比上面两张图像中棋盘格的上部。 </em> <br> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/ea8a74ec-2997-4439-9eb9-619217a19f9d.jpg" width = "80%" /><br> <em>将点投影到边缘图像上,按强度着色。棋盘格遮挡的点已隐藏。</em> </p> </div> <div style="text-align: center"> <p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/cbc5b968-8cbf-4e82-a79a-a2bfd9086801.png" width = "20%" /> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/84575d60-bcb9-4d6a-90f7-3e26d6539938.png" width = "20%" /> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/f01677cb-bb0d-4187-8f72-c1546e7f4808.png" width = "20%" /> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/7c8de693-4479-4ffd-99dd-b8b71cec6949.png" width = "20%" /> <br> <em>透视图像的结果。从左到右:[颜色:距离,原始图像],[颜色:距离,原始图像,隐藏遮挡],[颜色:强度,边缘图像],[颜色:强度,边缘图像,隐藏遮挡]。</em> </p> </div>全景图像的样本数据和检测到的角点处理结果可以从这里(181M)下载,透视图像的数据可以从这里(29M)下载。<br> 这些数据是使用棋盘格文件采集的,该文件包含6*8个图案,如果按A0尺寸打印,每个格子的长度为7.5厘米。
wget https://www.dropbox.com/s/m0ogerftqav0fyx/ILCC_sample_data_and_result.zip unzip ILCC_sample_data_and_result.zip cd ILCC_sample_data_and_result
将 config.yaml 复制到 ILCC_sample_data_and_result 文件夹。
wget https://www.dropbox.com/s/et0o4k2sp485nz1/ILCC_sample_perspective_data.zip unzip ILCC_sample_perspective_data.zip cd ILCC_sample_perspective_data
将 config.yaml 复制到 ILCC_sample_data_and_result 文件夹。<br/>
通过修改 config.yaml,将 camera_type 设置为 'perpsective',并将内部参数输入到 instrinsic_para 中。
<div style="text-align: center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/1e82f48e-b39d-43d7-b6f6-49b9ae84ad28.png" width = "50%" /> </div>from ILCC import utility utility.vis_csv_pcd(ind=1)
<div style="text-align: center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/962226ef-e75e-4833-8804-4b9e4df6fe71.png" width = "50%" /> </div>from ILCC import utility utility.vis_segments(ind=1)
<div style="text-align: center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/08ba4556-85a4-45f0-8df8-6060c2614600.png" width = "50%" /> </div>from ILCC import utility utility.vis_segments_only_chessboard_color(ind=1)
<div style="text-align: center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/51cc5a20-bbbb-4756-9f05-62e1d3a34991.png" width = "50%" /> </div>from ILCC import utility utility.vis_ested_pcd_corners(ind=1)
<div style="text-align: center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/7551fcba-20e9-41f3-ae98-ccb77a560008.png" width = "60%" /> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/427fa45b-f24c-408c-8054-88c8d0bc6a08.png" width = "65%" /> </div>import utility import numpy as np utility.vis_all_markers(utility.vis_all_markers(np.arange(1, 21).tolist()))
config.yaml 中的 LiDAR_type 和 laser_beams_num 是否与您的设置相同。config.yaml 中的 jdc_thre_ratio 和 agglomerative_cluster_th_ratio。如果棋盘格分割不足,则减小这些值。config.yaml 中的 pattern_size 和 grid_length 是否设置正确。config.yaml 中的 marker_range_limit。config.yaml 中的 chessboard_detect_planar_PCA_ratio 值。config.yaml 中的 least_marker_points_num 值。config.yaml 中的 intensity_col_in 值是否与 csv 文件中强度列的索引相同。如有进一步问题,请在 Issues 中讨论。
| 编号 | 激光雷达型号 | 相机型号 | 棋盘格尺寸 | 格子长度[cm] | 距离范围[m] | 数据来源 | 作者 |
|---|---|---|---|---|---|---|---|
| 1 | Velodyne <br> HDL-32e | Ladybug3 (全景) | 8*6 | 7.5 | 1.2 ~ 2.6 | 链接 | mfxox |
| 2 | Velodyne <br> HDL-32e | Ladybug3 的一个单目相机 | 8*6 | 7.5 | 1.2 ~ 2.6 | 链接 | mfxox |
如果您能分享使用不同尺寸或图案的棋盘格或其他类型激光雷达传感器收集的数据,我们将非常感激。我们会在测试条件列表中致谢您的贡献。


AI一键生成PPT,就用博思AIPPT!
博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。


AI赋能电商视觉革命,一站式智能商拍平台
潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。


企业专属的AI法律顾问
iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。


稳定高效的流量提升解决方案,助力品牌曝光
稳定高效的流量提升解决方案,助力品牌曝光


最新版Sora2模型免费使用,一键生成无水印视频
最新版Sora2模型免费使用,一键生成无水印视频


实时语音翻译/同声传译工具
Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

