當前位置: 首頁>>代碼示例>>C++>>正文


C++ Correspondences::clear方法代碼示例

本文整理匯總了C++中pcl::Correspondences::clear方法的典型用法代碼示例。如果您正苦於以下問題:C++ Correspondences::clear方法的具體用法?C++ Correspondences::clear怎麽用?C++ Correspondences::clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pcl::Correspondences的用法示例。


在下文中一共展示了Correspondences::clear方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: fabs

void
pcl::registration::CorrespondenceRejectionOrganizedBoundary::getRemainingCorrespondences (const pcl::Correspondences& original_correspondences,
                                                                                          pcl::Correspondences& remaining_correspondences)
{
  pcl::PointCloud<pcl::PointXYZ>::ConstPtr cloud = boost::static_pointer_cast<pcl::registration::DataContainer<pcl::PointXYZ, pcl::PointNormal> >(data_container_)->getInputTarget ();

  if (!cloud->isOrganized ())
  {
    PCL_ERROR ("[pcl::registration::CorrespondenceRejectionOrganizedBoundary::getRemainingCorrespondences] The target cloud is not organized.\n");
    remaining_correspondences.clear ();
    return;
  }

  remaining_correspondences.reserve (original_correspondences.size ());
  for (size_t c_i = 0; c_i < original_correspondences.size (); ++c_i)
  {
    /// Count how many NaNs bound the target point
    int x = original_correspondences[c_i].index_match % cloud->width;
    int y = original_correspondences[c_i].index_match / cloud->width;

    int nan_count_tgt = 0;
    for (int x_d = -window_size_/2; x_d <= window_size_/2; ++x_d)
      for (int y_d = -window_size_/2; y_d <= window_size_/2; ++y_d)
        if (x + x_d >= 0 && x + x_d < cloud->width &&
            y + y_d >= 0 && y + y_d < cloud->height)
        {
          if (!pcl_isfinite ((*cloud)(x + x_d, y + y_d).z) ||
              fabs ((*cloud)(x, y).z - (*cloud)(x + x_d, y + y_d).z) > depth_step_threshold_)
            nan_count_tgt ++;
        }

    if (nan_count_tgt >= boundary_nans_threshold_)
      continue;


    /// The correspondence passes both tests, add it to the filtered set of correspondences
    remaining_correspondences.push_back (original_correspondences[c_i]);
  }
}
開發者ID:5irius,項目名稱:pcl,代碼行數:39,代碼來源:correspondence_rejection_organized_boundary.cpp


注:本文中的pcl::Correspondences::clear方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。