点云库:点云未在云查看器中显示

时间:2018-06-10 07:44:27

标签: point-cloud-library

我有一个点云,我需要在PCL Visulaizer查看器中显示。 .pcd格式的点云标题为:

# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS Classification Return_Number Number_of_Returns Scan_Direction Scan_Angle_Rank rgb x y z _
SIZE 4 4 4 4 4 4 4 4 4 1
TYPE F F F F F F F F F U
COUNT 1 1 1 1 1 1 1 1 1 4
WIDTH 31415
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 31415
DATA binary

读取和查看此pcd文件的代码:

#include <iostream>
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>

int 
main ()
{
    pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGB>);
    pcl::io::loadPCDFile ("my_point_cloud.pcd", *cloud);

      std::cout << "Loaded "
                << cloud->width * cloud->height
                << " data points from test_pcd.pcd with the following fields: "
                << std::endl;

    pcl::visualization::CloudViewer viewer("Cloud Viewer");
    viewer.showCloud(cloud);

    while (!viewer.wasStopped ())
    {

    }
    return 0;
}

此代码适用于所有其他点云,并在查看器中成功呈现点云。但是这个特定的点云文件失败了。请帮忙告诉我这个点云文件有什么问题?

0 个答案:

没有答案