PCL 编程多个点云合成

博客转载自:https://blog.csdn.net/sunboyiris/article/details/72636809

pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloudadd(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::io::loadPLYFile("000.ply", *cloud);
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud1(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::io::loadPLYFile("001.ply", *cloud1);
	
*cloudadd = *cloud + *cloud1;
pcl::io::savePLYFileBinary("test_pcd.ply", *cloudadd);
 
cloud->clear();
pcl::io::loadPLYFile("002.ply", *cloud);
*cloudadd = *cloudadd + *cloud;
 
	cloud->clear();
	pcl::io::loadPLYFile("003.ply", *cloud);
	*cloudadd = *cloudadd + *cloud;
 
	cloud->clear();
	pcl::io::loadPLYFile("004.ply", *cloud);
	*cloudadd = *cloudadd + *cloud;
 
	cloud->clear();
	pcl::io::loadPLYFile("005.ply", *cloud);
	*cloudadd = *cloudadd + *cloud;
 
	cloud->clear();
	pcl::io::loadPLYFile("006.ply", *cloud);
	*cloudadd = *cloudadd + *cloud;
 
	cloud->clear();
	pcl::io::loadPLYFile("007.ply", *cloud);
	*cloudadd = *cloudadd + *cloud;
 
	pcl::io::savePLYFileBinary("last.ply", *cloudadd);
 
	pcl::visualization::CloudViewer viewer("Cloud Viewer");
 
	viewer.showCloud(cloud);
 
	while (!viewer.wasStopped())
	{
		user_data++;
	}

  

posted @ 2018-08-14 21:27  采男孩的小蘑菇  阅读(2410)  评论(0编辑  收藏  举报