zoukankan      html  css  js  c++  java
  • 重读ORB_SLAM之LoopClosing线程难点

    1. DetectLoop

    这里有个ConsistenGroup概念,比较难懂。这里是最让人迷惑的地方。一旦vbConsistentGroup为真,其他帧的spCanditateGroup就进不来了。

    if(!vbConsistentGroup[iG])
                    {
                        ConsistentGroup cg = make_pair(spCandidateGroup,nCurrentConsistency);
                        vCurrentConsistentGroups.push_back(cg);
                        vbConsistentGroup[iG]=true; //this avoid to include the same group more than once
                    }
    
    

    2. ComputeSim3

    不太明白为什么都使用Sim3去计算相对位姿。在双目和RGBD情况下,地图点深度已知,可以不优化Scale的啊。关于sim3的优化,请参考此博客与paper:sim3优化paper。这里面用到了三种不同的匹配方法:

     int nmatches = matcher.SearchByBoW(mpCurrentKF,pKF,vvpMapPointMatches[i]);
    
    
    //为了找到更多的匹配点,用于优化
       matcher.SearchBySim3(mpCurrentKF,pKF,vpMapPointMatches,s,R,t,7.5);
    
        //从回环帧和它的邻域帧里,得到更多地图点,并与当前帧匹配,如果内点多于某个阈值,则接受这个loop
        // Retrieve MapPoints seen in Loop Keyframe and neighbors
        vector<KeyFrame*> vpLoopConnectedKFs = mpMatchedKF->GetVectorCovisibleKeyFrames();
        vpLoopConnectedKFs.push_back(mpMatchedKF);
        mvpLoopMapPoints.clear();
        for(vector<KeyFrame*>::iterator vit=vpLoopConnectedKFs.begin(); vit!=vpLoopConnectedKFs.end(); vit++)
        {
            KeyFrame* pKF = *vit;
            vector<MapPoint*> vpMapPoints = pKF->GetMapPointMatches();
            for(size_t i=0, iend=vpMapPoints.size(); i<iend; i++)
            {
                MapPoint* pMP = vpMapPoints[i];
                if(pMP)
                {
                    if(!pMP->isBad() && pMP->mnLoopPointForKF!=mpCurrentKF->mnId)
                    {
                        mvpLoopMapPoints.push_back(pMP);
                        pMP->mnLoopPointForKF=mpCurrentKF->mnId;
                    }
                }
            }
        }
    
        // Find more matches projecting with the computed Sim3
        matcher.SearchByProjection(mpCurrentKF, mScw, mvpLoopMapPoints, mvpCurrentMatchedPoints,10);
    
    

    3. EssentialGraph 的意义

      Optimizer::OptimizeEssentialGraph(mpMap, mpMatchedKF, mpCurrentKF, NonCorrectedSim3, CorrectedSim3, LoopConnections, mbFixScale);
    

    只优化位姿,里面包含当前回环边信息,所有帧与父边信息,它的回环边信息,以及共视边信息。优化所有帧位姿。

  • 相关阅读:
    设计模式之动态代理
    设计模式之单例模式
    WinDbg调试高内存的.Net进程Dump
    ping 和 远程桌面 与防火墙的关系
    log4net性能小探
    html页面缓存问题
    casperjs在拆分文件后的中文乱码问题的解决
    casperjs userAgent的一些问题
    浅谈并查集
    当你感到学习困难的时候,你在走上坡路!
  • 原文地址:https://www.cnblogs.com/easonslam/p/9118342.html
Copyright © 2011-2022 走看看