zoukankan      html  css  js  c++  java
  • [PCL]模型拟合方法——随机采样一致性

    SACSegmentation封装了多种Ransac方法,包括:

    RandomSampleConsensus,

    LeastMedianSquares,

    MEstimatorSampleConsensus

    ProgressiveSampleConsensus,

    RandomizedRandomSampleConsensus,

    RandomizedMEstimatorSampleConsensus,

    MaximumLikelihoodSampleConsensus

    1.PCL所谓的平行线判断,是已知一个法向量,判断面与之平行。
    2.PCL直线Ransac拟合,为啥只需要设置一个距离阈值?因为默认值迭代50次
     
    template <typename PointT> void
    pcl::SACSegmentation<PointT>::initSAC (const int method_type)
    {
      if (sac_)
        sac_.reset ();
      // Build the sample consensus method
      switch (method_type)
      {
        case SAC_RANSAC:
        default:
        {
          PCL_DEBUG ("[pcl::%s::initSAC] Using a method of type: SAC_RANSAC with a model threshold of %f
    ", getClassName ().c_str (), threshold_);
          sac_.reset (new RandomSampleConsensus<PointT> (model_, threshold_));
          break;
        }
        case SAC_LMEDS:
        {
          PCL_DEBUG ("[pcl::%s::initSAC] Using a method of type: SAC_LMEDS with a model threshold of %f
    ", getClassName ().c_str (), threshold_);
          sac_.reset (new LeastMedianSquares<PointT> (model_, threshold_));
          break;
        }
        case SAC_MSAC:
        {
          PCL_DEBUG ("[pcl::%s::initSAC] Using a method of type: SAC_MSAC with a model threshold of %f
    ", getClassName ().c_str (), threshold_);
          sac_.reset (new MEstimatorSampleConsensus<PointT> (model_, threshold_));
          break;
        }
        case SAC_RRANSAC:
        {
          PCL_DEBUG ("[pcl::%s::initSAC] Using a method of type: SAC_RRANSAC with a model threshold of %f
    ", getClassName ().c_str (), threshold_);
          sac_.reset (new RandomizedRandomSampleConsensus<PointT> (model_, threshold_));
          break;
        }
        case SAC_RMSAC:
        {
          PCL_DEBUG ("[pcl::%s::initSAC] Using a method of type: SAC_RMSAC with a model threshold of %f
    ", getClassName ().c_str (), threshold_);
          sac_.reset (new RandomizedMEstimatorSampleConsensus<PointT> (model_, threshold_));
          break;
        }
        case SAC_MLESAC:
        {
          PCL_DEBUG ("[pcl::%s::initSAC] Using a method of type: SAC_MLESAC with a model threshold of %f
    ", getClassName ().c_str (), threshold_);
          sac_.reset (new MaximumLikelihoodSampleConsensus<PointT> (model_, threshold_));
          break;
        }
        case SAC_PROSAC:
        {
          PCL_DEBUG ("[pcl::%s::initSAC] Using a method of type: SAC_PROSAC with a model threshold of %f
    ", getClassName ().c_str (), threshold_);
          sac_.reset (new ProgressiveSampleConsensus<PointT> (model_, threshold_));
          break;
        }
      }
      // Set the Sample Consensus parameters if they are given/changed
      if (sac_->getProbability () != probability_)
      {
        PCL_DEBUG ("[pcl::%s::initSAC] Setting the desired probability to %f
    ", getClassName ().c_str (), probability_);
        sac_->setProbability (probability_);
      }
      if (max_iterations_ != -1 && sac_->getMaxIterations () != max_iterations_)
      {
        PCL_DEBUG ("[pcl::%s::initSAC] Setting the maximum number of iterations to %d
    ", getClassName ().c_str (), max_iterations_);
        sac_->setMaxIterations (max_iterations_);
      }
      if (samples_radius_ > 0.)
      {
        PCL_DEBUG ("[pcl::%s::initSAC] Setting the maximum sample radius to %f
    ", getClassName ().c_str (), samples_radius_);
        // Set maximum distance for radius search during random sampling
        model_->setSamplesMaxDist (samples_radius_, samples_radius_search_);
      }
    }
    

      

  • 相关阅读:
    11gR2 RAC手动添加节点数据库实例 转
    Oracle 11g rac添加删除集群数据库
    11gR2RAC更换CRS磁盘组文档
    Java堆、栈和常量池
    牛人博客
    异常的定义和分类
    java中Proxy(代理与动态代理)
    详解java定时任务
    世界上最大的风不是台风,而是枕边风
    tomcat 日志catalina.out 按天自动分割 设定时任务定时清除
  • 原文地址:https://www.cnblogs.com/yhlx125/p/10645392.html
Copyright © 2011-2022 走看看