Use pcl::ConditionalEuclideanClustering class: is a segmentation algorithm based on Euclidean distance and user-defined conditional clustering points.
This class uses the same greedy algorithm/area growth/flood-filling approach with,,, and the advantage of this class over other classes is that it can customize constraints for clustering (pure Euclidean, smoothness, RGB) users . There are some shortcomings: no inital seeding system, no over-and under-segmentation control, and the fact that...
theory
Description of conditional_euclidean_clustering.cpp: