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

#include <EuclideanBlobSegmenter.h>

Public Types

enum  Mode { BEST, GPU, CPU }
 

Public Member Functions

 EuclideanBlobSegmenter (Mode mode=BEST)
 Constructor. More...
 
 ~EuclideanBlobSegmenter ()
 Destructor. More...
 
core::Img8u apply (core::DataSegment< float, 4 > xyz, const core::Img8u &edgeImg, const core::Img32f &depthImg, bool stabelize=true, bool useROI=false)
 One line call for the support plane and blobs segmentation. More...
 
void setROI (float xMin, float xMax, float yMin, float yMax, float zMin, float zMax)
 Sets the ROI in world coordinates. More...
 
void setMinClusterSize (unsigned int size)
 Sets the minimum segment size (default 25) More...
 
void setRansacParams (float distance, int passes, int subset)
 Sets the RANSAC parameters for the support plane extraction. More...
 
void setBLOBSeuclDistance (int distance)
 Sets the minimum euclidean distance of blobs. 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...
 
std::vector< std::vector< int > > getSurfaces ()
 Returns the surface cluster from the pre-segmentation. More...
 
std::vector< std::vector< int > > getBlobs ()
 Returns the segment blobs. More...
 

Private Member Functions

void regionGrow (bool useROI)
 
void blobSegmentation (bool useROI)
 
void regionGrowBlobs ()
 

Private Attributes

Data * m_data
 internal data type More...
 

Detailed Description

This class implements blob segmentation for depth images. It uses OpenCL for hardware parallelization if a compatible GPU is found. The input is a depth image, a binarized edge image from the ObjectEdgeDetector class and the xyz DataSegment from the PointCloudObject class. The output is a color image (e.g. as input for setColorsFromImage() method of the PointCloudObject class).

Member Enumeration Documentation

◆ Mode

Enumerator
BEST 
GPU 
CPU 

Constructor & Destructor Documentation

◆ EuclideanBlobSegmenter()

icl::geom::EuclideanBlobSegmenter::EuclideanBlobSegmenter ( 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)

◆ ~EuclideanBlobSegmenter()

icl::geom::EuclideanBlobSegmenter::~EuclideanBlobSegmenter ( )

Destructor.

Member Function Documentation

◆ apply()

core::Img8u icl::geom::EuclideanBlobSegmenter::apply ( core::DataSegment< float, 4 >  xyz,
const core::Img8u edgeImg,
const core::Img32f depthImg,
bool  stabelize = true,
bool  useROI = false 
)

One line call for the support plane and blobs segmentation.

Parameters
xyzthe xyzh DataSegment from the PointCloudObject class
edgeImgthe edge image from the ObjectEdgeDetector class
depthImgthe input depth image
stabelizeframe-to-frame cross-correlation to achieve the same object labels for each frame
useROItrue for 3D region of interest (set by setROI() )
Returns
the color image of the segments

◆ blobSegmentation()

void icl::geom::EuclideanBlobSegmenter::blobSegmentation ( bool  useROI)
private

◆ getBlobs()

std::vector<std::vector<int> > icl::geom::EuclideanBlobSegmenter::getBlobs ( )

Returns the segment blobs.

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

◆ getColoredLabelImage()

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

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

Returns
the colored segment image

◆ getLabelImage()

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

Returns the labeled segment image.

Returns
the labeled segment image

◆ getSurfaces()

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

Returns the surface cluster from the pre-segmentation.

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

◆ regionGrow()

void icl::geom::EuclideanBlobSegmenter::regionGrow ( bool  useROI)
private

◆ regionGrowBlobs()

void icl::geom::EuclideanBlobSegmenter::regionGrowBlobs ( )
private

◆ setBLOBSeuclDistance()

void icl::geom::EuclideanBlobSegmenter::setBLOBSeuclDistance ( int  distance)

Sets the minimum euclidean distance of blobs.

Parameters
distancethe minimum euclidean distance for blob segmentation

◆ setMinClusterSize()

void icl::geom::EuclideanBlobSegmenter::setMinClusterSize ( unsigned int  size)

Sets the minimum segment size (default 25)

Parameters
sizeminimum segment size in points

◆ setRansacParams()

void icl::geom::EuclideanBlobSegmenter::setRansacParams ( float  distance,
int  passes,
int  subset 
)

Sets the RANSAC parameters for the support plane extraction.

Parameters
distancemaximum distance between point and plane
passesnumber of RANSAC passes
usedsubset of points (e.g. 2 for every second point)

◆ setROI()

void icl::geom::EuclideanBlobSegmenter::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

Member Data Documentation

◆ m_data

Data* icl::geom::EuclideanBlobSegmenter::m_data
private

internal data type

internal data pointer


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