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