euroc_stereo_imu_config.yaml为其中部分的配置文件。
%YAML:1.0
#common parameters
#support: 1 imu 1 cam; 1 imu 2 cam: 2 cam;
imu: 1
num_of_cam: 2
imu_topic: "/imu0"
image0_topic: "/cam0/image_raw"
image1_topic: "/cam1/image_raw"
output_path: "~/output/"
cam0_calib: "cam0_mei.yaml"
cam1_calib: "cam1_mei.yaml"
image_width: 752
image_height: 480
# Extrinsic parameter between IMU and Camera.
# IMU和Camera之间的外部参数。
estimate_extrinsic: 0
# 有一个准确的外在参数。我们将信任以下imu^R_cam,imu^T_cam,不要更改它。
# 0 Have an accurate extrinsic parameters. We will trust the following imu^R_cam, imu^T_cam, don't change it.
# 对外部参数有一个初步的猜测。我们将围绕您的初步猜测进行优化
# 1 Have an initial guess about extrinsic parameters. We will optimize around your initial guess.
body_T_cam0: !!opencv-matrix
rows: 4
cols: 4
dt: d
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, 1]
body_T_cam1: !!opencv-matrix
rows: 4
cols: 4
dt: d
data: [0.0125552670891, -0.999755099723, 0.0182237714554, -0.0198435579556,
0.999598781151, 0.0130119051815, 0.0251588363115, 0.0453689425024,
-0.0253898008918, 0.0179005838253, 0.999517347078, 0.00786212447038,
0, 0, 0, 1]
#Multiple thread support
multiple_thread: 1
#feature traker paprameters
# 特征跟踪中的最大特征数
max_cnt: 150 # max feature number in feature tracking
# 两个特征之间的最小距离
min_dist: 30 # min distance between two features
# 发布跟踪结果的频率(Hz)。至少10Hz用于良好的估计。如果设置为0,频率将与原始图像相同
freq: 10 # frequence (Hz) of publish tracking result. At least 10Hz for good estimation. If set 0, the frequence will be same as raw image
# 事务阈值(像素)
F_threshold: 1.0 # ransac threshold (pixel)
# 将跟踪图像作为主题发布
show_track: 1 # publish tracking image as topic
# 执行前向和后向光流以提高特征跟踪精度
flow_back: 1 # perform forward and backward optical flow to improve feature tracking accuracy
#optimization parameters
# 最大求解器迭代时间(ms),以保证实时性
max_solver_time: 0.04 # max solver itration time (ms), to guarantee real time
# 最大求解器迭代次数,以保证实时性
max_num_iterations: 8 # max solver itrations, to guarantee real time
# 关键帧选择阈值(像素)
keyframe_parallax: 10.0 # keyframe selection threshold (pixel)
#imu parameters The more accurate parameters you provide, the better performance
# 加速度计测量噪声标准偏差。
acc_n: 0.1 # accelerometer measurement noise standard deviation.
# 陀螺仪测量噪声标准偏差。
gyr_n: 0.01 # gyroscope measurement noise standard deviation.
# 加速度计偏置随机工作噪声标准偏差
acc_w: 0.001 # accelerometer bias random work noise standard deviation.
# 陀螺偏置随机工作噪声标准差
gyr_w: 0.0001 # gyroscope bias random work noise standard deviation.
# 重力加速度
g_norm: 9.81007 # gravity magnitude
#unsynchronization parameters
# 在线估计摄像机和imu之间的时间偏移
estimate_td: 0 # online estimate time offset between camera and imu
# 时间偏移的初始值。单位:s.读取图像时钟+td=真实图像时钟(IMU时钟)
td: 0.0 # initial value of time offset. unit: s. readed image clock + td = real image clock (IMU clock)
#loop closure parameters
# 加载并重用先前的姿态图;从“pose_graph_save_path”加载
load_previous_pose_graph: 0 # load and reuse previous pose graph; load from 'pose_graph_save_path'
# 保存和加载路径
pose_graph_save_path: "~/output/pose_graph/" # save and load path
# 将图像保存在姿势图中以进行可视化;可以通过设置0关闭此功能
save_image: 1 # save image in pose graph for visualization prupose; you can close this function by setting 0
void cv::calcOpticalFlowPyrLK ( InputArray prevImg,
InputArray nextImg,
InputArray prevPts,
InputOutputArray nextPts,
OutputArray status,
OutputArray err,
Size winSize = Size(21, 21),
int maxLevel = 3,
TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01),
int flags = 0,
double minEigThreshold = 1e-4
)
PrevImg | 由buildOpticalFlowPyramid构造的第一个8位输入图像或金字塔。 |
nextImg | 与prevImg具有相同大小和相同类型的第二输入图像或金字塔。 |
PrevPts | 需要找到流量的2D点的向量;点坐标必须是单精度浮点数。 |
nextPts | 包含所计算的第二图像中的输入特征的新位置的2D点(具有单精度浮点坐标)的输出向量;当传递OPTFLOW_USE_INITIAL_FLOW标志时,向量必须具有与输入中相同的大小。 |
status | 输出状态向量(无符号字符);如果已经找到对应特征的流,则将向量的每个元素设置为1,否则将其设置为0。 |
err | 误差输出向量;将向量的每个元素设置为对应特征的误差,可以在标志参数中设置误差测量的类型;如果未找到流,则未定义错误(使用status参数查找此类情况)。 |
winsize | 每个金字塔级别的搜索窗口的大小。 |
maxLevel | 0-基于最大金字塔层数;如果设置为0,则不使用金字塔(单个级别),如果设置为1,则使用两个级别,依此类推;如果将金字塔传递给输入,则算法将使用金字塔的层数,但不超过maxLevel。 |
TermCriteria | 参数,指定迭代搜索算法的终止标准(在指定的最大迭代次数criteria.maxCount之后或当搜索窗口移动小于criteriaε时)。 |
flags | 操作标志:
|
minEigThreshold | 该算法计算光流方程的2 × 2标准矩阵(该矩阵在[33]中被称为空间梯度矩阵)的最小特征值,除以窗口中的像素数;如果该值小于minEigThreshold,则相应特征被过滤掉并且其流不被处理,因此它允许移除坏点并获得性能提升。 |
int cvRound ( double value )
- 将浮点数舍入为最接近的整数。
- 参数
- value 浮点数如果该值超出INT_MIN ... INT_MAX范围,结果未定义。