PCL:描述三维离散点的ROPS特征(Code)
前言:
三维点云为三维欧式空间点的集合。对点云的形状描述若使用局部特征,则可分为两种:固定世界坐标系的局部描述和寻找局部主方向的局部描述,ROPS特征为寻找局部主方向的特征描述。
1.寻找主方向(对XYZ轴经过特定旋转)LFR:
<1>.计算法线特征:这一步是非常耗计算量的,若达到可以接受的法线精度,此过程几乎占据了 整个计算过程的50%;可选择的方法有 使用空间树索引建立近邻域,对近邻平面拟合,平面的参数方向既是法线一个方向。
<2>.进行多边形重建:利用贪婪投影的方法进行三角形重建,这个事一个调参数的过程,没有可以完全的方法。
参数有:
gp3.setSearchMethod (treeNor);
gp3.setSearchRadius (Gp3PolyParam.SearchRadius);// Set 最大搜索半径
gp3.setMu (Gp3PolyParam.MuTypeValue);// Set typical values
gp3.setMaximumNearestNeighbors (Gp3PolyParam.MaximumNearestNeighbors);
gp3.setMaximumSurfaceAngle (Gp3PolyParam.MaximumSurfaceAngle); // 45 度
gp3.setMinimumAngle ( Gp3PolyParam.MinimumAngle); // 10 度
gp3.setMaximumAngle (Gp3PolyParam.MaximumAngle); // 120 度
gp3.setNormalConsistency (Gp3PolyParam.NormalConsistency);
<3>.计算整幅图像的ROPS特征:
查找PCL官网的tutoriales:http://pointclouds.org/documentation/tutorials/rops_feature.php。
#include <pcl/features/rops_estimation.h>
#include <pcl/io/pcd_io.h> int main (int argc, char** argv)
{
if (argc != 4)
return (-1); pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ> ());
if (pcl::io::loadPCDFile (argv[1], *cloud) == -1)
return (-1); pcl::PointIndicesPtr indices = boost::shared_ptr <pcl::PointIndices> (new pcl::PointIndices ());
std::ifstream indices_file;
indices_file.open (argv[2], std::ifstream::in);
for (std::string line; std::getline (indices_file, line);)
{
std::istringstream in (line);
unsigned int index = 0;
in >> index;
indices->indices.push_back (index - 1);
}
indices_file.close (); std::vector <pcl::Vertices> triangles;
std::ifstream triangles_file;
triangles_file.open (argv[3], std::ifstream::in);
for (std::string line; std::getline (triangles_file, line);)
{
pcl::Vertices triangle;
std::istringstream in (line);
unsigned int vertex = 0;
in >> vertex;
triangle.vertices.push_back (vertex - 1);
in >> vertex;
triangle.vertices.push_back (vertex - 1);
in >> vertex;
triangle.vertices.push_back (vertex - 1);
triangles.push_back (triangle);
} float support_radius = 0.0285f;
unsigned int number_of_partition_bins = 5;
unsigned int number_of_rotations = 3; pcl::search::KdTree<pcl::PointXYZ>::Ptr search_method (new pcl::search::KdTree<pcl::PointXYZ>);
search_method->setInputCloud (cloud); pcl::ROPSEstimation <pcl::PointXYZ, pcl::Histogram <135> > feature_estimator;
feature_estimator.setSearchMethod (search_method);
feature_estimator.setSearchSurface (cloud);
feature_estimator.setInputCloud (cloud);
feature_estimator.setIndices (indices);
feature_estimator.setTriangles (triangles);
feature_estimator.setRadiusSearch (support_radius);
feature_estimator.setNumberOfPartitionBins (number_of_partition_bins);
feature_estimator.setNumberOfRotations (number_of_rotations);
feature_estimator.setSupportRadius (support_radius); pcl::PointCloud<pcl::Histogram <135> >::Ptr histograms (new pcl::PointCloud <pcl::Histogram <135> > ());
feature_estimator.compute (*histograms); return (0);
}
PCL:描述三维离散点的ROPS特征(Code)的更多相关文章
- PCL—综述—三维图像处理
点云模型与三维信息 三维图像是一种特殊的信息表达形式,其特征是表达的空间中三个维度的数据.和二维图像相比,三维图像借助第三个维度的信息,可以实现天然的物体-背景解耦.除此之外,对于视觉测量来说,物体的 ...
- 特征提取(Detect)、特征描述(Descriptor)、特征匹配(Match)的通俗解释
特征匹配(Feature Match)是计算机视觉中很多应用的基础,比如说图像配准,摄像机跟踪,三维重建,物体识别,人脸识别,所以花一些时间去深入理解这个概念是不为过的.本文希望通过一种通俗易懂的方式 ...
- **PCL:嵌入VTK/QT显示(Code^_^)
中国人真是太不知道分享了,看看这个老外的博客,启发性链接. http://www.pcl-users.org/ 1. 这个是可用的源代码: 原文:I saw a thread with links t ...
- 纹理特征描述之灰度差分统计特征(平均值 对比度 熵) 计算和比较两幅纹理图像的灰度差分统计特征 matlab代码实现
灰度差分统计特征有: 平均值: 对比度: 熵: i表示某一灰度值,p(i)表示图像取这一灰度值的概率 close all;clear all;clc; % 纹理图像的灰度差分统计特征 J = i ...
- PCL点云特征描述与提取(1)
3D点云特征描述与提取是点云信息处理中最基础也是最关键的一部分,点云的识别.分割,重采样,配准曲面重建等处理大部分算法,都严重依赖特征描述与提取的结果.从尺度上来分,一般分为局部特征的描述和全局特征的 ...
- 点云数据中的三维信息提取pcl
https://www.hanspub.org/journal/PaperInformation.aspx?paperID=24702 https://wenku.baidu.com/view/160 ...
- SIFT解析(三)生成特征描述子
以上两篇文章中检测在DOG空间中稳定的特征点,lowe已经提到这些特征点是比Harris角点等特征还要稳定的特征.下一步骤我们要考虑的就是如何去很好地描述这些DOG特征点. 下面好好说说如何来描述这些 ...
- 第十六节、特征描述符BRIEF(附源码)
我们已经知道SIFT算法采用128维的特征描述子,由于描述子用的是浮点数,所以它将会占用512字节的空间.类似的SUFR算法,一般采用64维的描述子,它将占用256字节的空间.如果一幅图像中有1000 ...
- BRIEF特征点描述子
简介 BRIEF是2010年的一篇名为<BRIEF:Binary Robust Independent Elementary Features>的文章中提出,BRIEF是对已检测到的特征点 ...
随机推荐
- http长链接问题
http://www.ibm.com/developerworks/cn/web/wa-lo-comet/
- java 垃圾收集
1.为什么使用垃圾收集 a.把用户从释放占用内存的重担中解救出来 b.帮助程序保持完整性 2.垃圾收集算法 检测出垃圾对象,必须回收垃圾对象所使用的堆空间并还给程序 垃圾检测:通过建立一个根对象集合并 ...
- 【DEBUG】 Visual Studio 2005 DEBUG集
一. fatal error C1083: 无法打开包括文件:"stdint.h": No such file or directory stdint.h是c99标准的头文件,vc ...
- [MongoDB]mongo命令行工具
1.use dbname 自动创建 2.db.user.find() 空 show collections 空 show dbs 3.db.user.save({name:'',age:20}) db ...
- 我要抓狂了。。又回到了几天不能A一道题的时候
poj1556我不做了.你做做把...我已经要game over了
- AspNet MVC4 教学-27:Asp.Net MVC4 自己定义helper及function的高速Demo
A.创建Basic类型项目. B.创建App_Code目录,在里面创建2个cshtml文件: MyHelper.cshtml: @helper MyTruncate(string input, int ...
- 2.3-STP生成树
2.3-STP生成树 单点失效(signle point of failure)及其解决方法: 当两个Segement之间只有一条物理连接时就有可能出现单点失效→ 单方面的故障导致全网 ...
- CSS制作响应式正方形及其应用
CSS制作响应式正方形?什么鬼?干嘛用的?干嘛用的没人有每人的需求,本人也正好是由于公司正在做的业务须要,想做个照片展示的功能(当然得符合响应式了).而这个照片展示必须符合下面几点功能:1.用三张图片 ...
- window.open()方法(弹出层)
1, 最主要的弹出窗体代码 window.open('page.html'); 2, 经过设置后的弹出窗体 window.open('page.html', 'newwindow', 'h ...
- ios 视频播放代码Demo
方法一: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. / ...