// 定义相关变量
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_ptr (new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::PointXYZ>& cloud = *cloud_ptr; //点云
//初始化点云数据PCD文件头
cloud.width = depthHeight * depthWidth;
cloud.height = ;
cloud.is_dense = false;
cloud.points.resize (cloud.width * cloud.height); //显示重建得到的点云数据
pcl::visualization::CloudViewer viewer("Cloud Viewer");
viewer.showCloud(cloud_ptr); //保存点云数据
pcl::io::savePCDFileASCII ("test_pcd.pcd", cloud);
std::cerr << "Saved " << cloud.points.size () << " data points to test_pcd.pcd." << std::endl;