PCL学习(一)从PLY文件读入点云数据
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/io/ply_io.h> int main(int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); if (pcl::io::loadPLYFile<pcl::PointXYZ>("model.ply", *cloud) == -1) //* load the file
{
PCL_ERROR("Couldn't read file test_pcd.pcd \n");
system("PAUSE");
return (-1);
}
std::cout << "Loaded "
<< cloud->width * cloud->height
<< " data points from test_pcd.pcd with the following fields: "
<< std::endl;
for (size_t i = 0; i < cloud->points.size(); ++i)
std::cout << " " << cloud->points[i].x
<< " " << cloud->points[i].y
<< " " << cloud->points[i].z
<< std::endl;
//std::string filename("test.pcd");
//pcl::PCDWriter writer;
//writer.write(filename, *cloud); system("PAUSE");
return (0);
}
上面这段代码从ply文件中读入点云
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/io/ply_io.h>
#include <pcl/visualization/cloud_viewer.h> int main(int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); if (pcl::io::loadPLYFile<pcl::PointXYZ>("model.ply", *cloud) == -1) //* load the file
{
PCL_ERROR("Couldn't read file test_pcd.pcd \n");
system("PAUSE");
return (-1);
}
//pcl::StatisticalOutlierRemoval::applyFileter()
pcl::visualization::CloudViewer viewer("Viewer");
viewer.showCloud(cloud); system("PAUSE");
return (0);
}
将读入的ply文件可视化出来
PCL学习(一)从PLY文件读入点云数据的更多相关文章
- 向PCD文件写入点云数据
博客转载自:http://www.pclcn.org/study/shownews.php?lang=cn&id=83 本小节我们学习如何向PCD文件写入点云数据. 代码 章例2文件夹中,打开 ...
- PCL学习(二)三维模型转点云 obj转pcd----PCL实现
#include <pcl/io/io.h> #include <pcl/io/pcd_io.h> #include <pcl/io/obj_io.h> #incl ...
- pcl学习笔记(二):点云类型
不同的点云类型 前面所说的,pcl::PointCloud包含一个域,它作为点的容器,这个域是PointT类型的,这个域是PointT类型的是pcl::PointCloud类的模板参数,定义了点云的存 ...
- 从PCD文件写入和读取点云数据
(1)学习向PCD文件写入点云数据 建立工程文件ch2,然后新建write_pcd.cpp CMakeLists.txt两个文件 write_pcd.cpp : #include <iostr ...
- 点云库PCL学习
1. 点云的提取 点云的获取:RGBD获取 点云的获取:图像匹配获取(通过摄影测量提取点云数据) 点云的获取:三维激光扫描仪 2. PCL简介 PCL是Point Cloud Library的简称,是 ...
- PLY文件(转)
转载:http://bbs.itiankong.com/thread-89555-1-1.html PLY 是一种电脑档案格式,全名为 多边形档案(Polygon File Format) 或 史丹佛 ...
- PCL的PNG文件和计算点云重心
PCL提供节约一点云的值为一个PNG图像文件的可能方案.显然,这只能用有序的点云来完成,因为生成的图像的行和列将与点云的对应完全一致.例如,如果你从一个传感器Kinect或Xtion的点云,你可以用这 ...
- 系统学习 Java IO (四)----文件的读写和随机访问 FileInputStream/FileOutputStream & RandomAccessFile
目录:系统学习 Java IO---- 目录,概览 文件输入流 FileInputStream 这是一个简单的FileInputStream示例: InputStream input = new Fi ...
- 一份关于Swift语言学习资源的整理文件
一份关于Swift语言学习资源的整理文件 周银辉 在这里下载 https://github.com/ipader/SwiftGuide
随机推荐
- $noip2018$游记+考后总结
游记部分 Day-5 - Day0 敲了敲模板,打了几场模拟赛,都在颓废,其他什么都没做 Day1 早上继续写模板,水了会QQ,其他什么都没做 中午试图背模板,没成功(其实下午才发现敲的模板一个没用上 ...
- codeforces425C
http://codeforces.com/contest/425/problem/C 题意:两数列a[],b[],进行若干轮操作,每次操作花费e, 将a的一个前缀和b的一个前缀(两前缀的最后一个数字 ...
- FOI 冬令营 Day6
目录 T1.堆(heap) 传送门 Code T2.密文(secret) 传送门 Code T3.树(tree) 传送门 Code 别问Day5到底去哪里了,咕咕咕 T1.堆(heap) 传送门 Co ...
- selenium鼠标操作
#-*- coding:utf-8 -*- import time from selenium import webdriver from selenium.webdriver.common.acti ...
- Java+Bigdata学习路线
Java+Bigdata学习路线 2019-05-28 07:04:33 @Auther:MrZhangxd STAGE 第一阶段:JAVA基础 |-第一阶段:JAVA基础 | |-可掌握的核心能力 ...
- 性能测试工具gperftools使用
https://blog.csdn.net/10km/article/details/83820080 https://blog.51cto.com/wulingdong/2043898 https: ...
- ngx.shared.DICT.incr 详解
ngx.shared.DICT.incr 原文: ngx.shared.DICT.incr syntax: newval, err, forcible? = ngx.shared.DICT:incr( ...
- LeetCode 209. 长度最小的子数组(Minimum Size Subarray Sum)
题目描述 给定一个含有 n 个正整数的数组和一个正整数 s ,找出该数组中满足其和 ≥ s 的长度最小的连续子数组.如果不存在符合条件的连续子数组,返回 0. 示例: 输入: s = 7, nums ...
- Delphi BASE64单元EncdDecd的修改
Delphi BASE64单元EncdDecd的修改 EncdDecd.pas两个函数声明: procedure EncodeStream(Input, Output: TStream);proced ...
- Android架构(一)MVP架构在Android中的实践
Android架构(一)MVP架构在Android中的实践 https://www.300168.com/yidong/show-2790.html 核心提示:为什么要重视程序的架构设计 对程序进 ...