1 #include <pcl/visualization/cloud_viewer.h>
4 #include <pcl/io/pcd_io.h>
5 #include <pcl/features/integral_image_normal.h>
11 pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
12 pcl::io::loadPCDFile ("table_scene_mug_stereo_textured.pcd", *cloud);
15 pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>);
17 pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal> ne;
18 ne.setNormalEstimationMethod (ne.AVERAGE_3D_GRADIENT);
19 ne.setMaxDepthChangeFactor(0.02f);
20 ne.setNormalSmoothingSize(10.0f);
21 ne.setInputCloud(cloud);
25 pcl::visualization::PCLVisualizer viewer("PCL Viewer");
26 viewer.setBackgroundColor (0.0, 0.0, 0.5);
27 viewer.addPointCloudNormals<pcl::PointXYZ,pcl::Normal>(cloud, normals);
29 while (!viewer.wasStopped ())