PCL编程->三维彩色点云显示


三维彩色点云显示PCL库有两种方式

pcl::PointCloud::Ptr cloud(new pcl::PointCloud); // 创建点云(指针)  
	
	if(pcl::io::loadPLYFile("cartman.ply", *cloud) == -1)
	//if (pcl::io::loadPLYFile("2012-Jun-28_17.44.05.966.ply", *cloud) == -1) //* 读入PCD格式的文件,如果文件不存在,返回-1  
	{
		PCL_ERROR("Couldn't read file test_pcd.pcd \n"); //文件不存在时,返回错误,终止程序。  
		return (-1);
	}

	//一个面显示
	pcl::visualization::CloudViewer viewer("Viewer");
	viewer.showCloud(cloud);
	while (!viewer.wasStopped())
	{
	}

PCL编程->三维彩色点云显示_第1张图片

你可能感兴趣的:(PCL编程)