Class cv::RegionGrowing3D#

Region Growing algorithm in 3D point cloud. View details

Collaboration diagram for cv::RegionGrowing3D:

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 Rabbani2006SegmentationOP.

Constructor & Destructor Documentation#

RegionGrowing3D()#

cv::RegionGrowing3D::RegionGrowing3D()

~RegionGrowing3D()#

cv::RegionGrowing3D::~RegionGrowing3D()

Member Function Documentation#

create()#

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

getCurvatures()#

void cv::RegionGrowing3D::getCurvatures(OutputArray curvatures)

Get the curvature of each point if you have set.

getCurvatureThreshold()#

double cv::RegionGrowing3D::getCurvatureThreshold()

Get threshold value of curvature.

getMaxNumberOfNeighbors()#

int cv::RegionGrowing3D::getMaxNumberOfNeighbors()

Get the maximum number of neighbors including itself.

getMaxSize()#

int cv::RegionGrowing3D::getMaxSize()

Get the maximum size of region.

getMinSize()#

int cv::RegionGrowing3D::getMinSize()

Get the minimum size of region.

getNeedSort()#

bool cv::RegionGrowing3D::getNeedSort()

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

getNumberOfRegions()#

int cv::RegionGrowing3D::getNumberOfRegions()

Get the maximum number of regions you want.

getSeeds()#

void cv::RegionGrowing3D::getSeeds(OutputArray seeds)

Get the seed points.

getSmoothModeFlag()#

bool cv::RegionGrowing3D::getSmoothModeFlag()

Get whether to use the smoothness mode.

getSmoothnessThreshold()#

double cv::RegionGrowing3D::getSmoothnessThreshold()

Get threshold value of the angle between normals.

segment()#

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

Execute segmentation using the Region Growing algorithm.

Parameters

  • regions_idx — Index information of all points in each region, support vector<vector>, vector.

  • labels — The 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 and Mat.

  • input_pts — Original point cloud, support vector and Mat of size Nx3/3xN.

  • normals — Normal of each point, support vector and Mat of size Nx3.

  • nn_idx — Index information of nearest neighbors of all points. The first nearest neighbor of each point is itself. Support vector<vector>, vector 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()#

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

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

setCurvatureThreshold()#

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

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()#

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

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()#

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

Set the maximum size of region.

setMinSize()#

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

Set the minimum size of region.

setNeedSort()#

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

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

setNumberOfRegions()#

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

Set the maximum number of regions you want.

setSeeds()#

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

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()#

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

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()#

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

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

Source file#

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