ORB-SLAM3中yaml文件详解

本文详细介绍了ORB-SLAM3中相机内参、imu内参及图像预处理参数的配置,包括相机类型、焦距、光心坐标、畸变参数、帧率、基线距离、深度阈值以及imu噪声参数。此外,还提到了特征点检测的相关参数,如ORB特征点的数量、尺度因子和检测阈值,这些参数对ORB-SLAM3的特征匹配和建图效果有直接影响。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以Examples/Stereo-Inertial文件夹下EuRoc.yaml为例

Camera.type: "PinHole"

相机类型:ORBSLAM3中支持两种相机类型PinHole和KannalaBrandt8。除这两种相机类型外,其余类型或者不给出具体类型时程序报错Not Supported Camera Sensor


Camera.fx: 435.2046959714599
Camera.fy: 435.2046959714599
Camera.cx: 367.4517211914062
Camera.cy: 252.2008514404297

Camera.k1: 0.0
Camera.k2: 0.0
Camera.p1: 0.0
Camera.p2: 0.0

Camera.width: 752
Camera.height: 480

# Camera frames per second 
Camera.fps: 20.0

# stereo baseline times fx
Camera.bf: 47.90639384423901

# Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale)
Camera.RGB: 1

# Close/Far threshold. Baseline times.
ThDepth: 35.0 # 35

相机内参部分。其中fx,fy,cx,cy,k1,k2,p2,p2,k3(可选)是相机内参的组成部分具体含义不进行过多描述。上述参数必须是float类型!!!
fx为f/dx,其中f单位为mm,dx单位一般为mm/像素。fx的单位为像素。
下面的参数需要详细解释:

  • Camera.fps: 每秒相机的帧数,相机拍照的频率。类型没有明确要求,最好是float
  • Camera.bf:双目相机baseline和相机焦距的乘积,即bf=b*f。单位为mm。必须为float类型
  • ThDepth:相机的有效深度,必须是float类型

# Transformation from camera 0 to body-frame (imu)
Tbc: !!opencv-matrix
   rows: 4
   cols: 4
   dt: f
   data: [0.0148655429818, -0.999880929698, 0.00414029679422, -0.0216401454975,
         0.999557249008, 0.0149672133247, 0.025715529948, -0.064676986768,
        -0.0257744366974, 0.00375618835797, 0.999660727178, 0.00981073058949,
         0.0, 0.0, 0.0, 1.0]

# IMU noise
IMU.NoiseGyro: 1.7e-04 # 1.6968e-04 
IMU.NoiseAcc: 2.0e-03 # 2.0000e-3
IMU.GyroWalk: 1.9393e-05 
IMU.AccWalk: 3.e-03 # 3.0000e-3
IMU.Frequency: 200

imu内参部分。Tbc是从相机(左相机)到imu的转移矩阵。
注:IMU.Frequency必须是int类型。


# Stereo Rectification. Only if you need to pre-rectify the images.
# Camera.fx, .fy, etc must be the same as in LEFT.P
LEFT.height: 480
LEFT.width: 752
LEFT.D: !!opencv-matrix
   rows: 1
   cols: 5
   dt: d
   data:[-0.28340811, 0.07395907, 0.00019359, 1.76187114e-05, 0.0]
LEFT.K: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [458.654, 0.0, 367.215, 0.0, 457.296, 248.375, 0.0, 0.0, 1.0]
LEFT.R:  !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [0.999966347530033, -0.001422739138722922, 0.008079580483432283, 0.001365741834644127, 0.9999741760894847, 0.007055629199258132, -0.008089410156878961, -0.007044357138835809, 0.9999424675829176]
LEFT.Rf:  !!opencv-matrix
   rows: 3
   cols: 3
   dt: f
   data: [0.999966347530033, -0.001422739138722922, 0.008079580483432283, 0.001365741834644127, 0.9999741760894847, 0.007055629199258132, -0.008089410156878961, -0.007044357138835809, 0.9999424675829176]
LEFT.P:  !!opencv-matrix
   rows: 3
   cols: 4
   dt: d
   data: [435.2046959714599, 0, 367.4517211914062, 0,  0, 435.2046959714599, 252.2008514404297, 0,  0, 0, 1, 0]

RIGHT.height: 480
RIGHT.width: 752
RIGHT.D: !!opencv-matrix
   rows: 1
   cols: 5
   dt: d
   data:[-0.28368365, 0.07451284, -0.00010473, -3.555907e-05, 0.0]
RIGHT.K: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [457.587, 0.0, 379.999, 0.0, 456.134, 255.238, 0.0, 0.0, 1]
RIGHT.R:  !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [0.9999633526194376, -0.003625811871560086, 0.007755443660172947, 0.003680398547259526, 0.9999684752771629, -0.007035845251224894, -0.007729688520722713, 0.007064130529506649, 0.999945173484644]
RIGHT.P:  !!opencv-matrix
   rows: 3
   cols: 4
   dt: d
   data: [435.2046959714599, 0, 367.4517211914062, -47.90639384423901, 0, 435.2046959714599, 252.2008514404297, 0, 0, 0, 1, 0]

当输入的第4个参数为true时使用,即需要利用上述参数对图像进行去畸变处理。

  • D:[k1,k2,p1,p2,k3]畸变参数
  • K:[fx,0.0,cx,0.0,fy,cy,0.0,0.0,1.0]相机内参矩阵
  • R/Rf:对于每个摄像机,该函数计算单应H作为像素域中的校正变换,而不是3D空间中的旋转矩阵R。R可由H计算。具体描述见OpenCV文档
  • P:[fx,0.0,cx,0.0,0.0,fy,cy,0.0,0.0,0.0,1.0,0.0]相机投影矩阵,左相机一般为相机内参矩阵,右相机和左相机之间相差一个x方向的平移(双目相机的baseline)。

#--------------------------------------------------------------------------------------------
# ORB Parameters
#--------------------------------------------------------------------------------------------

# ORB Extractor: Number of features per image
ORBextractor.nFeatures: 1200 #2000

# ORB Extractor: Scale factor between levels in the scale pyramid 	
ORBextractor.scaleFactor: 1.2

# ORB Extractor: Number of levels in the scale pyramid	
ORBextractor.nLevels: 8

# ORB Extractor: Fast threshold
# Image is divided in a grid. At each cell FAST are extracted imposing a minimum response.
# Firstly we impose iniThFAST. If no corners are detected we impose a lower value minThFAST
# You can lower these values if your images have low contrast			
ORBextractor.iniThFAST: 20 #10
ORBextractor.minThFAST: 7 #5
  • nFeatures:特征点的个数
  • scaleFactor:相邻层图像的比例系数
  • nlevels:构造金字塔的层数
  • iniThFAST:检测fast角点阈值
  • minThFAST:没有检测到角点的前提下降低阈值

参数的选取会对特征点提取的个数和匹配造成影响,也会对建图结果有一定的影响。可以根据数据集和程序对这些参数进行更改。


#--------------------------------------------------------------------------------------------
# Viewer Parameters
#--------------------------------------------------------------------------------------------
Viewer.KeyFrameSize: 0.05
Viewer.KeyFrameLineWidth: 1
Viewer.GraphLineWidth: 0.9
Viewer.PointSize:2
Viewer.CameraSize: 0.08
Viewer.CameraLineWidth: 3
Viewer.ViewpointX: 0
Viewer.ViewpointY: -0.7
Viewer.ViewpointZ: -1.8
Viewer.ViewpointF: 500

可视化参数

### ORB-SLAM2 双目相机配置 YAML 文件示例 对于双目相机,在使用 ORB-SLAM2 时,需要创建一个特定的 YAML 配置文件来定义相机的各项参数。以下是基于已有资料整理的一个典型双目相机配置文件模板: ```yaml %YAML:1.0 #----- # Camera Parameters. Adjust them! #----------------------------------------------------------------------------------------------- # CAMERA calibration and distortion parameters (OpenCV) Camera.fx: 718.856 # Focal length in pixels, X-axis [^1] Camera.fy: 718.856 # Focal length in pixels, Y-axis Camera.cx: 607.193 # Principal point of the image plane, X-coordinate [^1] Camera.cy: 185.216 # Principal point of the image plane, Y-coordinate Camera.k1: 0.0 # Radial distortion coefficient k1 [^1] Camera.k2: 0.0 # Radial distortion coefficient k2 Camera.p1: 0.0 # Tangential distortion coefficient p1 Camera.p2: 0.0 # Tangential distortion coefficient p2 Camera.k3: 0.0 # Third radial distortion coefficient k3 # Camera frames per second Camera.fps: 30.0 # Frames Per Second # Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale) Camera.RGB: 1 # If true, color order will be considered as RGB; otherwise, it's assumed to be BGR # stereo baseline times fx Camera.bf: 400.0 # Baseline multiplied by focal length #----------------------------------------------------------------------------------------------- # ORB Parameters #----------------------------------------------------------------------------------------------- # ORB Extractor: Number of features per image ORBextractor.nFeatures: 1200 # Maximum number of keypoints that can be extracted from a single frame # ORB Extractor: Scale factor between levels in the scale pyramid ORBextractor.scaleFactor: 1.2 # Ratio between consecutive scales at which keypoint detection occurs # ORB Extractor: Number of levels in the scale pyramid ORBextractor.nLevels: 8 # Total number of layers used in the scale space representation # ORB Extractor: Fast threshold # Image is divided in a grid. At each cell FAST algorithm is applied independently. ORBextractor.iniThFAST: 20 # Initial threshold value for detecting corners using FAST detector ORBextractor.minThFAST: 7 # Minimum allowed threshold during non-maximum suppression phase # Use this instead of above if you want to extract ORB on RGB channels. # ORB Extractor: Number of features per channel/image # ORBextractorRGBD.nFeatures: 1200 # ORB Extractor: Scale factor between levels in the scale pyramid # ORBextractorRGBD.scaleFactor: 1.2 # ORB Extractor: Number of levels in the scale pyramid # ORBextractorRGBD.nLevels: 8 # ORB Extractor: Fast threshold # ORBextractorRGBD.iniThFAST: 20 # ORBextractorRGBD.minThFAST: 7 #----- Viewer.KeyFrameSize: 0.05 # Size of KeyFrames when drawing graphically Viewer.KeyFrameLineWidth: 1 # Line width for edges connecting KeyFrames visually Viewer.GraphLineWidth: 0.9 # Width of lines representing connections within map points Viewer.PointSize: 2 # Diameter size of MapPoints displayed on screen Viewer.CameraSize: 0.08 # Dimensional scaling factor applied to camera model rendering Viewer.ViewpointX: 0 # Position offset along X axis relative to origin where viewer looks towards scene center Viewer.ViewpointY: -0.7 # Position offset along Y axis relative to origin where viewer looks towards scene center Viewer.ViewpointZ: -1.8 # Position offset along Z axis relative to origin where viewer looks towards scene center Viewer.ViewpointF: 500 # Field-of-view angle defining frustum extent around viewpoint direction vector [^1] ``` 此配置文件涵盖了从摄像机校准到特征提取器设置以及可视化选项的关键方面。
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值