[segmentation] "Implement ConditionalRegionGrowing class" #4826
Labels
kind: request
Type of issue
module: segmentation
needs: feedback
Specify why not closed/merged yet
status: triage
Labels incomplete
Is your feature request related to a problem? Please describe.
I am encountering a problem when using the
RegionGrowing
class. In my code I use this class to segment a point cloud into regions which are then projected to a fitted plane so hulls can be created around the regions using theConcaveHull
class. My problem occurs when a region consist of points which are not closely spatially clustered.In that case, the region found is not intuitively a region in general and the fitted plane does not accurately describe the region.
This problem happens when for example:
The camera on my robot sees a part of its leg.
There are not a lot of points on the leg (less then the number of neighbors) so the region grower considers points at the ground to be in the same region as well.
Now the ground plane is not one consistent region and the region consisting of both the ground and the leg is not intuitively a region.
Context
I wanted to solve this using the
ConditionalEuclideanClustering
class, where I would set the custom condition to check for normal vectors within a certain threshold and the distance between the points to be within a certain range. This is not an neat solution however as the eclidean clustering considers every point added to a region as a seed to continue growing the region from. The region growing algorithm has an additional check based on curvature to decide which points should become seeds to continue growing the region from. Because of this I am not able to create an identical implementation with distance constraint.Expected behavior
I would like to be able to use a
ConditionalRegionGrowing
class, which, similar to theConditionalEuclideanClustering
class, allows the user to set a condition function to evaluate when deciding if a point should be added to the region, and one to evaluate when deciding if a point should become a seed.Current Behavior
The
ConditionalEuclideanClustering
has no way to make certain points seeds and other not. All points are seeds by default.Describe the solution you'd like
A New class
ConditionalRegionGrowing
which inherits fromPCLBase
with (in short) the following public member functionsConditionalEuclideanClustering(...)
... set / get SearchMethod(...)
void setIncludeConditionFunction(..)
void setSeedConditionFunction(..)
... set / get MinClusterSize(...)
... set / get MaxClusterSize(...)
void extract(...)
... set / get InputNormals()
... set / get NumberOfNeighbours()
.. getColoredCloud()
.. getColoredCloudRGBA()
.. getSegmentFromPoint ()
Describe alternatives you've considered
Creating an implementation identical to the region growing algorithm using the
ConditionalEuclideanClustering
class.Tuning the number of neighbours and the curvature threshold to make this occur less often. This is not an optimal solution as the problem can still occur and this can also make the regions found undesirable.
Additional context
In the screenshots below the regions of the point cloud have all been colored differently, invalid regions are not visualized.
When the hulls are visualized too they are visualized with colored cubes, the color does not necessarily match that of the region.
The problem with the edge of a step up a stair and the ground plane (with hulls visualized
The problem with part of the robot's leg and a part of a step up a stair (with hulls visualized)
The problem with part of the robot's leg and a part of a step up a stair (without hulls visualized)
The text was updated successfully, but these errors were encountered: