Image Component Library (ICL)
|
#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< PointCloudSegmentPtr > | 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. 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::SurfaceFeature > | getSurfaceFeatures () |
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< PointCloudSegmentPtr > | createHierarchy (math::DynMatrix< float > &probabilityMatrix, core::DataSegment< float, 4 > &xyz, core::DataSegment< float, 4 > &rgb) |
Private Attributes | |
Data * | m_data |
internal data type More... | |
This class implements feature graph segmentation for depth images. It uses OpenCL for hardware parallelization if a compatible GPU is found.
Constructor.
Constructs an object of this class. All default parameters are set. Use setters for desired values.
mode | GPU, CPU and BEST (default) |
icl::geom::FeatureGraphSegmenter::~FeatureGraphSegmenter | ( | ) |
Destructor.
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.
xyz | the xyzh DataSegment from the PointCloudObject class |
edgeImg | the edge image from the ObjectEdgeDetector class |
depthImg | the input depth image |
normals | the input normals |
stabelize | frame-to-frame cross-correlation to achieve stable object labels for each frame |
useROI | true for 3D region of interest (set by setROI() ) |
useCutreeAdjacency | use the cutfree adjacency feature |
useCoplanarity | use the coplanarity feature |
useCurvature | use the curvature feature |
useRemainingPoints | use the remaining points assignment |
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.
xyz | the xyzh DataSegment from the PointCloudObject class |
rgb | the rgba32f DataSegment from the PointCloudObject class |
edgeImg | the edge image from the ObjectEdgeDetector class |
depthImg | the input depth image |
normals | the input normals |
useROI | true for 3D region of interest (set by setROI() ) |
useCutreeAdjacency | use the cutfree adjacency feature |
useCoplanarity | use the coplanarity feature |
useCurvature | use the curvature feature |
useRemainingPoints | use the remaining points assignment |
weightCutreeAdjacency | use the cutfree adjacency feature |
weightCoplanarity | use the coplanarity feature |
weightCurvature | use the curvature feature |
weightRemainingPoints | use the remaining points assignment |
|
private |
core::Img8u icl::geom::FeatureGraphSegmenter::getColoredLabelImage | ( | bool | stabelize | ) |
Returns the colored segment image. Also returned by the apply method.
stabelize | true for consistent label colors. |
core::Img32s icl::geom::FeatureGraphSegmenter::getLabelImage | ( | bool | stabelize | ) |
Returns the labeled segment image.
stabelize | true for consistent label IDs. |
core::Img8u icl::geom::FeatureGraphSegmenter::getMaskImage | ( | ) |
Returns the mask image.
std::vector<std::vector<int> > icl::geom::FeatureGraphSegmenter::getSegments | ( | ) |
Returns the segment blobs.
std::vector<SurfaceFeatureExtractor::SurfaceFeature> icl::geom::FeatureGraphSegmenter::getSurfaceFeatures | ( | ) |
std::vector<std::vector<int> > icl::geom::FeatureGraphSegmenter::getSurfaces | ( | ) |
Returns the surface cluster from the pre-segmentation.
void icl::geom::FeatureGraphSegmenter::setAssignmentParams | ( | float | distance, |
int | radius | ||
) |
Sets the edge point assignment parameters.
distance | the maximum euclidean distance between two points |
radius | the maximum radius in pixel |
void icl::geom::FeatureGraphSegmenter::setCoplanarityParams | ( | float | maxAngle, |
float | distanceTolerance, | ||
float | outlierTolerance, | ||
int | numTriangles, | ||
int | numScanlines | ||
) |
Sets the coplanarity feature parameters.
maxAngle | the maximum angle between two coplanar surfaces |
distanceTolerance | distance tolerance for occlusion check |
outlierTolerance | outlier tolerance for occlusion check |
numTriangles | number of triangles for common plane test |
numScanlines | the number of scanlines for occlusion check |
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.
histogramSimilarity | the minimum similarity score for matching |
useOpenObjects | test for open curved objects (e.g. a cup) |
maxDistance | the maximum distance in pixel between the two surfaces |
useOccludedObjects | test for occluded curved objects |
maxError | the maximum error in mm for alignment test |
ransacPasses | the number of RANSAC passes for alignment test |
distanceTolerance | distance tolerance for occlusion check |
outlierTolerance | outlier tolerance for occlusion check |
void icl::geom::FeatureGraphSegmenter::setCutfreeParams | ( | float | euclideanDistance, |
int | passes, | ||
int | tolerance, | ||
float | minAngle | ||
) |
Sets the cutfree adjacency feature parameters.
euclideanDistance | the euclidean distance for RANSAC test |
passes | the number of RANSAC passes |
tolerance | the outlier tolerance in points for RANSAC |
minAngle | the minimum angle between two adjacent surfaces |
void icl::geom::FeatureGraphSegmenter::setGraphCutThreshold | ( | float | threshold | ) |
Sets the graphcut threshold.
threshold | the maximum weight of a cut |
void icl::geom::FeatureGraphSegmenter::setMinSurfaceSize | ( | unsigned int | size | ) |
Sets the minimum segment size (default 25)
size | minimum segment size in points |
void icl::geom::FeatureGraphSegmenter::setRemainingPointsParams | ( | int | minSize, |
float | euclideanDistance, | ||
int | radius, | ||
float | assignEuclideanDistance, | ||
int | supportTolerance | ||
) |
Sets the remaining points assignment parameters.
minSize | the minimum size of a remaining point blob |
euclideanDistance | the maximum euclidean distance for point clustering |
radius | the radius for local minima search |
assignEuclideanDistance | the euclidean distance for assigning to neighbouring surfaces |
supportTolerance | the max tolerance for detecting a blob as supported and therefore separate object |
void icl::geom::FeatureGraphSegmenter::setROI | ( | float | xMin, |
float | xMax, | ||
float | yMin, | ||
float | yMax, | ||
float | zMin, | ||
float | zMax | ||
) |
Sets the ROI in world coordinates.
xMin | xMin in mm |
xMax | xMax in mm |
yMin | yMin in mm |
yMax | yMax in mm |
zMin | zMin in mm |
zMax | zMax in mm |
|
private |
|
private |
internal data type
internal data pointer