C++程式設計實現

看風景的薇薇發表於2020-11-07

PCL讀取ply儲存ply資料,需要新增標頭檔案。
這裡儲存的是二進位制型別ply,註釋裡是pcd資料的讀取儲存

#include <pcl/io/ply_io.h>

if (pcl::io::loadPLYFile<pcl::PointXYZ>("part1.ply", *source_cloud) == -1)
//if (pcl::io::loadPCDFile<pcl::PointXYZ>("trans_part1.pcd", *source_cloud) == -1)
	{
		PCL_ERROR("Couldn't read file sample \n");
		return (-1);
	}
	
//std::string filename("trans_part1.ply");
//pcl::PCDWriter writer;
//writer.write(filename, *transformed_cloud);

std::cerr << "Saving to ply file " << std::endl;
pcl::io::savePLYFileBinary("trans_part1_binary.ply", *transformed_cloud);

相關文章