-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Your Environment
- PCL Version:master branch
Context
pcl/segmentation/include/pcl/segmentation/supervoxel_clustering.h
Lines 328 to 336 in 89ce7c6
| /** \brief Static helper function which returns a pointcloud of normals for the input supervoxels | |
| * \param[in] supervoxel_clusters Supervoxel cluster map coming from this class | |
| * \returns Cloud of PointNormals of the supervoxels | |
| * | |
| */ | |
| static pcl::PointCloud<pcl::PointNormal>::Ptr | |
| makeSupervoxelNormalCloud (std::map<uint32_t,typename Supervoxel<PointT>::Ptr > &supervoxel_clusters); | |
Expected Behavior
Add or change a static helper function
- \ brief static helper function, return point cloud of labeled normal input voxel
- \ param [in] Supervoxel cluster map in supervoxel_clusters
- \ Back to super-voxel PointXYZLNormals cloud
Current Behavior
pcl/examples/segmentation/example_supervoxels.cpp
Lines 317 to 319 in 89ce7c6
| PointLCloudT::Ptr refined_labeled_voxel_cloud = super.getLabeledVoxelCloud (); | |
| PointNCloudT::Ptr refined_sv_normal_cloud = pcl::SupervoxelClustering<PointT>::makeSupervoxelNormalCloud (refined_supervoxel_clusters); | |
| PointLCloudT::Ptr refined_full_labeled_cloud = super.getLabeledCloud (); |
In order to facilitate the processing of the above three point cloud data, the association is generated by the following three point clouds with labels.
PointLCloudT::Ptr refined_labeled_voxel_cloud
PointLNCloudT::Ptr refined_sv_l_normal_cloud
PointLCloudT::Ptr refined_full_labeled_cloud
Possible Solution
A ideas how to implement the addition or change
pcl/segmentation/include/pcl/segmentation/supervoxel_clustering.h
Lines 328 to 336 in 89ce7c6
| /** \brief Static helper function which returns a pointcloud of normals for the input supervoxels | |
| * \param[in] supervoxel_clusters Supervoxel cluster map coming from this class | |
| * \returns Cloud of PointNormals of the supervoxels | |
| * | |
| */ | |
| static pcl::PointCloud<pcl::PointNormal>::Ptr | |
| makeSupervoxelNormalCloud (std::map<uint32_t,typename Supervoxel<PointT>::Ptr > &supervoxel_clusters); | |
Add the following function declaration at the end of the above
static pcl::PointCloudpcl::PointXYZLNormal::Ptr
makeSupervoxelXYZLNormalCloud(std::map<uint32_t, typename Supervoxel::Ptr> &supervoxel_clusters);
pcl/segmentation/include/pcl/segmentation/impl/supervoxel_clustering.hpp
Lines 609 to 623 in 89ce7c6
| ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| template <typename PointT> pcl::PointCloud<pcl::PointNormal>::Ptr | |
| pcl::SupervoxelClustering<PointT>::makeSupervoxelNormalCloud (std::map<uint32_t,typename Supervoxel<PointT>::Ptr > &supervoxel_clusters) | |
| { | |
| pcl::PointCloud<pcl::PointNormal>::Ptr normal_cloud (new pcl::PointCloud<pcl::PointNormal>); | |
| normal_cloud->resize (supervoxel_clusters.size ()); | |
| pcl::PointCloud<pcl::PointNormal>::iterator normal_cloud_itr = normal_cloud->begin (); | |
| for (auto sv_itr = supervoxel_clusters.cbegin (), sv_itr_end = supervoxel_clusters.cend (); | |
| sv_itr != sv_itr_end; ++sv_itr, ++normal_cloud_itr) | |
| { | |
| (sv_itr->second)->getCentroidPointNormal (*normal_cloud_itr); | |
| } | |
| return normal_cloud; | |
| } | |
Add the following function definition at the end of the above
template pcl::PointCloudpcl::PointXYZLNormal::Ptr
pcl::SupervoxelClustering::makeSupervoxelXYZLNormalCloud(std::map<uint32_t, typename Supervoxel::Ptr > &supervoxel_clusters)
{
***
}
pcl/examples/segmentation/example_supervoxels.cpp
Lines 20 to 29 in 89ce7c6
| // Types | |
| typedef pcl::PointXYZRGBA PointT; | |
| typedef pcl::PointCloud<PointT> PointCloudT; | |
| typedef pcl::PointNormal PointNT; | |
| typedef pcl::PointCloud<PointNT> PointNCloudT; | |
| typedef pcl::PointXYZL PointLT; | |
| typedef pcl::PointCloud<PointLT> PointLCloudT; | |
| typedef pcl::Normal NormalT; | |
| typedef pcl::PointCloud<NormalT> NormalCloudT; | |
Add the following types at the end of the above
typedef pcl::PointXYZLNormal PointLNT;
typedef pcl::PointCloud PointLNCloudT;
pcl/examples/segmentation/example_supervoxels.cpp
Lines 317 to 320 in 89ce7c6
| PointLCloudT::Ptr refined_labeled_voxel_cloud = super.getLabeledVoxelCloud (); | |
| PointNCloudT::Ptr refined_sv_normal_cloud = pcl::SupervoxelClustering<PointT>::makeSupervoxelNormalCloud (refined_supervoxel_clusters); | |
| PointLCloudT::Ptr refined_full_labeled_cloud = super.getLabeledCloud (); | |
Add the following to generate a labeled normal point cloud at the end of the above
PointLNCloudT::Ptr refined_sv_l_normal_cloud = pcl::SupervoxelClustering::makeSupervoxelXYZLNormalCloud(refined_supervoxel_clusters);
There may be some other additions or changes, such as the following
pcl/segmentation/include/pcl/segmentation/supervoxel_clustering.h
Lines 89 to 100 in 89ce7c6
| void | |
| getCentroidPointNormal (PointNormal &normal_arg) | |
| { | |
| normal_arg.x = centroid_.x; | |
| normal_arg.y = centroid_.y; | |
| normal_arg.z = centroid_.z; | |
| normal_arg.normal_x = normal_.normal_x; | |
| normal_arg.normal_y = normal_.normal_y; | |
| normal_arg.normal_z = normal_.normal_z; | |
| normal_arg.curvature = normal_.curvature; | |
| } | |