ravi
ravi

Reputation: 6328

Increase point size of point cloud in PCL for visualization

I am visualizing two point clouds inside PCL Visualizer. Below is the code snippet:

#include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>

int main (int argc, char** argv)
{
    pcl::visualization::PCLVisualizer viewer("Cloud Viewer");

    pcl::PointCloud<pcl::PointXYZRGBA>::Ptr face (new pcl::PointCloud<pcl::PointXYZRGBA>);
    pcl::io::loadPCDFile ("face.pcd", *face);

    pcl::PointCloud<pcl::PointXYZ>::Ptr nose (new pcl::PointCloud<pcl::PointXYZ>);
    pcl::io::loadPCDFile ("nose.pcd", *nose);

    viewer.addPointCloud(face,"face");
    viewer.addPointCloud(nose, "nose");
    
    viewer.spin();
    return 0;
}

I want to increase the point size of the nose point cloud. Please note that pressing + key increases the point size for the complete window.

Upvotes: 1

Views: 6201

Answers (1)

Gabriel Devillers
Gabriel Devillers

Reputation: 4002

From the pcl visualizer example <-- updated-link:

viewer.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud name");

With 1 being the size of the points.

Upvotes: 10

Related Questions