-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvis_single_pointcloud.cpp
44 lines (36 loc) · 1.84 KB
/
vis_single_pointcloud.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//----------------------------------------------------------------------
/*!\file
*
* \author Matthias Holoch <[email protected]>
* \date 2014-12-26
*
*/
//----------------------------------------------------------------------
#include "Digest.hpp"
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/io/pcd_io.h>
int main(int argc, char** argv) {
Digest::Cloud::Ptr pointcloud(new Digest::Cloud);
Digest::Parameters params;
// Load pointcloud
pcl::io::loadPCDFile(argv[1], *pointcloud);
Digest digest(pointcloud, params);
pcl::visualization::PCLVisualizer vis("Single Cloud Digest Visualization");
vis.setBackgroundColor(0,0,0);
// Add the reduced pointcloud
vis.addPointCloud<Digest::PointType>(digest.getReducedCloud(), "reduced_cloud");
vis.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "reduced_cloud");
// Add the normals of the reduced pointcloud
vis.addPointCloudNormals<Digest::PointType, Digest::NormalType>(digest.getReducedCloud(), digest.getNormalCloud(), 1, 0.13, "reduced_cloud_normals");
// Add all keypoints with bigger dots, colored by their intensity
pcl::visualization::PointCloudColorHandlerGenericField<Digest::KeypointType> keypointColorHandler(digest.getKeypointCloud(), "intensity");
vis.addPointCloud<Digest::KeypointType>(digest.getKeypointCloud(), keypointColorHandler, "keypoint_cloud");
vis.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 6, "keypoint_cloud");
// Add the Keypoints which are above the threshold again , in another color
vis.addPointCloud<Digest::PointType>(digest.getDescriptorCloudPoints(), "descriptor_cloud_points");
vis.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 4, "descriptor_cloud_points");
while (!vis.wasStopped()) {
vis.spinOnce(100);
}
return 0;
}