Open ZhihaiYan opened 4 years ago
I find sometimes the value of score in function DetectRelocalizationCandidates is negtive
for(list<pair<float,KeyFrame> >::iterator it=lScoreAndMatch.begin(), itend=lScoreAndMatch.end(); it!=itend; it++) { KeyFrame pKFi = it->second; vector<KeyFrame*> vpNeighs = pKFi->GetBestCovisibilityKeyFrames(10);
float bestScore = it->first; float accScore = bestScore; KeyFrame* pBestKF = pKFi; for(vector<KeyFrame*>::iterator vit=vpNeighs.begin(), vend=vpNeighs.end(); vit!=vend; vit++) { KeyFrame* pKF2 = *vit; if(pKF2->mnRelocQuery!=F->mnId) continue; // i think here need to calculate the mRelocScore, because sometimes this value is not initialed pKF2->mRelocScore = mpVoc->score(F->mBowVec,pKF2->mBowVec); accScore+=pKF2->mRelocScore; if(pKF2->mRelocScore>bestScore) { pBestKF=pKF2; bestScore = pKF2->mRelocScore; } } lAccScoreAndMatch.push_back(make_pair(accScore,pBestKF)); if(accScore>bestAccScore) bestAccScore=accScore; }
I found that, too. accScore+=pKF2->mRelocScore; here the pKF2->mRelocScore was not calculated, it is a intial value, u need to calculate it by yourself.
I find sometimes the value of score in function DetectRelocalizationCandidates is negtive
for(list<pair<float,KeyFrame> >::iterator it=lScoreAndMatch.begin(), itend=lScoreAndMatch.end(); it!=itend; it++) { KeyFrame pKFi = it->second; vector<KeyFrame*> vpNeighs = pKFi->GetBestCovisibilityKeyFrames(10);