From c584237503850f71ffd3590daf143fbfce4d4279 Mon Sep 17 00:00:00 2001 From: electech6 Date: Sat, 3 Apr 2021 14:02:42 +0800 Subject: [PATCH] =?UTF-8?q?BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ORBmatcher.cc | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/ORBmatcher.cc b/src/ORBmatcher.cc index c2bb49a..b967094 100644 --- a/src/ORBmatcher.cc +++ b/src/ORBmatcher.cc @@ -303,9 +303,17 @@ bool ORBmatcher::CheckDistEpipolarLine2(const cv::KeyPoint &kp1, const cv::KeyPo return dsqr<3.84*pKF2->mvLevelSigma2[kp2.octave]*unc; } +/** + * @brief 通过词袋,对关键帧的特征点进行跟踪 + * + * @param[in] pKF 关键帧 + * @param[in] F 当前普通帧 + * @param[in] vpMapPointMatches F中地图点对应的匹配,NULL表示未匹配 + * @return int 成功匹配的数量 + */ int ORBmatcher::SearchByBoW(KeyFrame* pKF,Frame &F, vector &vpMapPointMatches) { - // 获取该关键帧的mappoint + // 获取该关键帧的地图点 const vector vpMapPointsKF = pKF->GetMapPointMatches(); // 和普通帧F特征点的索引一致 @@ -348,7 +356,7 @@ int ORBmatcher::SearchByBoW(KeyFrame* pKF,Frame &F, vector &vpMapPoin // 关键帧该节点中特征点的索引 const unsigned int realIdxKF = vIndicesKF[iKF]; - // 取出KF中该特征对应的MapPoint + // 取出KF中该特征对应的地图点 MapPoint* pMP = vpMapPointsKF[realIdxKF]; if(!pMP) @@ -356,8 +364,8 @@ int ORBmatcher::SearchByBoW(KeyFrame* pKF,Frame &F, vector &vpMapPoin if(pMP->isBad()) continue; - - const cv::Mat &dKF= pKF->mDescriptors.row(realIdxKF); // 取出KF中该特征对应的描述子 + // 取出关键帧KF中该特征对应的描述子 + const cv::Mat &dKF= pKF->mDescriptors.row(realIdxKF); int bestDist1=256; // 最好的距离(最小距离) int bestIdxF =-1 ; @@ -370,13 +378,14 @@ int ORBmatcher::SearchByBoW(KeyFrame* pKF,Frame &F, vector &vpMapPoin for(size_t iF=0; iF