Point Cloud Library (PCL)
1.14.1-dev
|
A segmentation algorithm partitioning a supervoxel graph. More...
#include <pcl/segmentation/cpc_segmentation.h>
Public Member Functions | |
CPCSegmentation () | |
~CPCSegmentation () override | |
void | segment () |
Merge supervoxels using cuts through local convexities. More... | |
void | setCutting (const std::uint32_t max_cuts=20, const std::uint32_t cutting_min_segments=0, const float cutting_min_score=0.16, const bool locally_constrained=true, const bool directed_cutting=true, const bool clean_cutting=false) |
Determines if we want to use cutting planes. More... | |
void | setRANSACIterations (const std::uint32_t ransac_iterations) |
Set the number of iterations for the weighted RANSAC step (best cut estimations) More... | |
Public Member Functions inherited from pcl::LCCPSegmentation< PointT > | |
LCCPSegmentation () | |
virtual | ~LCCPSegmentation () |
void | reset () |
Reset internal memory. More... | |
void | setInputSupervoxels (const std::map< std::uint32_t, typename pcl::Supervoxel< PointT >::Ptr > &supervoxel_clusters_arg, const std::multimap< std::uint32_t, std::uint32_t > &label_adjacency_arg) |
Set the supervoxel clusters as well as the adjacency graph for the segmentation.Those parameters are generated by using the SupervoxelClustering class. More... | |
void | segment () |
Merge supervoxels using local convexity. More... | |
void | relabelCloud (pcl::PointCloud< pcl::PointXYZL > &labeled_cloud_arg) |
Relabels cloud with supervoxel labels with the computed segment labels. More... | |
void | getSegmentToSupervoxelMap (std::map< std::uint32_t, std::set< std::uint32_t > > &segment_supervoxel_map_arg) const |
Get map<SegmentID, std::set<SuperVoxel IDs> > More... | |
void | getSupervoxelToSegmentMap (std::map< std::uint32_t, std::uint32_t > &supervoxel_segment_map_arg) const |
Get map<Supervoxel_ID, Segment_ID> More... | |
void | getSegmentAdjacencyMap (std::map< std::uint32_t, std::set< std::uint32_t > > &segment_adjacency_map_arg) |
Get map <SegmentID, std::set<Neighboring SegmentIDs> > More... | |
float | getConcavityToleranceThreshold () const |
Get normal threshold. More... | |
void | getSVAdjacencyList (SupervoxelAdjacencyList &adjacency_list_arg) const |
Get the supervoxel adjacency graph with classified edges (boost::adjacency_list). More... | |
void | setConcavityToleranceThreshold (float concavity_tolerance_threshold_arg) |
Set normal threshold. More... | |
void | setSmoothnessCheck (bool use_smoothness_check_arg, float voxel_res_arg, float seed_res_arg, float smoothness_threshold_arg=0.1) |
Determines if a smoothness check is done during segmentation, trying to invalidate edges of non-smooth connected edges (steps). More... | |
void | setSanityCheck (const bool use_sanity_criterion_arg) |
Determines if we want to use the sanity criterion to invalidate singular connected patches. More... | |
void | setKFactor (const std::uint32_t k_factor_arg) |
Set the value used for k convexity. More... | |
void | setMinSegmentSize (const std::uint32_t min_segment_size_arg) |
Set the value min_segment_size_ used in mergeSmallSegments. More... | |
Additional Inherited Members | |
Public Types inherited from pcl::LCCPSegmentation< PointT > | |
using | SupervoxelAdjacencyList = boost::adjacency_list< boost::setS, boost::setS, boost::undirectedS, std::uint32_t, EdgeProperties > |
using | VertexIterator = typename boost::graph_traits< SupervoxelAdjacencyList >::vertex_iterator |
using | AdjacencyIterator = typename boost::graph_traits< SupervoxelAdjacencyList >::adjacency_iterator |
using | VertexID = typename boost::graph_traits< SupervoxelAdjacencyList >::vertex_descriptor |
using | EdgeIterator = typename boost::graph_traits< SupervoxelAdjacencyList >::edge_iterator |
using | OutEdgeIterator = typename boost::graph_traits< SupervoxelAdjacencyList >::out_edge_iterator |
using | EdgeID = typename boost::graph_traits< SupervoxelAdjacencyList >::edge_descriptor |
Protected Member Functions inherited from pcl::LCCPSegmentation< PointT > | |
void | mergeSmallSegments () |
Segments smaller than min_segment_size_ are merged to the label of largest neighbor. More... | |
void | computeSegmentAdjacency () |
Compute the adjacency of the segments. More... | |
void | prepareSegmentation (const std::map< std::uint32_t, typename pcl::Supervoxel< PointT >::Ptr > &supervoxel_clusters_arg, const std::multimap< std::uint32_t, std::uint32_t > &label_adjacency_arg) |
Is called within setInputSupervoxels mainly to reserve required memory. More... | |
void | doGrouping () |
Perform depth search on the graph and recursively group all supervoxels with convex connections. More... | |
void | recursiveSegmentGrowing (const VertexID &queryPointID, const unsigned int group_label) |
Assigns neighbors of the query point to the same group as the query point. More... | |
void | calculateConvexConnections (SupervoxelAdjacencyList &adjacency_list_arg) |
Calculates convexity of edges and saves this to the adjacency graph. More... | |
void | applyKconvexity (const unsigned int k_arg) |
Connections are only convex if this is true for at least k_arg common neighbors of the two patches. More... | |
bool | connIsConvex (const std::uint32_t source_label_arg, const std::uint32_t target_label_arg, float &normal_angle) |
Returns true if the connection between source and target is convex. More... | |
Protected Attributes inherited from pcl::LCCPSegmentation< PointT > | |
float | concavity_tolerance_threshold_ {10} |
*** Parameters *** /// More... | |
bool | grouping_data_valid_ {false} |
Marks if valid grouping data (sv_adjacency_list_, sv_label_to_seg_label_map_, processed_) is available. More... | |
bool | supervoxels_set_ {false} |
Marks if supervoxels have been set by calling setInputSupervoxels. More... | |
bool | use_smoothness_check_ {false} |
Determines if the smoothness check is used during segmentation. More... | |
float | smoothness_threshold_ {0.1} |
Two supervoxels are unsmooth if their plane-to-plane distance DIST > (expected_distance + smoothness_threshold_*voxel_resolution_). More... | |
bool | use_sanity_check_ {false} |
Determines if we use the sanity check which tries to find and invalidate singular connected patches. More... | |
float | seed_resolution_ {0.0f} |
Seed resolution of the supervoxels (used only for smoothness check) More... | |
float | voxel_resolution_ {0.0f} |
Voxel resolution used to build the supervoxels (used only for smoothness check) More... | |
std::uint32_t | k_factor_ {0} |
Factor used for k-convexity. More... | |
std::uint32_t | min_segment_size_ {0} |
Minimum segment size. More... | |
std::map< std::uint32_t, bool > | processed_ |
Stores which supervoxel labels were already visited during recursive grouping. More... | |
SupervoxelAdjacencyList | sv_adjacency_list_ |
Adjacency graph with the supervoxel labels as nodes and edges between adjacent supervoxels. More... | |
std::map< std::uint32_t, typename pcl::Supervoxel< PointT >::Ptr > | sv_label_to_supervoxel_map_ |
map from the supervoxel labels to the supervoxel objects More... | |
std::map< std::uint32_t, std::uint32_t > | sv_label_to_seg_label_map_ |
Storing relation between original SuperVoxel Labels and new segmantion labels. More... | |
std::map< std::uint32_t, std::set< std::uint32_t > > | seg_label_to_sv_list_map_ |
map Segment Label to a set of Supervoxel Labels More... | |
std::map< std::uint32_t, std::set< std::uint32_t > > | seg_label_to_neighbor_set_map_ |
map < SegmentID, std::set< Neighboring segment labels> > More... | |
A segmentation algorithm partitioning a supervoxel graph.
It uses planar cuts induced by local concavities for the recursive segmentation. Cuts are estimated using locally constrained directed RANSAC.
Definition at line 66 of file cpc_segmentation.h.
|
default |
|
overridedefault |
void pcl::CPCSegmentation< PointT >::segment |
Merge supervoxels using cuts through local convexities.
The input parameters are generated by using the SupervoxelClustering class. To retrieve the output use the relabelCloud method.
Definition at line 51 of file cpc_segmentation.hpp.
|
inline |
Determines if we want to use cutting planes.
[in] | max_cuts | Maximum number of cuts |
[in] | cutting_min_segments | Minimum segment size for cutting |
[in] | cutting_min_score | Minimum score a proposed cut has to achieve for being performed |
[in] | locally_constrained | Decide if we constrain our cuts locally |
[in] | directed_cutting | Decide if we prefer cuts perpendicular to the edge-direction |
[in] | clean_cutting | Decide if we cut only edges with supervoxels on opposite sides of the plane (clean) or all edges within the seed_resolution_ distance to the plane (not clean). The later was used in the paper. |
Definition at line 107 of file cpc_segmentation.h.
|
inline |
Set the number of iterations for the weighted RANSAC step (best cut estimations)
[in] | ransac_iterations | The number of iterations |
Definition at line 125 of file cpc_segmentation.h.