当前位置:网站首页>Calibration of monocular camera and binocular camera with kalibr calibration tool
Calibration of monocular camera and binocular camera with kalibr calibration tool
2022-06-29 16:42:00 【Love to eat small cakes 66】
1. Download and compile
1.1 Install dependencies , If there's a mistake in the middle , You can install the following components in multiple times , Corresponding ros The version should also be modified , My own is melodic
sudo apt-get install python-setuptools python-rosinstall ipython libeigen3-dev libboost-all-dev doxygen libopencv-dev
sudo apt-get install libopencv-dev ros-kinetic-vision-opencv ros-kinetic-image-transport-plugins ros-kinetic-cmake-modules python-software-properties software-properties-common libpoco-dev python-matplotlib python-scipy python-git python-pip ipython libtbb-dev libblas-dev liblapack-dev python-catkin-tools libv4l-dev
pip install python-igraph
1.2 compile
mkdir -p ~/kalibr_ws/src
cd ~/kalibr_ws/src
git clone --recursive https://github.com/ori-drs/kalibr
cd ~/kalibr_ws
source /opt/ros/noetic/setup.bash
catkin init
catkin config --extend /opt/ros/noetic
catkin config --merge-devel # Necessary for catkin_tools >= 0.4.
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
catkin build -DCMAKE_BUILD_TYPE=Release -j4
problem : Because my computer has anaconda3,anaconda3 Its own python It may affect kalibr, It seems that because kalibr Need analysis rosbag package , So the python2, Leading to an error report Failed to load Python extension for LZ4 support. LZ4 compression will not be availabl
I'm going to cry ...
terms of settlement :
stay kalibr_workspace/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_cameras.py In file
change "#!/usr/bin/env python" become "#!/usr/bin/env python2"
2. Data preparation
2.1 bag Data recording
Will be recorded BAG Record the calibration file again , Remove bad pictures , At the same time bag The frequency of is changed to 4hz
Open two terminals respectively , Enter the following command and run , wait for topic The input of
rosrun topic_tools throttle messages /cam_stereo_left/csi_cam/image_raw 4.0 /left
rosrun topic_tools throttle messages /cam_stereo_right/csi_cam/image_raw 4.0 /right
Open a new terminal , For recording video
rosbag record -O stereo_calibra.bag /left /right
Open a new terminal , Used to play the original data set
rosbag play 0620_1280x720.bag
2.2 Calibration board parameter file
Write one yourself ,checkboard_8x6_10x10cm.yaml
target_type: 'checkerboard'
targetCols: 8
targetRows: 6
rowSpacingMeters: 0.1
colSpacingMeters: 0.1
target_type: Is the type of calibration plate , The checkerboard used here targetCols: Number of corner points in the direction of calibration column targetRows: Number of corners in the direction of calibration rowSpacingMeters: The width of each chessboard , Unit meter colSpacingMeters: The height of each chessboard , Unit meter
The configuration files corresponding to the other two calibration boards are attached
“ QR code calibration board ”
target_type: 'aprilgrid' #gridtype
tagCols: 6 #number of apriltags
tagRows: 6 #number of apriltags
tagSize: 0.088 #size of apriltag, edge to edge [m]
tagSpacing: 0.3 #ratio of space between tags to tagSize
#example: tagSize=2m, spacing=0.5m --> tagSpacing=0.25[-]
“ Circular calibration plate ”
target_type: 'circlegrid' #gridtype
targetCols: 6 #number of circles (cols)
targetRows: 7 #number of circles (rows)
spacingMeters: 0.02 #distance between circles [m]
asymmetricGrid: False #use asymmetric grid (opencv) [bool]
Calibration plate pdf Generate command :
Modify as needed --nx,--ny,--tsize,--tspace
rosrun kalibr kalibr_create_target_pdf --type apriltag --nx 6 --ny 6 --tsize 0.02 --tspace 0.3
3. Start calibration
Open the terminal in the workspace directory
source YOUR_PATH/devel/setup.bash
rosrun kalibr kalibr_calibrate_cameras --bag /home/lusx/data/stereo_calibra.bag --topics /left /right --models pinhole-radtan pinhole-radtan --target src/Kalibr/config/checkboard_8x6_10x10cm.yaml
--bag: Name of calibration data
--topics: Left and right eye cameras topic
--models: Left and right camera model
#pinhole-radtan: The most common pinhole model + Brownian distortion model , For most angles less than 120 The camera , The distortion parameter includes radial distortion k1,k2 And tangential distortion p1,p2; If the camera distortion is not very serious , This model is basically OK ; Such as my DFOV by 150 The camera , You can also use this and the distortion removal effect is very good ;
# pinhole-equi: Pinhole Model + Equidistant distortion model , That is to say KB The type of model you need to select , The model is also widely used , Most fish eye lenses are also OK , Be careful 8 Parametric KB The distortion parameters of the model are k1,k2,k3,k4, Although it is also four numbers , But unlike the previous model , There are only radial distortion parameters , Without tangential distortion tangential distortion, The corresponding formulas for projection are also different ; At the same time, it's also opencv in cv::fisheye The model used ;
--target: Calibration board parameter configuration file
Report errors :
Cameras are not connected through mutual observations, please check the dataset. Maybe adjust the approx. sync. tolerance.
The reason is that the two cameras are out of sync , It can increase the acquisition frequency to 20hz, You can also increase the synchronization tolerance at the same time --bag-from-to 5 35 --approx-sync 0.04,
The complete parameters are as follows :
rosrun kalibr kalibr_calibrate_cameras --bag /home/lusx/data/stereo_calibra.bag --bag-from-to 5 100 --topics /left /right --models pinhole-radtan pinhole-radtan --target src/Kalibr/config/checkboard_8x6_10x10cm.yaml --approx-sync 0.04
3.3 Calibration results
Generate 3 File , The parameters can be in stereo_calibra-camchain.yaml see , Details can be found in stereo_calibra-report-cam.pdf View in 
stereo_calibra-camchain.yaml Content :
4 Parameter optimization
However, the internal and external parameters obtained from the calibration have a stretch , I don't know if there is a problem with the original data , Then the baseline of the two cameras was not found bf, Continue to optimize ..
边栏推荐
- 把这份关于软件测试一系列笔记研究完,进大厂是个“加分项”...
- Is it safe to open a compass account and speculate in stocks? How individuals open accounts for stock trading
- Metadata management Apache Atlas Compilation integration deployment and testing
- 穩定幣風險狀况:USDT 和 USDC 安全嗎?
- New feature of C11 - Auto and decltype type type indicators
- STM32 key chattering elimination -- Thinking of entry state machine
- AI and creativity
- Real test = "half product + Half development"?
- Simulink仿真模式
- 一个简单但是能上分的特征标准化方法
猜你喜欢

iNFTnews | Meta在元宇宙中的后续计划会是什么?

数学知识复习:第一型曲线积分

【 OpenGL 】 Random Talk 1. The camera rotates around a point in the space by dragging the mouse

Science: the interrelated causes and consequences of sleep in the brain

Comprehensive analysis of Seata distributed transaction at and XA

After studying this series of notes about software testing, it is a "bonus" to enter the factory

To solve the stubborn problem of Lake + warehouse hybrid architecture, Star Ring Technology launched an independent controllable cloud native Lake warehouse integrated platform

DAP large screen theme development description

A tour of gRPC:02 - 从proto生成代码

我,大厂测试员,降薪50%去国企,后悔了...
随机推荐
MATLAB输出格式控制 %d,%f,%c,%s的用法
【OpenGL】杂谈一、通过鼠标拖拽实现相机绕空间中的某点进行球面旋转查看
Flutter技术与实战(1)
How to configure logback? 30 minutes for you to thoroughly learn the code to stay up late and knock
指南针开户炒股是否安全?个人怎样开户炒股
What memory consuming data is stored in MySQL CDC jobmanager?
Advanced webgl performance optimization
To solve the stubborn problem of Lake + warehouse hybrid architecture, Star Ring Technology launched an independent controllable cloud native Lake warehouse integrated platform
Basics | draw arcs in the physics engine
【无标题】
Practice | extreme optimization of script errors - make script errors clear at a glance
基础 | 在物理引擎中画圆弧
实战 | 神奇的 conic-gradient 圆锥渐变
Privacy computing helps secure data circulation and sharing
英联邦国家有哪些
Cortical traceability analysis of ERP
能够1年涨薪2次的软件测试工程师,他到底强在哪里?
6.25AtCoderABC257E - Addition and Multiplication 2题解
MySQL foundation - transaction
把这份关于软件测试一系列笔记研究完,进大厂是个“加分项”...