本文整理汇总了C++中KeyFrame::GetKeyPointUn方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyFrame::GetKeyPointUn方法的具体用法?C++ KeyFrame::GetKeyPointUn怎么用?C++ KeyFrame::GetKeyPointUn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyFrame
的用法示例。
在下文中一共展示了KeyFrame::GetKeyPointUn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KeyFrameCulling
void LocalMapping::KeyFrameCulling()
{
// Check redundant keyframes (only local keyframes)
// A keyframe is considered redundant if the 90% of the MapPoints it sees, are seen
// in at least other 3 keyframes (in the same or finer scale)
vector<KeyFrame*> vpLocalKeyFrames = mpCurrentKeyFrame->GetVectorCovisibleKeyFrames();
for(vector<KeyFrame*>::iterator vit=vpLocalKeyFrames.begin(), vend=vpLocalKeyFrames.end(); vit!=vend; vit++)
{
KeyFrame* pKF = *vit;
if(pKF->mnId==0)
continue;
vector<MapPoint*> vpMapPoints = pKF->GetMapPointMatches();
int nRedundantObservations=0;
int nMPs=0;
for(size_t i=0, iend=vpMapPoints.size(); i<iend; i++)
{
MapPoint* pMP = vpMapPoints[i];
if(pMP)
{
if(!pMP->isBad())
{
nMPs++;
if(pMP->Observations()>3)
{
int scaleLevel = pKF->GetKeyPointUn(i).octave;
map<KeyFrame*, size_t> observations = pMP->GetObservations();
int nObs=0;
for(map<KeyFrame*, size_t>::iterator mit=observations.begin(), mend=observations.end(); mit!=mend; mit++)
{
KeyFrame* pKFi = mit->first;
if(pKFi==pKF)
continue;
int scaleLeveli = pKFi->GetKeyPointUn(mit->second).octave;
if(scaleLeveli<=scaleLevel+1)
{
nObs++;
if(nObs>=3)
break;
}
}
if(nObs>=3)
{
nRedundantObservations++;
}
}
}
}
}
if(nRedundantObservations>0.9*nMPs)
pKF->SetBadFlag();
}
}