1.2-Visualization
代码链接
https://github.com/DoubleYuanL/PCL_Tutorial2-1.1.1-read_pcd_image.git
github中附带CMakeLists.txt文件
在窗口显示一张点云图
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/visualization/cloud_viewer.h>
int
main(int argc, char *argv[])
{
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGB>);
if (pcl::io::loadPCDFile<pcl::PointXYZRGB>(argv[1], *cloud) == -1)
{
std::cout << "Cloud reading failed." << std::endl; return (-1);
}
std::cout << cloud->width << cloud->height << std::endl;
for (size_t i = 0; i < cloud->points.<