Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
icl::geom::Segmentation3D Class Reference

#include <Segmentation3D.h>

List of all members.

Public Member Functions

 Segmentation3D (utils::Size size)
 Constructor.
 ~Segmentation3D ()
 Destructor.
core::Img8u segmentation (DataSegment< float, 4 > xyz, const core::Img8u &edgeImg, const core::Img32f &depthImg)
 One line call for the complex segmentation using probabilitstic surface composition.
core::Img8u segmentationBlobs (DataSegment< float, 4 > xyz, const core::Img8u &edgeImg, const core::Img32f &depthImg)
 One line call for the simple support plane and blobs segmentation.
void setUseCL (bool use)
 Sets openCL enabled/disabled. Enabling has no effect if no openCL context is available. (default true=enabled)
void setUseROI (bool use)
 Sets ROI enabled/disabled. (default false=disabled)
void setROI (float xMin, float xMax, float yMin, float yMax)
 Sets the ROI in world coordinates.
void setMinClusterSize (unsigned int size)
 Sets the minimum cluster size for region growing (default 25)
void setUseFastGrowing (bool use)
 Sets fast growing enabled/disabled. Fast growing uses the region detector, normal growing uses classical region growing. (default false=disabled)
void setAssignmentRadius (int radius)
 Sets the assignment radius for the edge point assignment after region growing. (default 5)
void setAssignmentMaxDistance (float maxDistance)
 Sets the maximum distance for the edge point assignment after region growing. (default 15)
void setRANSACeuclDistance (int distance)
 Sets the maximum euclidean distance for RANSAC. (default 15)
void setRANSACpasses (int passes)
 Sets the RANSAC passes (default 20)
void setRANSACtolerance (int tolerance)
 Sets the RANSAC tolerance for the cutfree neighbours calculation. (default 30)
void setRANSACsubset (int subset)
 Sets the subset for the RANSAC check (every n-th point). (default 2)
void setBLOBSeuclDistance (int distance)
 Sets the minimum euclidean BLOB distance for remaining points or the blob segmentation.
bool isCLReady ()
 Returns the openCL status (true=openCL context ready, false=no openCL context available)
bool isCLActive ()
 Returns the openCL activation status (true=openCL enabled, false=openCL disabled). The status can be set by setUseCL(bool use).
core::Img8u getSegmentColorImage ()
 Returns the color segment image. (Use one line calls)
std::vector< std::vector< int > > getCluster ()
 Returns the cluster.
std::vector< std::vector< int > > getBlobs ()
 Returns the blobs of the complex segmentation.
math::DynMatrix< bool > getNeigboursMatrix ()
 Returns the boolean neighbourhood matrix.
math::DynMatrix< float > getProbabilityMatrix ()
 Returns the probability matrix.
void setXYZH (DataSegment< float, 4 > xyz)
 Sets the xyzh DataSegment from the PointCloudObject class. (Use one line calls)
void setEdgeImage (const core::Img8u &edgeImage)
 Sets the edge image from the PointNormalEstimation class. (Use one line calls)
void setDepthImage (const core::Img32f &depth)
 Sets the depth image.
void clearData ()
 Clears the data. Must be called before every iteration. (Use one line calls)
void regionGrow ()
 Region growing. (Use one line calls)
void calculatePointAssignmentAndAdjacency ()
 Calculates the edge point assignment and the neighbourhood matrix. (Use one line calls)
void calculateCutfreeMatrix ()
 Calculates the cutfree neighbouring cluster. (Use one line calls)
void greedyComposition ()
 Greedy composition with probability matrix. (Use one line calls)
void calculateRemainingPoints ()
 Calculates the assignment of the remaining points. (Use one line calls)
void blobSegmentation ()
 Calculates the blob segmentation (support plane and blobs). (Use one line calls)
void colorPointcloud ()
 Calculates the color segment image. (Use one line calls)

Private Member Functions

void checkNeighbourGrayThreshold (int x, int y, int zuw, int threshold, std::vector< int > *data)
void checkNeighbourDistanceRemaining (int x, int y, int zuw, std::vector< int > *data)
void regionGrowBlobs ()
void checkNeighbourDistance (int x, int y, int zuw, std::vector< int > *data)
bool checkNotExist (int zw, std::vector< int > &nb)
float dist3 (const Vec &a, const Vec &b)

Private Attributes

int w
int h
int dim
utils::Size s
float xMinROI
float xMaxROI
float yMinROI
float yMaxROI
bool useROI
bool * elements
int * assignment
int * assignmentRemaining
bool * elementsBlobs
int * assignmentBlobs
DataSegment< float, 4 > xyzData
core::Img8u normalEdgeImage
core::Img32f depthImage
core::Img8u segmentColorImage
std::vector< std::vector< int > > cluster
std::vector< std::vector< int > > blobs
unsigned int minClusterSize
bool useFastGrowing
int assignmentRadius
float assignmentMaxDistance
int RANSACeuclDistance
int RANSACpasses
int RANSACtolerance
int RANSACsubset
int BLOBSeuclDistance
math::DynMatrix< bool > neighbours
math::DynMatrix< bool > cutfree
math::DynMatrix< float > probabilities
cv::RegionDetectorregion
bool clReady
bool useCL

Detailed Description

This class includes segmentation algorithms 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 PointNormalEstimation 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).


Constructor & Destructor Documentation

Constructor.

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

Parameters:
sizesize of the input data

Destructor.


Member Function Documentation

Calculates the blob segmentation (support plane and blobs). (Use one line calls)

Calculates the cutfree neighbouring cluster. (Use one line calls)

Calculates the edge point assignment and the neighbourhood matrix. (Use one line calls)

Calculates the assignment of the remaining points. (Use one line calls)

void icl::geom::Segmentation3D::checkNeighbourDistance ( int  x,
int  y,
int  zuw,
std::vector< int > *  data 
) [private]
void icl::geom::Segmentation3D::checkNeighbourDistanceRemaining ( int  x,
int  y,
int  zuw,
std::vector< int > *  data 
) [private]
void icl::geom::Segmentation3D::checkNeighbourGrayThreshold ( int  x,
int  y,
int  zuw,
int  threshold,
std::vector< int > *  data 
) [private]
bool icl::geom::Segmentation3D::checkNotExist ( int  zw,
std::vector< int > &  nb 
) [private]

Clears the data. Must be called before every iteration. (Use one line calls)

Calculates the color segment image. (Use one line calls)

float icl::geom::Segmentation3D::dist3 ( const Vec a,
const Vec b 
) [private]
std::vector<std::vector<int> > icl::geom::Segmentation3D::getBlobs ( )

Returns the blobs of the complex segmentation.

Returns:
a vector of blobs. Every entry contains a vector with the cluster indices
std::vector<std::vector<int> > icl::geom::Segmentation3D::getCluster ( )

Returns the cluster.

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

Returns the boolean neighbourhood matrix.

Returns:
the neighbourhood/adjacency matrix

Returns the probability matrix.

Returns:
returns the probability matrix for cluster composition

Returns the color segment image. (Use one line calls)

Returns:
the color segment image

Greedy composition with probability matrix. (Use one line calls)

Returns the openCL activation status (true=openCL enabled, false=openCL disabled). The status can be set by setUseCL(bool use).

Returns:
openCL enabled/disabled

Returns the openCL status (true=openCL context ready, false=no openCL context available)

Returns:
openCL context ready/unavailable

Region growing. (Use one line calls)

core::Img8u icl::geom::Segmentation3D::segmentation ( DataSegment< float, 4 >  xyz,
const core::Img8u edgeImg,
const core::Img32f depthImg 
)

One line call for the complex segmentation using probabilitstic surface composition.

Parameters:
xyzthe xyzh DataSegment from the PointCloudObject class
edgeImgthe edge image from the PointNormalEstimation class
depthImgthe input depth image
Returns:
the color image of the segments
core::Img8u icl::geom::Segmentation3D::segmentationBlobs ( DataSegment< float, 4 >  xyz,
const core::Img8u edgeImg,
const core::Img32f depthImg 
)

One line call for the simple support plane and blobs segmentation.

Parameters:
xyzthe xyzh DataSegment from the PointCloudObject class
edgeImgthe edge image from the PointNormalEstimation class
depthImgthe input depth image
Returns:
the color image of the segments

Sets the maximum distance for the edge point assignment after region growing. (default 15)

Parameters:
maxDistancemaximum distance in mm

Sets the assignment radius for the edge point assignment after region growing. (default 5)

radius the assignment radius in points

Sets the minimum euclidean BLOB distance for remaining points or the blob segmentation.

Parameters:
distancethe minimum euclidean distance for blob segmentation

Sets the depth image.

Parameters:
depththe depth image

Sets the edge image from the PointNormalEstimation class. (Use one line calls)

Parameters:
edgeImagethe edge image
void icl::geom::Segmentation3D::setMinClusterSize ( unsigned int  size)

Sets the minimum cluster size for region growing (default 25)

Parameters:
sizeminimum cluster size in points

Sets the maximum euclidean distance for RANSAC. (default 15)

Parameters:
distancethe maximum euclidean distance for RANSAC in mm

Sets the RANSAC passes (default 20)

Parameters:
passesthe RANSAC passes

Sets the subset for the RANSAC check (every n-th point). (default 2)

Parameters:
subsetthe point subset for RANSAC

Sets the RANSAC tolerance for the cutfree neighbours calculation. (default 30)

Parameters:
tolerancethe tolerance in points
void icl::geom::Segmentation3D::setROI ( float  xMin,
float  xMax,
float  yMin,
float  yMax 
)

Sets the ROI in world coordinates.

Parameters:
xMinxMin in mm
xMaxxMax in mm
yMinyMin in mm
yMaxyMax in mm

Sets openCL enabled/disabled. Enabling has no effect if no openCL context is available. (default true=enabled)

Parameters:
useenable/disable openCL

Sets fast growing enabled/disabled. Fast growing uses the region detector, normal growing uses classical region growing. (default false=disabled)

Parameters:
useenable/disable fast growing

Sets ROI enabled/disabled. (default false=disabled)

Parameters:
useenable/disable ROI

Sets the xyzh DataSegment from the PointCloudObject class. (Use one line calls)

Parameters:
xyzthe xyz DataSegment

Member Data Documentation

std::vector<std::vector<int> > icl::geom::Segmentation3D::blobs [private]
std::vector<std::vector<int> > icl::geom::Segmentation3D::cluster [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines