#include <pcl/filters/passthrough.h>
#include <pcl/filters/impl/passthrough.hpp>
// the rest of the code goes here
如果你的代码是库的一部分,可以被他人使用,需要为你自己的MyPointType类型进行显示实例化。
实例
下面的代码段创建了包含XYZ数据的新point类型,连同一个的test的浮点型数据,这样满足存储对齐。
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/io/pcd_io.h> struct MyPointType //定义点类型结构
{
PCL_ADD_POINT4D; // 该点类型有4个元素
float test;
EIGEN_MAKE_ALIGNED_OPERATOR_NEW// 确保new操作符对齐操作
}EIGEN_ALIGN16;// 强制SSE对齐 POINT_CLOUD_REGISTER_POINT_STRUCT(MyPointType,// 注册点类型宏
(float,x,x)
(float,y,y)
(float,z,z)
(float,test,test)
)
int
main(int argc,char** argv)
{
pcl::PointCloud<MyPointType> cloud;
cloud.points.resize();
cloud.width=;
cloud.height=; cloud.points[].test=;
cloud.points[].test=;
cloud.points[].x=cloud.points[].y=cloud.points[].z=;
cloud.points[].x=cloud.points[].y=cloud.points[].z=; pcl::io::savePCDFile("test.pcd",cloud);
}

转:   http://www.pclcn.org/study/shownews.php?lang=cn&id=286

PCL点云库增加自定义数据类型的更多相关文章

  1. PCL点云库:ICP算法

    ICP(Iterative Closest Point迭代最近点)算法是一种点集对点集配准方法.在VTK.PCL.MRPT.MeshLab等C++库或软件中都有实现,可以参见维基百科中的ICP Alg ...

  2. PCL点云库中的坐标系(CoordinateSystem)

    博客转载自:https://blog.csdn.net/qq_33624918/article/details/80488590 引言 世上本没有坐标系,用的人多了,便定义了坐标系统用来定位.地理坐标 ...

  3. Windows下安装PCL点云库

    原文链接:http://blog.csdn.net/u012337034/article/details/38270109 简介:         在Windows下安装PCL点云库的方法大概有两种: ...

  4. Windows 8 64位系统 在VS2010 32位软件上 搭建 PCL点云库 开发环境

    Windows 8 64位系统 在VS2010 32位软件上 搭建 PCL点云库 开发环境 下载PCL For windows 软件包 到这个网站下载PCL-All-In-One Installer: ...

  5. python利用pybind11调用PCL点云库

    2019年7月9日14:31:13 完成了一个简单的小例子,python生成点云数据,利用pybind11传给PCL显示. ubuntu 16.04 + Anaconda3  python3.6 + ...

  6. PCL点云库(Point Cloud Library)简介

    博客转载自:http://www.pclcn.org/study/shownews.php?lang=cn&id=29 什么是PCL PCL(Point Cloud Library)是在吸收了 ...

  7. PCL点云库:对点云进行变换(Using a matrix to transform a point cloud)

    点云数据可以用ASCII码的形式存储在PCD文件中(关于该格式的描述可以参考链接:The PCD (Point Cloud Data) file format).为了生成三维点云数据,在excel中用 ...

  8. [PCL]1 PCL点云库安装

    1.安装文件下载:官网,我还是比较喜欢别人编译好的安装包啊,哈哈. http://www.pointclouds.org/downloads/windows.html 2.傻瓜式安装(下面的依赖项都集 ...

  9. 25 面向对象设计实例——基于PCL点云库的通用工具开发

    0 引言 问题背景:pcl中提供了大量工具,用于对点云和三角面片文件进行处理和显示.在研究中,存在很多简易的需求,比如点云坐标转换,点云的打开显示以及同步显示,点云的最小包络求解,点云的格式转换等等. ...

随机推荐

  1. Letter of application, e-mail version

    Subject line: (logical to recipient!) Application for sales representative for mid-Atlantic area Apr ...

  2. AutoFac初探

    .net 4.0使用的DLL #region RegisterType注册 var builder = new ContainerBuilder(); builder.RegisterType< ...

  3. 使用Toad导入导出dmp数据

    进入Toad,选择Database->Import->Import Utility Wizard(导入则选择:Export->Export Utility Wizard与导入类似故不 ...

  4. 关于OC中的几种代码延迟执行方式

    第一种: [UIView animateWithDuration:3 delay:3 options:1 animations:^{         self.btn.transform = CGAf ...

  5. #ifndef #define #endif 防止头文件被重复引用

    想必很多人都看过“头文件中的 #ifndef/#define/#endif 防止该头文件被重复引用”.但是是否能理解“被重复引用”是什么意思?是不能在不同的两个文件中使用include来包含这个头文件 ...

  6. C# Winform程序本地化应用

    1. 创建一个WinForm应用程序 – “WindowsFormsLocalizationTest”. 2. 在主窗体属性栏里,把Localizable属性设置成”True”. 3. 添加两个But ...

  7. js监控视频播放的事件并打印log

    html代码: <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" ...

  8. 类型 - PHP手册笔记

    类型简介 PHP 支持 8 种原始数据类型. 四种标量类型: boolean(布尔型,不区分大小写) integer(整型) float(浮点型,也称作double) string(字符串) 两种复合 ...

  9. python实现zabbix_sender的socket通信代码样例

    sk = socket.socket() sk.connect(self.ip_port) sk.settimeout(5) sk.sendall(b'ZBXD\x01') sk.sendall(b' ...

  10. COCI 2015/2016 Day 8 PROKLETNIK

    PROKLETNIK 题目描述:给出\(n\)个数,定义一段连续的数为魔法串是该区间的左右端点值正好是区间的最小值与最大值(最小值可以在左也可以在右,最大值也一样).\(Q\)个询问,每次询问一个区间 ...