ORB-SLAM2 闭环检测 LoopClosing::ComputeSim3() 流程图

mpCurrentKF:当前关键帧

pKF:mvpEnoughConsistentCandidates[i] detectloop给出的候选关键帧

mpMatchedKF:选定的闭环关键帧

vvpMapPointMatches[i]:mpCurrentKF和mvpEnoughConsistentCandidates[i] (pKF)匹配的地图点

vpMapPointMatches[j]:pSolver->iterate一步可以判断vvpMapPointMatches[i]中的内点,如果vbInliers[j](j对应的点是内点),则将内点赋值给vpMapPointMatches[j],即vpMapPointMatches[j]=vvpMapPointMatches[i][j]

cv::Mat Scm  = pSolver->iterate(5,bNoMore,vbInliers,nInliers);

ComputeSim3() 函数可看做分为三个阶段执行:

第一阶段:绿色线,从闭环候选帧中确定闭环关键帧

第二阶段:红色线,过渡阶段,pKF->mpMatchedKF  vpMapPointMatches[j]->mvpCurrentMatchedPoints

第三阶段:浅紫色线,当前关键帧在mvpLoopMapPoints中寻找更多的匹配,mvpLoopMapPoints是闭环关键帧及其共视关键帧的所有地图点

实际上:ComputeSim3()函数就是在不断完善mvpCurrentMatchedPoints的过程,不断更新当前关键帧的特征点和地图点的匹配,最后并根据匹配的个数决定闭环是否成功

ORB-SLAM2 闭环检测 LoopClosing::ComputeSim3() 流程图_第1张图片

你可能感兴趣的:(slam)