OpenCV 5.0.0-pre
Open Source Computer Vision
Loading...
Searching...
No Matches
cv::RegionGrowing3D Class Referenceabstract

Region Growing algorithm in 3D point cloud. More...

#include <opencv2/3d/ptcloud.hpp>

Collaboration diagram for cv::RegionGrowing3D:

Public Member Functions

 RegionGrowing3D ()=default
 
virtual ~RegionGrowing3D ()=default
 
virtual void getCurvatures (OutputArray curvatures) const =0
 Get the curvature of each point if you have set.
 
virtual double getCurvatureThreshold () const =0
 Get threshold value of curvature.
 
virtual int getMaxNumberOfNeighbors () const =0
 Get the maximum number of neighbors including itself.
 
virtual int getMaxSize () const =0
 Get the maximum size of region.
 
virtual int getMinSize () const =0
 Get the minimum size of region.
 
virtual bool getNeedSort () const =0
 Get whether the results need to be sorted you have set.
 
virtual int getNumberOfRegions () const =0
 Get the maximum number of regions you want.
 
virtual void getSeeds (OutputArray seeds) const =0
 Get the seed points.
 
virtual bool getSmoothModeFlag () const =0
 Get whether to use the smoothness mode.
 
virtual double getSmoothnessThreshold () const =0
 Get threshold value of the angle between normals.
 
virtual int segment (OutputArrayOfArrays regions_idx, OutputArray labels, InputArray input_pts, InputArray normals, InputArrayOfArrays nn_idx)=0
 Execute segmentation using the Region Growing algorithm.
 
virtual void setCurvatures (InputArray curvatures)=0
 Set the curvature of each point, support vector<float> and Mat. If not, you can set it to noArray().
 
virtual void setCurvatureThreshold (double curvature_thr)=0
 
virtual void setMaxNumberOfNeighbors (int max_neighbor_num)=0
 
virtual void setMaxSize (int max_size)=0
 Set the maximum size of region.
 
virtual void setMinSize (int min_size)=0
 Set the minimum size of region.
 
virtual void setNeedSort (bool need_sort)=0
 Set whether the results need to be sorted in descending order by the number of points.
 
virtual void setNumberOfRegions (int region_num)=0
 Set the maximum number of regions you want.
 
virtual void setSeeds (InputArray seeds)=0
 
virtual void setSmoothModeFlag (bool smooth_mode)=0
 
virtual void setSmoothnessThreshold (double smoothness_thr)=0
 Set threshold value of the angle between normals, the input value is in radian.
 

Static Public Member Functions

static Ptr< RegionGrowing3Dcreate ()
 

Detailed Description

Region Growing algorithm in 3D point cloud.

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. For more details, please refer to [222].

Constructor & Destructor Documentation

◆ RegionGrowing3D()

cv::RegionGrowing3D::RegionGrowing3D ( )
default

◆ ~RegionGrowing3D()

virtual cv::RegionGrowing3D::~RegionGrowing3D ( )
virtualdefault

Member Function Documentation

◆ create()

static Ptr< RegionGrowing3D > cv::RegionGrowing3D::create ( )
static

◆ getCurvatures()

virtual void cv::RegionGrowing3D::getCurvatures ( OutputArray curvatures) const
pure virtual

Get the curvature of each point if you have set.

◆ getCurvatureThreshold()

virtual double cv::RegionGrowing3D::getCurvatureThreshold ( ) const
pure virtual

Get threshold value of curvature.

◆ getMaxNumberOfNeighbors()

virtual int cv::RegionGrowing3D::getMaxNumberOfNeighbors ( ) const
pure virtual

Get the maximum number of neighbors including itself.

◆ getMaxSize()

virtual int cv::RegionGrowing3D::getMaxSize ( ) const
pure virtual

Get the maximum size of region.

◆ getMinSize()

virtual int cv::RegionGrowing3D::getMinSize ( ) const
pure virtual

Get the minimum size of region.

◆ getNeedSort()

virtual bool cv::RegionGrowing3D::getNeedSort ( ) const
pure virtual

Get whether the results need to be sorted you have set.

◆ getNumberOfRegions()

virtual int cv::RegionGrowing3D::getNumberOfRegions ( ) const
pure virtual

Get the maximum number of regions you want.

◆ getSeeds()

virtual void cv::RegionGrowing3D::getSeeds ( OutputArray seeds) const
pure virtual

Get the seed points.

◆ getSmoothModeFlag()

virtual bool cv::RegionGrowing3D::getSmoothModeFlag ( ) const
pure virtual

Get whether to use the smoothness mode.

◆ getSmoothnessThreshold()

virtual double cv::RegionGrowing3D::getSmoothnessThreshold ( ) const
pure virtual

Get threshold value of the angle between normals.

◆ segment()

virtual int cv::RegionGrowing3D::segment ( OutputArrayOfArrays regions_idx,
OutputArray labels,
InputArray input_pts,
InputArray normals,
InputArrayOfArrays nn_idx )
pure virtual

Execute segmentation using the Region Growing algorithm.

Parameters
[out]regions_idxIndex information of all points in each region, support vector<vector<int>>, vector<Mat>.
[out]labelsThe label corresponds to the model number, 0 means it does not belong to any model, range [0, Number of final resultant models obtained]. Support vector<int> and Mat.
input_ptsOriginal point cloud, support vector<Point3f> and Mat of size Nx3/3xN.
normalsNormal of each point, support vector<Point3f> and Mat of size Nx3.
nn_idxIndex information of nearest neighbors of all points. The first nearest neighbor of each point is itself. Support vector<vector<int>>, vector<Mat> and Mat of size NxK. If the information in a row is [0, 2, 1, -5, -1, 4, 7 ... negative number] it will use only non-negative indexes until it meets a negative number or bound of this row i.e. [0, 2, 1].
Returns
Number of final resultant regions obtained by segmentation.

◆ setCurvatures()

virtual void cv::RegionGrowing3D::setCurvatures ( InputArray curvatures)
pure virtual

Set the curvature of each point, support vector<float> and Mat. If not, you can set it to noArray().

◆ setCurvatureThreshold()

virtual void cv::RegionGrowing3D::setCurvatureThreshold ( double curvature_thr)
pure virtual

Set threshold value of curvature. Default will be 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.

◆ setMaxNumberOfNeighbors()

virtual void cv::RegionGrowing3D::setMaxNumberOfNeighbors ( int max_neighbor_num)
pure virtual

Set the maximum number of neighbors want to use including itself. Setting to a non-positive number or default will use the information from nn_idx.

◆ setMaxSize()

virtual void cv::RegionGrowing3D::setMaxSize ( int max_size)
pure virtual

Set the maximum size of region.

◆ setMinSize()

virtual void cv::RegionGrowing3D::setMinSize ( int min_size)
pure virtual

Set the minimum size of region.

◆ setNeedSort()

virtual void cv::RegionGrowing3D::setNeedSort ( bool need_sort)
pure virtual

Set whether the results need to be sorted in descending order by the number of points.

◆ setNumberOfRegions()

virtual void cv::RegionGrowing3D::setNumberOfRegions ( int region_num)
pure virtual

Set the maximum number of regions you want.

◆ setSeeds()

virtual void cv::RegionGrowing3D::setSeeds ( InputArray seeds)
pure virtual

Set the seed points, it will grow according to the seeds. If noArray() is set, the default method will be used:

  1. If the curvature of each point is set, the seeds will be sorted in ascending order of curvatures.
  2. Otherwise, the natural order of the point cloud will be used.

◆ setSmoothModeFlag()

virtual void cv::RegionGrowing3D::setSmoothModeFlag ( bool smooth_mode)
pure virtual

Set whether to use the smoothness mode. Default will be 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 current neighbor.

◆ setSmoothnessThreshold()

virtual void cv::RegionGrowing3D::setSmoothnessThreshold ( double smoothness_thr)
pure virtual

Set threshold value of the angle between normals, the input value is in radian.


The documentation for this class was generated from the following file: