[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天的啊!有人指导说可以先进行一下随机采样,再训练,这样对训练结果不会有太大影响(这个待考证).所 ...
随机推荐
- openwrt MT7628 编译前更改为DHCP,root 密码、ssid、时区、主机名
一.设置为DHCP动态获取ip地址 在:/home/OpenWrt/openwrt_CC_mt76xx_zhuotk_source/ 目录下,新建文件名/files/etc/config. 将配置好的 ...
- 《剑指offer》连续子数组的最大和
本题来自<剑指offer> 反转链表 题目: 思路: C++ Code: Python Code: 总结:
- js 读取文件
读取文本文件 读取文本文件: <input type="file" id="file1" accept="*" /> </ ...
- python实现简单的登录管理
import json,timeusername=[]userpasswd=[]def login_success_file(name): try: f=open(r"F:/login_su ...
- [方案]基于Zynq WiFi方案构建
基于Zynq系列,搭建无线传输平台 1) 2.4G 2) 5G AC
- Linux 查看负载内存
负载 内存 1.作用 top命令用来显示执行中的程序进程,使用权限是所有用户. 2.格式 top [-] [d delay] [q] [c] [S] [s] [i] [n] 3.主要参数 ...
- Python运算符——复合运算符
就相当于算数运算符的后面加一个“=” 例:+= num = num+5 可以写成 num += 5 就是说,等式右边含有左边的变量名,就可以直接去掉,然后右边的符号移到左边去 同样的“-= / ...
- python与RabbitMQ
RabbitMQ 前言 什么是MQ? MQ全称为Message Queue, 消息队列(MQ)是一种应用程序对应用程序的通信方法.应用程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用 ...
- C++ 简单的控制台贪吃蛇小游戏
由于比较懒,所以不怎么写,觉得这样不应该.我应该对自己学的做出整理,不管是高端低端,写出来是自己的. // 贪吃蛇.cpp : 定义控制台应用程序的入口点. // #include "std ...
- JavaScript(四)
条件语句 通过条件来控制程序的走向,就需要用到条件语句. 运算符 1.算术运算符: +(加). -(减). *(乘). /(除). %(求余)2.赋值运算符:=. +=. -=. *=. /=. %= ...