Class RegionGrowing3D
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
Region Growing algorithm in 3D point cloud.
public class RegionGrowing3D : Algorithm, IDisposable
- Inheritance
-
RegionGrowing3D
- Implements
- Inherited Members
Remarks
The key idea of region growing is to merge the nearest neighbor points that satisfy a certain angle threshold into the same region according to the normal between the two points, so as to achieve the purpose of segmentation.
Properties
- CurvatureThreshold
Threshold value of curvature. Default is 0.05. Only points with curvature less than the threshold will be considered to belong to the same region. If the curvature of each point is not set, this option will not work.
- MaxNumberOfNeighbors
The maximum number of neighbors to use including itself. Setting to a non-positive number or default will use the information from nnIdx.
- MaxSize
The maximum size of region. Setting to a non-positive number or default will be unlimited.
- MinSize
The minimum size of region. Setting to a non-positive number or default will be unlimited.
- NeedSort
Whether the results need to be sorted in descending order by the number of points.
- NumberOfRegions
The maximum number of regions you want. Setting to a non-positive number or default will be unlimited.
- SmoothModeFlag
Whether to use the smoothness mode. Default is true. If true it will check the angle between the normal of the current point and the normal of its neighbor. Otherwise, it will check the angle between the normal of the seed point and the normal of the current neighbor.
- SmoothnessThreshold
Threshold value of the angle between normals, in radian. Default is 30(degree)*PI/180.
Methods
- Create()
Creates a RegionGrowing3D object.
- GetCurvatures(OutputArray)
Gets the curvature of each point, if set.
- GetSeeds(OutputArray)
Gets the seed points.
- Segment(out int[][], OutputArray, InputArray, InputArray, InputArray)
Executes segmentation using the Region Growing algorithm.
- SetCurvatures(InputArray)
Sets the curvature of each point. If not available, pass an empty array.
- SetSeeds(InputArray)
Sets the seed points, it will grow according to the seeds. If not set (or set to an empty array), the default method will be used:
- If the curvature of each point is set, the seeds will be sorted in ascending order of curvatures.
- Otherwise, the natural order of the point cloud will be used.