pcd格式点云的读取与显示

#include
#include
#include
#include


int main(int argc, char** argv)
{
pcl::PointCloud::Ptr cloud(new pcl::PointCloud);
if (pcl::io::loadPCDFile("F:\\pclstudying\\table_scene_lms400.pcd",*cloud)==-1)//*cloud,指针的内容是文件内容,记得标明点云类型
{
PCL_ERROR("Couldn't read file test_pcd.pcd\n");//pcl有专门的报错函数PCL_ERROR
return(-1);
}
pcl::visualization::CloudViewer viewer("pcd viewer");//给显示窗口命名,CloudViewer
viewer.showCloud(cloud);//定义要显示的对象,showCloud
system("pause");//此处防止显示闪退
return(0);
}

你可能感兴趣的:(点云)