从PCD文件中读取点云数据

  • 1. 示例代码

1. 示例代码

  • 以下代码均参考PCL官方文档:https://pcl.readthedocs.io/projects/tutorials/en/master/reading_pcd.html

  • pcd_read.cpp
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>int main()
{//creates a PointCloud<PointXYZ> boost shared pointer and initializes it.pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); if (pcl::io::loadPCDFile<pcl::PointXYZ>("test_pcd.pcd", *cloud) == -1) //* load the file{PCL_ERROR("Couldn't read file test_pcd.pcd \n");return (-1);}//另一种方法://[Due to the dynamic nature of point clouds, we prefer to read them as binary blobs, ]//[and then convert to the actual representation that we want to use.]//[由于点云的动态特性,我们更喜欢将它们作为二进制blobs读取,然后转换为我们想要使用的实际表示形式。]//pcl::PCLPointCloud2 cloud_blob;//pcl::io::loadPCDFile("test_pcd.pcd", cloud_blob);//pcl::fromPCLPointCloud2(cloud_blob, *cloud); //* convert from pcl/PCLPointCloud2 to pcl::PointCloud<T>std::cout << "Loaded "<< cloud->width * cloud->height<< " data points from test_pcd.pcd with the following fields: "<< std::endl;for (const auto& point : *cloud)std::cout << "    " << point.x<< " " << point.y<< " "  << point.z << std::endl;system("Pause");return (0);
}

PCL——从PCD文件中读取点云数据相关推荐

  1. PCL—从PCD文件中读取点云数据(一)

    1.从PCD文件中读取点云数据 #include <iostream> #include <pcl/io/pcd_io.h> #include <pcl/point_ty ...

  2. python读取日期_从文件中读取日期和数据(Python)

    我想从文件中读取时间字符串和数据,但是当我使用loadtxt时,我不能同时读取字符串和数字,因为字符串不是浮点型的.所以我尝试使用genfromtxt并使用delimiter=[]+[]+[]作为我所 ...

  3. 算法-(java)-从文件中读取、写入数据

    1.m的n次幂表示 在算法题中经常遇到10的n次幂,java中计算中,有一个函数,返回double类型,math.pow(m,n),m为基数,n为幂次方.这样打印出结果,会打印出带e的数字,如果想要实 ...

  4. matlab读入从文件中读取大量的数据

    将文件导入matlab中,除了对利用菜单的操作,我们也可以使用matlab代码 这个是一个函数,这个函数我们提供所读文件的基础的名字,然后返回一个矩阵 function z = readOneD(ba ...

  5. vc++从txt文件中读取数据

    数值分析课上老师说要将数据写在txt文件上,然后让程序从txt文件中读取数据.让本来C++已经遗忘了很久的我们无从下手,在网上也查看了很多,发现大多都是扯淡,放在VC++编辑器上发现并不能运行,不知道 ...

  6. 从PCD文件写入和读取点云数据

    (1)学习向PCD文件写入点云数据 建立工程文件ch2,然后新建write_pcd.cpp  CMakeLists.txt两个文件 write_pcd.cpp : #include <iostr ...

  7. C 怎么读取Cpp文件_从PCD文件写入和读取点云数据

    (1)学习向PCD文件写入点云数据 建立工程文件ch2,然后新建write_pcd.cpp CMakeLists.txt两个文件 write_pcd.cpp : #include <iostre ...

  8. PCD文件的读取以及可视化

    PCD文件的读取以及可视化   在开发激光雷达相应算法的时候,经常需要生成或者读取pcd点云文件,因此本文主要编写了一个简单的读取pcd点云文件的功能包,并且能够实现可视化. [源代码] #inclu ...

  9. PCD Lesson3:PCD文件的读取

    PCD文件的读取 #include <stdio.h>#include<boost/thread.hpp> #include<boost/timer.hpp> #i ...

最新文章

  1. 上海day2--两年前最烧脑的环境变量
  2. 【Windows系统】用户配置文件删除
  3. Django的CBV与FBV
  4. linux系列(二十):find命令
  5. 【数据结构与算法】之深入解析“罗马数字转整数”的求解思路与算法示例
  6. Access denied for user 'root'@'localhost' (using password: YES) 问题解决小记
  7. mysql sign_mysql - 随笔分类 - signheart - 博客园
  8. 植保___农药基础知识
  9. ios-后台运行UIApplication
  10. 高校毕业设计管理系统【附源码】
  11. 服务器怎么组装,如何组装一台服务器?(最好标明下什么类型的)
  12. 简单易懂!推荐给自学python的小项目实战!
  13. matlab常用逻辑运算
  14. 桃飘火焰焰,梨堕雪漠漠。(排序 贪心
  15. win10 powershell无法激活conda v4.9环境
  16. HTTP HTTPS 及网络请求与响应
  17. 笨办法学Python3 习题39和习题40
  18. 运营干货| 用户触达36计,和用户来次亲密接触
  19. 2021-08-20【JVM系列-2】 GC垃圾回收
  20. 如何修改FLASH动画

热门文章

  1. 几种常见的数据库连接的URL写法(包括国产数据达梦DM)
  2. postgresql视图
  3. 升级阿里云主机系统镜像
  4. FTP 中 「quote type b 1」的含义
  5. 有り様、状態、様子 の 区別
  6. FPGA图像加速解决方案来了
  7. IOS使用pods初次加载出现Pods-resources.sh: Permission denied错误的解决方案
  8. 异步 HttpContext.Current 为空null 另一种解决方法
  9. 解决vue2.0路由 TypeError: Cannot read property ‘matched‘ of undefined 的错误问题
  10. VS2017 启动调试出现 无法启动程序“http://localhost:15613” 操作在当前状态中是非法的。 同时附加进程也是错误的解决方法