Display#

Principle#

While debugging, it is interesting to be able to see what is done, being clouds or features.
Following functions allow basic visualization, while giving the process to show more.

Cloud viewer (One viewport)#

Two clouds can be seen in one viewport, for comparison purpose, thanks to :

1/**
2* @brief Display two clouds of same type on same viewport
3* @tparam PointT Should be a pcl::PointXYZxxx
4* @param cloud1 First cloud to show
5* @param cloud2 Second cloud to show
6* @param verbose If has to output debug on console
7*/
8template <typename PointT>
9void showTwoCloudsSameVP(typename pcl::PointCloud<PointT>::Ptr& cloud1, typename pcl::PointCloud<PointT>::Ptr& cloud2, bool verbose = false);

And can be used as :

1showTwoCloudsSameVP<pcl::PointXYZ>(baseCloud, compCloud);
Viewer (same viewport)

Two clouds in viewer (same viewport)#

Cloud viewer (two viewports)#

Two clouds can be seen in two viewports, for side by side comparison, thanks to :

1/**
2* @brief Display two clouds of same type in separated view pors
3* @tparam PointT Should be a pcl::PointXYZxxx
4* @param cloud1 First cloud to show
5* @param cloud2 Second cloud to show
6* @param verbose If has to output debug on console
7*/
8template <typename PointT>
9void showTwoCloudsSeparated(typename pcl::PointCloud<PointT>::Ptr& cloud1, typename pcl::PointCloud<PointT>::Ptr& cloud2, bool verbose = false);

And can be used as :

1showTwoCloudsSeparated<pcl::PointXYZ>(baseCloud, compCloud);
Viewer (same viewport)

Two clouds in viewer (two viewports)#

Cloud viewer with normals#

A cloud and its normals can be seen thanks to :

1/**
2* @brief Show a cloud with its normals
3* @tparam PointT Should be a pcl::PointXYZxxx
4* @param cloud Cloud to display
5* @param normals Normals of cloud
6* @param verbose If has to output debug on console
7*/
8template <typename PointT>
9void showCloudWithNormals(typename pcl::PointCloud<PointT>::Ptr& cloud, pcl::PointCloud<pcl::Normal>::Ptr& normals, bool verbose = false);

And can be used as :

1showCloudWithNormals<pcl::PointXYZ>(cloud, normals);
Normals viewer

One cloud and its normals#

Correspondences viewer#

Two clouds with their correspondences can be displayed thanks to :

 1/**
 2* @brief Show two clouds with drawn correspondences as lines
 3* @tparam PointT Should be a pcl::PointXYZxxx
 4* @param c1 Source cloud to display
 5* @param c2 Target cloud to display
 6* @param corresp Correspondences to draw lines from
 7* @param verbose If has to output debug on console
 8*/
 9template <typename PointT>
10void showTwoCloudWithCorresp(typename pcl::PointCloud<PointT>::Ptr& c1, typename pcl::PointCloud<PointT>::Ptr& c2, pcl::Correspondences& corresp, bool verbose = false);

And can be used as :

1showTwoCloudWithCorresp<pcl::PointXYZ>(compCloud, baseCloud, correspondences);

BEWARE : do not invert the source cloud and the target cloud. They must be in the same order as the one used to determine correspondences, else an error will raise.

Normals viewer

Two clouds and found correspondences#

Features histogram viewer#

To compare two features histograms, following function can be used :

1/**
2* @brief Plot features on histogram
3* @tparam SignatureT Type of feature signature
4* @param feat1 First feature to show
5* @param feat2 Second feature to show
6* @param verbose If has to output debug on console
7*/
8template <typename SignatureT>
9void featuresViewer(typename pcl::PointCloud<SignatureT>::Ptr& feat1, typename pcl::PointCloud<SignatureT>::Ptr& feat2, bool verbose = false);

And can be used as :

1featuresViewer<pcl::FPFHSignature33>(compcloud_features, basecloud_features);
Features histogram viewer

Features histogram viewer#

Algorithm 3D Algorithm PCL Point Cloud