PCD文件的简单可视化

首先写c++文件

#include 
#include 
#include 
#include 
int main()
 {
     
   pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
   pcl::io::loadPCDFile ("/home/liu/Desktop/aternative/Marketplace.pcd", *cloud);
   pcl::visualization::CloudViewer viewer ("Simple Cloud Viewer");
   viewer.showCloud (cloud);
   while (!viewer.wasStopped ())
   {
     
   }
   return 0;
 }

在写cmakelists文件

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

project(cloud_viewer)

find_package(PCL 1.2 REQUIRED)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_executable (visualization_simple visualization_simple.cpp)
target_link_libraries (visualization_simple ${PCL_LIBRARIES})

你可能感兴趣的:(PCL)