[PCL]模型拟合方法——随机采样一致性
SACSegmentation封装了多种Ransac方法,包括:
RandomSampleConsensus,
LeastMedianSquares,
MEstimatorSampleConsensus
ProgressiveSampleConsensus,
RandomizedRandomSampleConsensus,
RandomizedMEstimatorSampleConsensus,
MaximumLikelihoodSampleConsensus
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\n", 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\n", 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\n", 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\n", 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\n", 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\n", 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\n", 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\n", 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\n", 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\n", getClassName ().c_str (), samples_radius_);
// Set maximum distance for radius search during random sampling
model_->setSamplesMaxDist (samples_radius_, samples_radius_search_);
}
}
[PCL]模型拟合方法——随机采样一致性的更多相关文章
- RANSAC - 随机采样一致性算法
RANSAC范例的正式描述如下: 首先,要给定: 1一个模型,该模型需要最少n个数据点去实例化它的自由参数: 2一组数据点P,P中包含数据点的数量#(P)大于n. 然后, 从P中随机地选择n个点(组成 ...
- PCL采样一致性算法
在计算机视觉领域广泛的使用各种不同的采样一致性参数估计算法用于排除错误的样本,样本不同对应的应用不同,例如剔除错误的配准点对,分割出处在模型上的点集,PCL中以随机采样一致性算法(RANSAC)为核心 ...
- 关于乱序(shuffle)与随机采样(sample)的一点探究
最近一个月的时间,基本上都在加班加点的写业务,在写代码的时候,也遇到了一个有趣的问题,值得记录一下. 简单来说,需求是从一个字典(python dict)中随机选出K个满足条件的key.代码如下(py ...
- 随机采样和随机模拟:吉布斯采样Gibbs Sampling实现高斯分布参数推断
http://blog.csdn.net/pipisorry/article/details/51539739 吉布斯采样的实现问题 本文主要说明如何通过吉布斯采样来采样截断多维高斯分布的参数(已知一 ...
- 随机采样和随机模拟:吉布斯采样Gibbs Sampling实现文档分类
http://blog.csdn.net/pipisorry/article/details/51525308 吉布斯采样的实现问题 本文主要说明如何通过吉布斯采样进行文档分类(聚类),当然更复杂的实 ...
- 随机采样和随机模拟:吉布斯采样Gibbs Sampling
http://blog.csdn.net/pipisorry/article/details/51373090 吉布斯采样算法详解 为什么要用吉布斯采样 通俗解释一下什么是sampling. samp ...
- Pandas排列和随机采样
随机重排序 import pandas as pd import numpy as np from pandas import Series df = pd.DataFrame(np.arange(5 ...
- hive随机采样
hive> select * from account limit 10;OKaccount.accountname account.accid account.platid ac ...
- 利用shuf对数据记录进行随机采样
最近在用SVM为分类器做实验,但是发现数据量太大(2000k条记录)但是训练时间过长...让我足足等了1天的啊!有人指导说可以先进行一下随机采样,再训练,这样对训练结果不会有太大影响(这个待考证).所 ...
随机推荐
- 浅谈z-index
z-index使用条件 CSS3之前,z-index属性只有和定位元素在(postion不为static的元素)一起的时候才会有作用,但CSS3中flex盒子的子元素也可以设置z-index.理论上来 ...
- Emacs Org-mode 2 文档结构
2.1 章节 org-mode用* 标识章节,一个* 代表一级标题,两个* 代表两级标题,以此类推.最多6颗星,也就是最多6级. 书写格式如下: * 标题一 ** 标题二 注意, * 后有空格.不同的 ...
- docker hub加速访问设置
前言:docker是国外的,虽然有个版本开源免费,但是其docker hub还是在国外,刚刚安装后,拉镜像就会发现,连接请求超时,中断服务,这是因为防火墙的问题,所以要将源指向国内的知名docker ...
- main函数中System.exit()的作用
main()主函数再熟悉不过,了解java的人也都知道System.exit()方法是停止虚拟机运行.那这里为什么还要单独写一篇博客,都是源于朋友发的一张最近刚买的T恤照片,就是上面这张图.这是一个经 ...
- Scrapy Selectors 选择器
0. 1.参考 <用Python写网络爬虫>——2.2 三种网页抓取方法 re / lxml / BeautifulSoup 需要注意的是,lxml在内部实现中,实际上是将CSS选择器转 ...
- ionic2项目中实现md5加密
1. 安装插件 npm i ts-md5 --save 2. 在项目中引用 import { Md5 } from 'ts-md5/dist/md5'; ... ionViewDidLoad() { ...
- iphone手机浏览器文本框不触发输入中文的keyup事件
问题描述:iphone手机浏览器文本框不触发输入中文的keyup事件,在输入中文之后需要点击回退按键,才会开始搜索.问题分析:iphone手机的输入法(不管是第三方还是自带)能检测到英文或者数字的ke ...
- 堡垒机jumpserver测试记录--使用
快速入门 截图就不放了,官网都有,这里只是就遇到的一些问题做下记录 必备条件 一台安装好 Jumpserver 系统的可用主机(堡垒机) 一台或多台可用的 Linux.Windows资产设备(被管理的 ...
- 【BZOJ4842】[Neerc2016]Delight for a Cat 线性规划+费用流
[BZOJ4842][Neerc2016]Delight for a Cat Description ls是一个特别堕落的小朋友,对于n个连续的小时,他将要么睡觉要么打隔膜,一个小时内他不能既睡觉也打 ...
- python移植环境
如果整理材料的时候或者给别人共享代码的时候,除了使用docker外,也可以使用pip或者conda生成依赖项文件,然后在其他机器上将该依赖项一一安装就可以了. 但是有很多版本的依赖导致使用pip总是安 ...