Point Cloud Library: Point cloud not displaying in the cloud viewer

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Point Cloud Library: Point cloud not displaying in the cloud viewer

shibujrm
This post was updated on .
I have a point cloud which I need to display in the PCL Visulaizer viewer.
The header of the point cloud in .pcd format is:

    # .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

*Code to read and view this pcd file:*

    #include <iostream>
    #include <pcl/io/io.h>
    #include <pcl/io/pcd_io.h>
    #include <pcl/visualization/cloud_viewer.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;
    }

This code works for all the other point cloud and successfully renders the
point cloud in the viewer. But it fails for this specific point cloud file.
Please help to let me know what is wrong with this point cloud file?
The point cloud .pcd file is attached with this post.




--
Thanks & Regards,
Jeyaram Shibu S

_______________________________________________
PCL-users@pointclouds.org / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


building_6_Cloud.pcd (375K) <http://www.pcl-users.org/attachment/4046233/0/building_6_Cloud.pcd>
Reply | Threaded
Open this post in threaded view
|

Re: Point Cloud Library: Point cloud not displaying in the cloud viewer

Fabien Rozar
Hello,

The initial line of code you provided was not good, and I wonder if 
you have take a look at the tutorial section of the PCL project.

By the way, to wrote a code example which allow you to llok at your
point cloud at this address:

Cheers,
frozar

Le lun. 11 juin 2018 à 07:41, Jeyaram Shibu S <[hidden email]> a écrit :
I have a point cloud which I need to display in the PCL Visulaizer viewer. The header of the point cloud in .pcd format is: 

    # .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

Code to read and view this pcd file:

    #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;
    }

This code works for all the other point cloud and successfully renders the point cloud in the viewer. But it fails for this specific point cloud file. Please help to let me know what is wrong with this point cloud file? 
The point cloud .pcd file is attached with this post.




--
Thanks & Regards,
Jeyaram Shibu S

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Point Cloud Library: Point cloud not displaying in the cloud viewer

shibujrm
Thanks fo the reply.

Yes  I have indeed watched the tutorials and tried using cloud viewer as
well as PCL visualizer. I am able to visualize all the other point clouds I
have tried to view using either of these viewers.
But only this point cloud is not displayed in the viewer. I am unable to
find the problem with this point cloud.



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Point Cloud Library: Point cloud not displaying in the cloud viewer

Fabien Rozar
The point cloud you provide is not center around the origin.

Everything is done at:
Cheers
Frozar

Le mar. 12 juin 2018 15:28, shibujrm <[hidden email]> a écrit :
Thanks fo the reply.

Yes  I have indeed watched the tutorials and tried using cloud viewer as
well as PCL visualizer. I am able to visualize all the other point clouds I
have tried to view using either of these viewers.
But only this point cloud is not displayed in the viewer. I am unable to
find the problem with this point cloud.



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users