1.pcd文件——rabbit.pcd
新建项目pcl
rabbit.pcd 和pcl.cpp在同一目录下
2.读取文件
(1)显示数据
#include#include#include
int main(int argc, char**argv) {
//创建了一个名为cloud的指针,储存XYZ类型的点云数据
pcl::PointCloud<:pointxyz>::Ptr cloud(new pcl::PointCloud<:pointxyz>);//
//*打开点云文件
if (pcl::io::loadPCDFile<:pointxyz>("rabbit.pcd", *cloud) == -1) {
PCL_ERROR("Couldn't read file rabbit.pcd\n");return(-1);
}
std::cout<< "Loaded:" << cloud->width*cloud->height<points.size(); ++i) {
std::cout<< " " << cloud->points[i].x << " " << cloud->points[i].y << " " << cloud->points[i].z << " " <<:endl>
}
system("pa