Skip to content

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 :

/**
* @brief Display two clouds of same type on same viewport
* @tparam PointT Should be a pcl::PointXYZxxx
* @param cloud1 First cloud to show
* @param cloud2 Second cloud to show
* @param verbose If has to output debug on console
*/
template <typename PointT>
void showTwoCloudsSameVP(typename pcl::PointCloud<PointT>::Ptr& cloud1, typename pcl::PointCloud<PointT>::Ptr& cloud2, bool verbose = false);
And can be used as :
showTwoCloudsSameVP<pcl::PointXYZ>(baseCloud, compCloud);

Viewer (same viewport)
Figure 1: Viewer (same viewport)

Cloud viewer (two viewports)

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

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

And can be used as :

showTwoCloudsSeparated<pcl::PointXYZ>(baseCloud, compCloud);

Viewer (same viewport)
Figure 2: Viewer (same viewport)

Cloud viewer with normals

A cloud and its normals can be seen thanks to :

/**
* @brief Show a cloud with its normals
* @tparam PointT Should be a pcl::PointXYZxxx
* @param cloud Cloud to display
* @param normals Normals of cloud
* @param verbose If has to output debug on console
*/
template <typename PointT>
void showCloudWithNormals(typename pcl::PointCloud<PointT>::Ptr& cloud, pcl::PointCloud<pcl::Normal>::Ptr& normals, bool verbose = false);
And can be used as :
showCloudWithNormals<pcl::PointXYZ>(cloud, normals);

Normals viewer
Figure 3: Normals viewer

Correspondences viewer

Two clouds with their correspondences can be displayed thanks to :

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

And can be used as :

showTwoCloudWithCorresp<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(img/correspview.png)

Features histogram viewer

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

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

And can be used as :

featuresViewer<pcl::FPFHSignature33>(compcloud_features, basecloud_features);

Features histogram viewer
Figure 4: Features histogram viewer