本文整理汇总了C++中CFeatureList::kdTreeClosestPoint2DsqrError方法的典型用法代码示例。如果您正苦于以下问题:C++ CFeatureList::kdTreeClosestPoint2DsqrError方法的具体用法?C++ CFeatureList::kdTreeClosestPoint2DsqrError怎么用?C++ CFeatureList::kdTreeClosestPoint2DsqrError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFeatureList
的用法示例。
在下文中一共展示了CFeatureList::kdTreeClosestPoint2DsqrError方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: int
inline void trackFeatures_addNewFeats<CFeatureList>(CFeatureList &featureList,const TSimpleFeatureList &new_feats, const std::vector<size_t> &sorted_indices, const size_t nNewToCheck,const size_t maxNumFeatures,const float minimum_KLT_response_to_add,const double threshold_sqr_dist_to_add_new,const size_t patchSize,const CImage &cur_gray, TFeatureID &max_feat_ID_at_input)
{
const TImageSize imgSize = cur_gray.getSize();
const int offset = (int)patchSize/2 + 1;
const int w_off = int(imgSize.x - offset);
const int h_off = int(imgSize.y - offset);
for (size_t i=0;i<nNewToCheck && featureList.size()<maxNumFeatures;i++)
{
const TSimpleFeature &feat = new_feats[ sorted_indices[i] ];
if (feat.response<minimum_KLT_response_to_add) continue;
double min_dist_sqr = square(10000);
if (!featureList.empty())
{
//m_timlog.enter("[CGenericFeatureTracker] add new features.kdtree");
min_dist_sqr = featureList.kdTreeClosestPoint2DsqrError(feat.pt.x,feat.pt.y );
//m_timlog.leave("[CGenericFeatureTracker] add new features.kdtree");
}
if (min_dist_sqr>threshold_sqr_dist_to_add_new &&
feat.pt.x > offset &&
feat.pt.y > offset &&
feat.pt.x < w_off &&
feat.pt.y < h_off )
{
// Add new feature:
CFeaturePtr ft = CFeature::Create();
ft->type = featFAST;
ft->ID = ++max_feat_ID_at_input;
ft->x = feat.pt.x;
ft->y = feat.pt.y;
ft->response = feat.response;
ft->orientation = 0;
ft->scale = 1;
ft->patchSize = patchSize; // The size of the feature patch
if( patchSize > 0 )
cur_gray.extract_patch(
ft->patch,
round( ft->x ) - offset,
round( ft->y ) - offset,
patchSize,
patchSize ); // Image patch surronding the feature
featureList.push_back( ft );
}
}
} // end of trackFeatures_addNewFeats<>