该函数在恒速模型跟踪或参考关键帧跟踪成功之后调用,利用局部地图进一步优化当前帧位姿,并统计内点数量,最终判断跟踪是否成功。
bool Tracking::TrackLocalMap() { // We have an estimation of the camera pose and some map points tracked in the frame. // We retrieve the local map and try to find matches to points in the local map. mTrackedFr++; UpdateLocalMap(); SearchLocalPoints(); // TOO check outliers before PO int aux1 = 0, aux2=0; for(int i=0; i<mCurrentFrame.N; i++) if( mCurrentFrame.mvpMapPoints[i]) { aux1++; if(mCurrentFrame.mvbOutlier[i]) aux2++; } int inliers; if (!mpAtlas->isImuInitialized()) Optimizer::PoseOptimization(&mCurrentFrame