当前位置:网站首页>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 ..
边栏推荐
- How to use openmesh to realize the conversion between 3D files of different formats
- 能够1年涨薪2次的软件测试工程师,他到底强在哪里?
- 使用kalibr标定工具进行单目相机和双目相机的标定
- Graduates are confused and middle-aged people are anxious. How can the career path become wider and wider?
- 隐私计算助力数据的安全流通与共享
- Top the list for 10 consecutive years? What is the "most common" programming language for programmers?
- Cortical traceability analysis of ERP
- Comprehensive analysis of Seata distributed transaction at and XA
- Greedy Apple plans to raise the price of iphone14, which will provide opportunities for Chinese mobile phones
- Time format GTM to Beijing time
猜你喜欢

毕业生迷茫,中年人焦虑,职场路怎么越走越宽?

Real test = "half product + Half development"?

It's also a test. Why do others get an annual salary of 30w+?

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

数学知识:求组合数 II—求组合数

Paper notes: e (n) equivariant graph neural networks

Stable currency risk profile: are usdt and usdc safe?

Selenium 凭什么成为 Web 自动化测试的首选?(内附源码)

一个简单但是能上分的特征标准化方法
![[untitled]](/img/e2/be57a7e22275af59183c50e0710837.png)
[untitled]
随机推荐
C language microblog user management system
STM32 key chattering elimination -- Thinking of entry state machine
redolog和binlog
资讯 | 扎克伯格被评为全球IT业最不谨慎的CEO;中国移动研发系留式无人机应急通信高空基站
[proteus simulation] nixie tube +4x4 keyboard matrix key simple calculator
MySQL foundation - transaction
Practice | extreme optimization of script errors - make script errors clear at a glance
GNN notes: message propagation model
AI and creativity
Tutorial | fNIRS data processing toolkit homer2 download and installation
After studying this series of notes about software testing, it is a "bonus" to enter the factory
代码大全读后感
A tour of grpc:02 - generate code from proto
What is the follow-up plan of infotnews | meta in the metauniverse?
MATLAB输出格式控制 %d,%f,%c,%s的用法
iNFTnews | Meta在元宇宙中的后续计划会是什么?
Is it safe to open a compass account and speculate in stocks? How individuals open accounts for stock trading
把这份关于软件测试一系列笔记研究完,进大厂是个“加分项”...
[untitled]
连续10年霸榜第一?程序员「最常用」的编程语言是它?