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是对已检测到的特征点 ...
随机推荐
- How to start a pdf reader from a Linux command line?
Before you do this, you should be in a GOME or KDE environment, then type the following commands to ...
- [JLOI2015]战争调度
[JLOI2015]战争调度 题目 解题报告 考试打了个枚举的暴力,骗了20= = $qsy$大佬的$DP$: 其实就是枚举= =,只不过枚举的比较强= = #include<iostream& ...
- CODEVS——T 2969 角谷猜想
http://codevs.cn/problem/2969/ 时间限制: 1 s 空间限制: 32000 KB 题目等级 : 黄金 Gold 题解 查看运行结果 题目描述 Descri ...
- Java多线程之如何确定线程数
关于多线程的线程数的确定,最近研读过几篇paper,在此做一下笔记,方便使用时翻看. 1.<Java 虚拟机并发编程>中介绍 就是说:线程数 = CPU的核心数 * (1 - 阻塞系数) ...
- DSP、Media、AdExchanger之间的关系及交互流程
广告商,如以下的樱花日语,淘宝卖家.其须要推广自己的产品. Zampdsp(晶赞) 是DSP平台.其与非常多广告商合作,广告商在平台上公布广告创意,并托付平台代为投放. tanx.com 是adExc ...
- 设计模式学习–Decorator
What Decorator:动态地给一个对象加入一些额外的职责. 就添加功能来说.Decorator模式相比生成子类更加灵活. Why Decorator模式适用于能够动态的给对象增删职责.比方qq ...
- HTML_项目符号使用图片
本文出自:http://blog.csdn.net/svitter 创建一个HTML页面. 其内容为一个无序列表. 列表中至少包括了5本畅销书,每本书之前的项目符号必须採用概述封面的缩略图. 这些信息 ...
- iOS中的多线程NSThread/GCD/NSOperation & NSOperationQueue
iOS多线程有四套多线程方案: Pthreads NSThread GCD NSOperation & NSOperationQueue 接下来我来一个一个介绍他们 Pthreads 在类Un ...
- linux 启动两个tomcat
按照下面的步骤操作即可部署成功:一些具体操作命令就不详细说了,直接说有用的:1.在 /usr/local 下部署两个Tomcat,tomcat的文件夹重命名为:tomcat6-1 . tomcat ...
- 一个伟大的发现,装X一下。笔记本win7系统64位机器执行unity 时,屏幕模糊解决的方法
笔者笔记本win7系统64位机器执行unity 时.往往切换时unity界面屏幕模糊,后来发现此时须要下载DirectXRuntimes201006x64,安装就可以.