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

#include <PointCloudNormalEstimator.h>

Inheritance diagram for icl::geom::PointCloudNormalEstimator:
icl::utils::Uncopyable

Public Member Functions

 PointCloudNormalEstimator (utils::Size size)
 Create new PointCloudNormalEstimator with given internal image size. More...
 
virtual ~PointCloudNormalEstimator ()
 Destructor. More...
 
const core::Img8ucalculate (const core::Img32f &depthImage, bool filter, bool average, bool gauss)
 One call function for calculation of the complete processingpipeline. More...
 
void setDepthImage (const core::Img32f &depthImg)
 Sets the input depth image (input for median filter). More...
 
void applyMedianFilter ()
 Calculates a filtered image using a median filter. More...
 
const core::Img32fgetFilteredDepthImage ()
 Returns the filtered depth image. More...
 
void setFilteredDepthImage (const core::Img32f &filteredImg)
 Sets the (filtered) depth image (input for normal calculation) More...
 
void applyNormalCalculation ()
 Calculates the point normals. More...
 
void applyTemporalNormalAveraging ()
 Recalculates the normals by temporal averaging within a given time window. More...
 
void applyGaussianNormalSmoothing ()
 Recalculates the normals by gaussian smoothing in a given range. More...
 
const VecgetNormals ()
 Returns the Pointer to the normals. More...
 
void applyWorldNormalCalculation (const Camera &cam)
 Transforms the normals to the world space and calculates normal image. More...
 
const VecgetWorldNormals ()
 Returns the point normals in world space. More...
 
const core::Img8ugetRGBNormalImage ()
 Returns the RGB normal image. More...
 
void setNormals (Vec *pNormals)
 Sets the point normals (input for angle image calculation). More...
 
void applyAngleImageCalculation ()
 Calculates the angle image. More...
 
const core::Img32fgetAngleImage ()
 Returns the angle image. More...
 
void setAngleImage (const core::Img32f &angleImg)
 Sets the angle image (input for image binarization). More...
 
void applyImageBinarization ()
 Binarizes the angle image to detect edges. More...
 
const core::Img8ugetBinarizedAngleImage ()
 Returns the binarized angle image (final output). More...
 
void setMedianFilterSize (int size)
 Sets the mask size for applyMedianFilter() More...
 
void setNormalCalculationRange (int range)
 Sets the range for applyNormalCalculation(). More...
 
void setNormalAveragingRange (int range)
 Sets the averaging range for applyNormalAveraging() More...
 
void setAngleNeighborhoodMode (int mode)
 Sets the neighborhood mode for applyAngleImageCalculation() More...
 
void setAngleNeighborhoodRange (int range)
 Sets the neighborhood range for applyAngleImageCalculation() More...
 
void setBinarizationThreshold (float threshold)
 Sets the binarization threshold for applyImageBinarization(). More...
 
void setUseCL (bool use)
 Sets openCL enabled/disabled. Enabling has no effect if no openCL. More...
 
void setUseNormalAveraging (bool use)
 Sets normal averaging enabled/disabled. More...
 
void setUseGaussSmoothing (bool use)
 Sets normal averaging by gauss smoothing enabled/disabled. More...
 
bool isCLReady ()
 Returns the openCL status. More...
 
bool isCLActive ()
 Returns the openCL activation status. More...
 

Private Attributes

Data * m_data
 internal data type More...
 

Additional Inherited Members

- Protected Member Functions inherited from icl::utils::Uncopyable
 Uncopyable ()
 Empty base constructor. More...
 

Detailed Description

Utility class for point cloud normal and depth-edge estimation This class is a normal estimator and edge detector for depth images. It uses OpenCL for hardware parallelization if a compatible GPU is found. Given an input depth image, it computes 3D normals to obtain a binarized image that describes edges in the depth image. The implementation does not use a straight forward implementation that would try to use common linear filters to compute depth image edges. Instead, a point-wise normal image to measure high local curvature is computed. large angles of neighbored point normals indicate high local curvature. The resulting binary image provides well formed information for further point cloud processing steps such as segmentation.

Internal Information

All intermediate results (such as the point normal image) can be accessed externally. In addition also setter functions for intermediate results can be used if these are obtained from another source. By these means, also only parts of the processing pipeline can be used

Detailed Description of the Processing Pipeline

TODO Andre?

  1. input depth image
  2. median filtering
  3. edge sensitive temporal smoothing
  4. normal estimation
  5. gaussian normal smoothing
  6. ... ???

Constructor & Destructor Documentation

◆ PointCloudNormalEstimator()

icl::geom::PointCloudNormalEstimator::PointCloudNormalEstimator ( utils::Size  size)

Create new PointCloudNormalEstimator with given internal image size.

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

Parameters
sizesize of the input depth image

◆ ~PointCloudNormalEstimator()

virtual icl::geom::PointCloudNormalEstimator::~PointCloudNormalEstimator ( )
virtual

Destructor.

Member Function Documentation

◆ applyAngleImageCalculation()

void icl::geom::PointCloudNormalEstimator::applyAngleImageCalculation ( )

Calculates the angle image.

The mode is set by setAngleNeighborhoodMode(int mode). The range is set by setAngleNeighborhoodRange(int range)

◆ applyGaussianNormalSmoothing()

void icl::geom::PointCloudNormalEstimator::applyGaussianNormalSmoothing ( )

Recalculates the normals by gaussian smoothing in a given range.

Alternative to applyTemporalNormalAveraging that uses a simpler gaussian filter for smoothing

if it is enabled width setUseNormalAveraging(bool use). The range is set by setNormalAveragingRange(int range). Alternative: normalAveraging() with setUseGaussSmoothing(false).

◆ applyImageBinarization()

void icl::geom::PointCloudNormalEstimator::applyImageBinarization ( )

Binarizes the angle image to detect edges.

The threshold is set by setBinarizationThreshold(float threshold).

◆ applyMedianFilter()

void icl::geom::PointCloudNormalEstimator::applyMedianFilter ( )

Calculates a filtered image using a median filter.

The mask size is set by setMedianFilterSize(int size)

◆ applyNormalCalculation()

void icl::geom::PointCloudNormalEstimator::applyNormalCalculation ( )

Calculates the point normals.

The range for calculation is set by setNormalCalculationRange(int range).

◆ applyTemporalNormalAveraging()

void icl::geom::PointCloudNormalEstimator::applyTemporalNormalAveraging ( )

Recalculates the normals by temporal averaging within a given time window.

This reduces the noise of the normal image. The function is called from calculateNormals() if it is enabled width setUseNormalAveraging(bool use). The range is set by setNormalAveragingRange(int range).
Alternative: normalGaussSmoothing() with setUseGaussSmoothing(true).

◆ applyWorldNormalCalculation()

void icl::geom::PointCloudNormalEstimator::applyWorldNormalCalculation ( const Camera cam)

Transforms the normals to the world space and calculates normal image.

Parameters
camthe camera of the depth image

◆ calculate()

const core::Img8u& icl::geom::PointCloudNormalEstimator::calculate ( const core::Img32f depthImage,
bool  filter,
bool  average,
bool  gauss 
)

One call function for calculation of the complete processingpipeline.

Order: ((filter)->normals->(normalAvg)->angles->binarization)

Parameters
depthImagethe input depth image
filterenable/disable filtering
averageenable/disable normal averaging
gausstrue=gauss smoothing, false=linear smoothing
Returns
the binarized angle image

◆ getAngleImage()

const core::Img32f& icl::geom::PointCloudNormalEstimator::getAngleImage ( )

Returns the angle image.

Returns
the angle image

◆ getBinarizedAngleImage()

const core::Img8u& icl::geom::PointCloudNormalEstimator::getBinarizedAngleImage ( )

Returns the binarized angle image (final output).

Returns
the (final) binarized angle image

◆ getFilteredDepthImage()

const core::Img32f& icl::geom::PointCloudNormalEstimator::getFilteredDepthImage ( )

Returns the filtered depth image.

Returns
the filtered depth image

◆ getNormals()

const Vec* icl::geom::PointCloudNormalEstimator::getNormals ( )

Returns the Pointer to the normals.

Returns
the point normals

◆ getRGBNormalImage()

const core::Img8u& icl::geom::PointCloudNormalEstimator::getRGBNormalImage ( )

Returns the RGB normal image.

Returns
the RGB normal image

◆ getWorldNormals()

const Vec* icl::geom::PointCloudNormalEstimator::getWorldNormals ( )

Returns the point normals in world space.

Returns
the point normals in world space

◆ isCLActive()

bool icl::geom::PointCloudNormalEstimator::isCLActive ( )

Returns the openCL activation status.

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

Returns
openCL enabled/disabled

◆ isCLReady()

bool icl::geom::PointCloudNormalEstimator::isCLReady ( )

Returns the openCL status.

(true=openCL context ready, false=no openCL context available)

Returns
openCL context ready/unavailable

◆ setAngleImage()

void icl::geom::PointCloudNormalEstimator::setAngleImage ( const core::Img32f angleImg)

Sets the angle image (input for image binarization).

This call is not necessary if angleImageCalculation() is executed before.

Parameters
angleImgthe angle image

◆ setAngleNeighborhoodMode()

void icl::geom::PointCloudNormalEstimator::setAngleNeighborhoodMode ( int  mode)

Sets the neighborhood mode for applyAngleImageCalculation()

0=max, 1=mean. (default 0)

Parameters
modethe neighborhood mode

◆ setAngleNeighborhoodRange()

void icl::geom::PointCloudNormalEstimator::setAngleNeighborhoodRange ( int  range)

Sets the neighborhood range for applyAngleImageCalculation()

(default 3, min 1)

Parameters
rangethe neighborhood range

◆ setBinarizationThreshold()

void icl::geom::PointCloudNormalEstimator::setBinarizationThreshold ( float  threshold)

Sets the binarization threshold for applyImageBinarization().

Value n for acos(n). A value of 0 maps to 90 degree, a value of 1 maps to o degree (default 0.89)

Parameters
thresholdbinarization threshold

◆ setDepthImage()

void icl::geom::PointCloudNormalEstimator::setDepthImage ( const core::Img32f depthImg)

Sets the input depth image (input for median filter).

Parameters
depthImgthe input depth image

◆ setFilteredDepthImage()

void icl::geom::PointCloudNormalEstimator::setFilteredDepthImage ( const core::Img32f filteredImg)

Sets the (filtered) depth image (input for normal calculation)

This call is not necessary if medianFilter() is executed before

Parameters
filteredImgthe (filtered) depth image

◆ setMedianFilterSize()

void icl::geom::PointCloudNormalEstimator::setMedianFilterSize ( int  size)

Sets the mask size for applyMedianFilter()

size n corresponds to mask size n x n. (default 3, min 3, max 9, odd only)

Parameters
sizethe mask size

◆ setNormalAveragingRange()

void icl::geom::PointCloudNormalEstimator::setNormalAveragingRange ( int  range)

Sets the averaging range for applyNormalAveraging()

(default 1)

Parameters
rangethe normal averaging range

◆ setNormalCalculationRange()

void icl::geom::PointCloudNormalEstimator::setNormalCalculationRange ( int  range)

Sets the range for applyNormalCalculation().

(default 2)

Parameters
rangethe normal calculation range

◆ setNormals()

void icl::geom::PointCloudNormalEstimator::setNormals ( Vec pNormals)

Sets the point normals (input for angle image calculation).

This call is not necessary if normalCalculation() is executed before.

Parameters
pNormalsthe point normals

◆ setUseCL()

void icl::geom::PointCloudNormalEstimator::setUseCL ( bool  use)

Sets openCL enabled/disabled. Enabling has no effect if no openCL.

context is available. (default true=enabled)

Parameters
useenable/disable openCL

◆ setUseGaussSmoothing()

void icl::geom::PointCloudNormalEstimator::setUseGaussSmoothing ( bool  use)

Sets normal averaging by gauss smoothing enabled/disabled.

(default false=linear smoothing if normal averaging enabled)

Parameters
useenable/disable gauss smoothing

◆ setUseNormalAveraging()

void icl::geom::PointCloudNormalEstimator::setUseNormalAveraging ( bool  use)

Sets normal averaging enabled/disabled.

(default true=enabled)

Parameters
useenable/disable normal averaging

Member Data Documentation

◆ m_data

Data* icl::geom::PointCloudNormalEstimator::m_data
private

internal data type

internal data pointer


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