Image Component Library (ICL)
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
icl::geom::FeatureGraphSegmenter Class Reference

#include <FeatureGraphSegmenter.h>

Public Types

enum  Mode { BEST, GPU, CPU }
 

Public Member Functions

 FeatureGraphSegmenter (Mode mode=BEST)
 Constructor. More...
 
 ~FeatureGraphSegmenter ()
 Destructor. More...
 
core::Img8u apply (core::DataSegment< float, 4 > xyz, const core::Img8u &edgeImg, const core::Img32f &depthImg, core::DataSegment< float, 4 > normals=NULL, bool stabelize=true, bool useROI=false, bool useCutfreeAdjacency=true, bool useCoplanarity=true, bool useCurvature=true, bool useRemainingPoints=true)
 One line call for the surface feature segmentation. More...
 
std::vector< PointCloudSegmentPtrapplyHierarchical (core::DataSegment< float, 4 > xyz, core::DataSegment< float, 4 > rgb, const core::Img8u &edgeImg, const core::Img32f &depthImg, core::DataSegment< float, 4 > normals=NULL, bool useROI=false, bool useCutfreeAdjacency=true, bool useCoplanarity=true, bool useCurvature=true, bool useRemainingPoints=true, float weightCutfreeAdjacency=1.0, float weightCoplanarity=0.9, float weightCurvature=0.8, float weightRemainingPoints=0.7)
 One line call for the hierarchical surface feature segmentation. More...
 
void setROI (float xMin, float xMax, float yMin, float yMax, float zMin, float zMax)
 Sets the ROI in world coordinates. More...
 
void setMinSurfaceSize (unsigned int size)
 Sets the minimum segment size (default 25) More...
 
void setAssignmentParams (float distance, int radius)
 Sets the edge point assignment parameters. More...
 
void setCutfreeParams (float euclideanDistance, int passes, int tolerance, float minAngle)
 Sets the cutfree adjacency feature parameters. More...
 
void setCoplanarityParams (float maxAngle, float distanceTolerance, float outlierTolerance, int numTriangles, int numScanlines)
 Sets the coplanarity feature parameters. More...
 
void setCurvatureParams (float histogramSimilarity, bool useOpenObjects, int maxDistance, bool useOccludedObjects, float maxError, int ransacPasses, float distanceTolerance, float outlierTolerance)
 Sets the curvature feature parameters. More...
 
void setRemainingPointsParams (int minSize, float euclideanDistance, int radius, float assignEuclideanDistance, int supportTolerance)
 Sets the remaining points assignment parameters. More...
 
void setGraphCutThreshold (float threshold)
 Sets the graphcut threshold. More...
 
std::vector< SurfaceFeatureExtractor::SurfaceFeaturegetSurfaceFeatures ()
 
std::vector< std::vector< int > > getSegments ()
 Returns the segment blobs. More...
 
std::vector< std::vector< int > > getSurfaces ()
 Returns the surface cluster from the pre-segmentation. More...
 
core::Img32s getLabelImage (bool stabelize)
 Returns the labeled segment image. More...
 
core::Img8u getColoredLabelImage (bool stabelize)
 Returns the colored segment image. Also returned by the apply method. More...
 
core::Img8u getMaskImage ()
 Returns the mask image. More...
 

Private Member Functions

void surfaceSegmentation (core::DataSegment< float, 4 > &xyz, const core::Img8u &edgeImg, const core::Img32f &depthImg, int minSurfaceSize=25, bool useROI=false)
 
std::vector< PointCloudSegmentPtrcreateHierarchy (math::DynMatrix< float > &probabilityMatrix, core::DataSegment< float, 4 > &xyz, core::DataSegment< float, 4 > &rgb)
 

Private Attributes

Data * m_data
 internal data type More...
 

Detailed Description

This class implements feature graph segmentation for depth images. It uses OpenCL for hardware parallelization if a compatible GPU is found.

Member Enumeration Documentation

◆ Mode

Enumerator
BEST 
GPU 
CPU 

Constructor & Destructor Documentation

◆ FeatureGraphSegmenter()

icl::geom::FeatureGraphSegmenter::FeatureGraphSegmenter ( Mode  mode = BEST)

Constructor.

Constructs an object of this class. All default parameters are set. Use setters for desired values.

Parameters
modeGPU, CPU and BEST (default)

◆ ~FeatureGraphSegmenter()

icl::geom::FeatureGraphSegmenter::~FeatureGraphSegmenter ( )

Destructor.

Member Function Documentation

◆ apply()

core::Img8u icl::geom::FeatureGraphSegmenter::apply ( core::DataSegment< float, 4 >  xyz,
const core::Img8u edgeImg,
const core::Img32f depthImg,
core::DataSegment< float, 4 >  normals = NULL,
bool  stabelize = true,
bool  useROI = false,
bool  useCutfreeAdjacency = true,
bool  useCoplanarity = true,
bool  useCurvature = true,
bool  useRemainingPoints = true 
)

One line call for the surface feature segmentation.

Parameters
xyzthe xyzh DataSegment from the PointCloudObject class
edgeImgthe edge image from the ObjectEdgeDetector class
depthImgthe input depth image
normalsthe input normals
stabelizeframe-to-frame cross-correlation to achieve stable object labels for each frame
useROItrue for 3D region of interest (set by setROI() )
useCutreeAdjacencyuse the cutfree adjacency feature
useCoplanarityuse the coplanarity feature
useCurvatureuse the curvature feature
useRemainingPointsuse the remaining points assignment
Returns
the color image of the segments

◆ applyHierarchical()

std::vector<PointCloudSegmentPtr> icl::geom::FeatureGraphSegmenter::applyHierarchical ( core::DataSegment< float, 4 >  xyz,
core::DataSegment< float, 4 >  rgb,
const core::Img8u edgeImg,
const core::Img32f depthImg,
core::DataSegment< float, 4 >  normals = NULL,
bool  useROI = false,
bool  useCutfreeAdjacency = true,
bool  useCoplanarity = true,
bool  useCurvature = true,
bool  useRemainingPoints = true,
float  weightCutfreeAdjacency = 1.0,
float  weightCoplanarity = 0.9,
float  weightCurvature = 0.8,
float  weightRemainingPoints = 0.7 
)

One line call for the hierarchical surface feature segmentation.

Parameters
xyzthe xyzh DataSegment from the PointCloudObject class
rgbthe rgba32f DataSegment from the PointCloudObject class
edgeImgthe edge image from the ObjectEdgeDetector class
depthImgthe input depth image
normalsthe input normals
useROItrue for 3D region of interest (set by setROI() )
useCutreeAdjacencyuse the cutfree adjacency feature
useCoplanarityuse the coplanarity feature
useCurvatureuse the curvature feature
useRemainingPointsuse the remaining points assignment
weightCutreeAdjacencyuse the cutfree adjacency feature
weightCoplanarityuse the coplanarity feature
weightCurvatureuse the curvature feature
weightRemainingPointsuse the remaining points assignment
Returns
the hierachical segmentation tree

◆ createHierarchy()

std::vector<PointCloudSegmentPtr> icl::geom::FeatureGraphSegmenter::createHierarchy ( math::DynMatrix< float > &  probabilityMatrix,
core::DataSegment< float, 4 > &  xyz,
core::DataSegment< float, 4 > &  rgb 
)
private

◆ getColoredLabelImage()

core::Img8u icl::geom::FeatureGraphSegmenter::getColoredLabelImage ( bool  stabelize)

Returns the colored segment image. Also returned by the apply method.

Parameters
stabelizetrue for consistent label colors.
Returns
the colored segment image

◆ getLabelImage()

core::Img32s icl::geom::FeatureGraphSegmenter::getLabelImage ( bool  stabelize)

Returns the labeled segment image.

Parameters
stabelizetrue for consistent label IDs.
Returns
the labeled segment image

◆ getMaskImage()

core::Img8u icl::geom::FeatureGraphSegmenter::getMaskImage ( )

Returns the mask image.

Returns
the mask image of the segmentation

◆ getSegments()

std::vector<std::vector<int> > icl::geom::FeatureGraphSegmenter::getSegments ( )

Returns the segment blobs.

Returns
a vector of segments. Every entry contains a vector with the surface indices

◆ getSurfaceFeatures()

std::vector<SurfaceFeatureExtractor::SurfaceFeature> icl::geom::FeatureGraphSegmenter::getSurfaceFeatures ( )

◆ getSurfaces()

std::vector<std::vector<int> > icl::geom::FeatureGraphSegmenter::getSurfaces ( )

Returns the surface cluster from the pre-segmentation.

Returns
a vector of surfaces. Every entry contains a vector with the point indices

◆ setAssignmentParams()

void icl::geom::FeatureGraphSegmenter::setAssignmentParams ( float  distance,
int  radius 
)

Sets the edge point assignment parameters.

Parameters
distancethe maximum euclidean distance between two points
radiusthe maximum radius in pixel

◆ setCoplanarityParams()

void icl::geom::FeatureGraphSegmenter::setCoplanarityParams ( float  maxAngle,
float  distanceTolerance,
float  outlierTolerance,
int  numTriangles,
int  numScanlines 
)

Sets the coplanarity feature parameters.

Parameters
maxAnglethe maximum angle between two coplanar surfaces
distanceTolerancedistance tolerance for occlusion check
outlierToleranceoutlier tolerance for occlusion check
numTrianglesnumber of triangles for common plane test
numScanlinesthe number of scanlines for occlusion check

◆ setCurvatureParams()

void icl::geom::FeatureGraphSegmenter::setCurvatureParams ( float  histogramSimilarity,
bool  useOpenObjects,
int  maxDistance,
bool  useOccludedObjects,
float  maxError,
int  ransacPasses,
float  distanceTolerance,
float  outlierTolerance 
)

Sets the curvature feature parameters.

Parameters
histogramSimilaritythe minimum similarity score for matching
useOpenObjectstest for open curved objects (e.g. a cup)
maxDistancethe maximum distance in pixel between the two surfaces
useOccludedObjectstest for occluded curved objects
maxErrorthe maximum error in mm for alignment test
ransacPassesthe number of RANSAC passes for alignment test
distanceTolerancedistance tolerance for occlusion check
outlierToleranceoutlier tolerance for occlusion check

◆ setCutfreeParams()

void icl::geom::FeatureGraphSegmenter::setCutfreeParams ( float  euclideanDistance,
int  passes,
int  tolerance,
float  minAngle 
)

Sets the cutfree adjacency feature parameters.

Parameters
euclideanDistancethe euclidean distance for RANSAC test
passesthe number of RANSAC passes
tolerancethe outlier tolerance in points for RANSAC
minAnglethe minimum angle between two adjacent surfaces

◆ setGraphCutThreshold()

void icl::geom::FeatureGraphSegmenter::setGraphCutThreshold ( float  threshold)

Sets the graphcut threshold.

Parameters
thresholdthe maximum weight of a cut

◆ setMinSurfaceSize()

void icl::geom::FeatureGraphSegmenter::setMinSurfaceSize ( unsigned int  size)

Sets the minimum segment size (default 25)

Parameters
sizeminimum segment size in points

◆ setRemainingPointsParams()

void icl::geom::FeatureGraphSegmenter::setRemainingPointsParams ( int  minSize,
float  euclideanDistance,
int  radius,
float  assignEuclideanDistance,
int  supportTolerance 
)

Sets the remaining points assignment parameters.

Parameters
minSizethe minimum size of a remaining point blob
euclideanDistancethe maximum euclidean distance for point clustering
radiusthe radius for local minima search
assignEuclideanDistancethe euclidean distance for assigning to neighbouring surfaces
supportTolerancethe max tolerance for detecting a blob as supported and therefore separate object

◆ setROI()

void icl::geom::FeatureGraphSegmenter::setROI ( float  xMin,
float  xMax,
float  yMin,
float  yMax,
float  zMin,
float  zMax 
)

Sets the ROI in world coordinates.

Parameters
xMinxMin in mm
xMaxxMax in mm
yMinyMin in mm
yMaxyMax in mm
zMinzMin in mm
zMaxzMax in mm

◆ surfaceSegmentation()

void icl::geom::FeatureGraphSegmenter::surfaceSegmentation ( core::DataSegment< float, 4 > &  xyz,
const core::Img8u edgeImg,
const core::Img32f depthImg,
int  minSurfaceSize = 25,
bool  useROI = false 
)
private

Member Data Documentation

◆ m_data

Data* icl::geom::FeatureGraphSegmenter::m_data
private

internal data type

internal data pointer


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