PCL
pcl::ATrousWaveletTransform Class Reference

Discrete isotropic à trous wavelet transform. More...

#include <ATrousWaveletTransform.h>

+ Inheritance diagram for pcl::ATrousWaveletTransform:

Classes

struct  WaveletScalingFunction
 The scaling function of a wavelet transform. More...
 

Public Types

using layer = RedundantMultiscaleTransform::layer
 
using layer_state_set = RedundantMultiscaleTransform::layer_state_set
 
using transform = RedundantMultiscaleTransform::transform
 
- Public Types inherited from pcl::RedundantMultiscaleTransform
using layer = Image
 
using layer_state_set = GenericVector< bool >
 
using transform = Array< layer >
 

Public Member Functions

 ATrousWaveletTransform ()=default
 
 ATrousWaveletTransform (ATrousWaveletTransform &&)=default
 
 ATrousWaveletTransform (const ATrousWaveletTransform &)=default
 
 ATrousWaveletTransform (const KernelFilter &f, int n=4, int d=0)
 
 ATrousWaveletTransform (const SeparableFilter &f, int n=4, int d=0)
 
 ATrousWaveletTransform (const WaveletScalingFunction &f, int n=4, int d=0)
 
virtual ~ATrousWaveletTransform ()
 
double NoiseKSigma (int j, const ImageVariant &image, float low=0.00002F, float high=0.99998F, float k=3, float eps=0.01, int n=10, size_type *N=nullptr) const
 
double NoiseKSigma (int j=0, float k=3, float eps=0.01, int n=10, size_type *N=nullptr) const
 
double NoiseMRS (const ImageVariant &image, const float sj[], double sigma=0, float k=3, size_type *N=nullptr, float low=0.00002F, float high=0.99998F) const
 
ATrousWaveletTransformoperator= (ATrousWaveletTransform &&)=default
 
ATrousWaveletTransformoperator= (const ATrousWaveletTransform &)=default
 
const WaveletScalingFunctionScalingFunction () const
 
void SetScalingFunction (const KernelFilter &f)
 
void SetScalingFunction (const SeparableFilter &f)
 
void SetScalingFunction (const WaveletScalingFunction &f)
 
- Public Member Functions inherited from pcl::RedundantMultiscaleTransform
 RedundantMultiscaleTransform (const RedundantMultiscaleTransform &x)
 
 RedundantMultiscaleTransform (int n=4, int d=0)
 
 RedundantMultiscaleTransform (RedundantMultiscaleTransform &&)=default
 
 ~RedundantMultiscaleTransform () override
 
void BiasLayer (int i, float k)
 
void DeleteLayer (int i)
 
void DisableLayer (int i, bool disable=true)
 
void EnableLayer (int i, bool enable=true)
 
int FilterSize (int j) const
 
bool IsLayer (int i) const
 
bool IsLayerEnabled (int i) const
 
layerLayer (int i)
 
const layerLayer (int i) const
 
int NumberOfLayers () const
 
RedundantMultiscaleTransformoperator= (const RedundantMultiscaleTransform &x)
 
RedundantMultiscaleTransformoperator= (RedundantMultiscaleTransform &&)=default
 
layeroperator[] (int i)
 
const layeroperator[] (int i) const
 
virtual transform ReleaseTransform ()
 
virtual void Reset ()
 
int ScalingSequence () const
 
void SetDyadicScalingSequence ()
 
void SetLinearScalingSequence (int d=1)
 
void SetNumberOfLayers (int n)
 
void SetScalingSequence (int d)
 
- Public Member Functions inherited from pcl::BidirectionalImageTransformation
 BidirectionalImageTransformation ()=default
 
 BidirectionalImageTransformation (const BidirectionalImageTransformation &)=default
 
 ~BidirectionalImageTransformation () override
 
template<class P >
const GenericImage< P > & operator<< (const GenericImage< P > &image)
 
const ImageVariantoperator<< (const ImageVariant &image)
 
- Public Member Functions inherited from pcl::ImageTransformation
 ImageTransformation ()=default
 
 ImageTransformation (const ImageTransformation &)=default
 
virtual ~ImageTransformation ()
 
template<class P >
GenericImage< P > & operator>> (GenericImage< P > &image) const
 
ImageVariantoperator>> (ImageVariant &image) const
 
- Public Member Functions inherited from pcl::ParallelProcess
 ParallelProcess ()=default
 
 ParallelProcess (const ParallelProcess &)=default
 
virtual ~ParallelProcess ()
 
void DisableParallelProcessing (bool disable=true) noexcept
 
void EnableParallelProcessing (bool enable=true, int maxProcessors=0) noexcept
 
bool IsParallelProcessingEnabled () const noexcept
 
int MaxProcessors () const noexcept
 
ParallelProcessoperator= (const ParallelProcess &)=default
 
void SetMaxProcessors (int maxProcessors) noexcept
 
void Swap (ParallelProcess &process) noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from pcl::RedundantMultiscaleTransform
void Apply (pcl::ComplexImage &) const override
 
void Apply (pcl::DComplexImage &) const override
 
void Apply (pcl::DImage &) const override
 
void Apply (pcl::Image &) const override
 
void Apply (pcl::UInt16Image &) const override
 
void Apply (pcl::UInt32Image &) const override
 
void Apply (pcl::UInt8Image &) const override
 

Detailed Description

The Isotropic Undecimated Wavelet Transform, also known as starlet transform or à trous (with holes) wavelet transform, produces a coefficient set {w1,w2,...,wN,cN}, where each wj is a set of zero-mean coefficients at scale j, which we call detail layer, and cN is a large-scale smoothed residual, which we call residual layer. Each layer has the same dimensions as the input image, hence the transform is redundant.

The wavelet function in the à trous algorithm is the difference between the values of a scaling function F at two successive scales. Using the dyadic scaling sequence, the wavelet function can be represented as (F(x) - F(x/2)). The scaling function F can be any positive low-pass filter.

The reconstruction algorithm consists of the sum of all wj detail layers for 1 <= j <= N, plus the residual layer cN.

References

  • Jean-Luc Starck, Fionn Murtagh, Mario Bertero, Handbook of Mathematical Methods in Imaging, ch. 34, Starlet Transform in Astronomical Data Processing, Springer, 2011, pp. 1489-1531.
  • Starck, J.-L., Murtagh, F. and J. Fadili, A., Sparse Image and Signal Processing: Wavelets, Curvelets, Morphological Diversity, Cambridge University Press, 2010.
  • Starck, J.-L., Murtagh, F., Astronomical Image and Data Analysis, Springer, 2002.
  • Jean-Luc Starck, Fionn Murtagh, Albert Bijaoui, Image processing and Data Analysis: The Multiscale Approach, Cambridge University Press, 1998.

Implementation

In our implementation, each layer in a wavelet transform is a floating-point image with the same dimensions as the transformed image. Layers are indexed from 0 to N. Layers at indexes from 0 to N-1 are detail layers, whose elements are actually wavelet difference coefficients. Pixels in a detail layer can be negative, zero or positive real values.

The last layer, at index N, is the large-scale residual layer. Pixels in the residual layer image can only be positive or zero real values.

Note
The StarletTransform class is an alias for ATrousWaveletTransform.

Definition at line 123 of file ATrousWaveletTransform.h.

Member Typedef Documentation

◆ layer

Represents a wavelet layer.

Definition at line 130 of file ATrousWaveletTransform.h.

◆ layer_state_set

Represents a set of layer enabled/disabled states.

Definition at line 140 of file ATrousWaveletTransform.h.

◆ transform

Represents a set of wavelet layers, or wavelet transform.

Definition at line 135 of file ATrousWaveletTransform.h.

Constructor & Destructor Documentation

◆ ATrousWaveletTransform() [1/6]

pcl::ATrousWaveletTransform::ATrousWaveletTransform ( )
default

Default constructor.

Note
This constructor yields an uninitialized instance that cannot be used prior to initializing it with a reference to a filter object (either KernelFilter or SeparableFilter), which will be used as the scaling function of the wavelet transform.

◆ ATrousWaveletTransform() [2/6]

pcl::ATrousWaveletTransform::ATrousWaveletTransform ( const WaveletScalingFunction f,
int  n = 4,
int  d = 0 
)
inline

Constructs an ATrousWaveletTransform instance using the specified scaling function.

Parameters
fA wavelet scaling function that can be either a non-separable filter (KernelFilter) or a separable filter (SeparableFilter).
nNumber of wavelet layers. The transform will consist of n wavelet layers plus a residual layer, i.e. n+1 total layers.
dScaling sequence. If d <= 0, the transform will use the dyadic sequence: 1, 2, 4, ... 2^i. If d > 0, its value is the distance in pixels between two successive scales.

The default values for n and d are 4 and 0, respectively (four wavelet layers and the dyadic scaling sequence).

Definition at line 356 of file ATrousWaveletTransform.h.

◆ ATrousWaveletTransform() [3/6]

pcl::ATrousWaveletTransform::ATrousWaveletTransform ( const KernelFilter f,
int  n = 4,
int  d = 0 
)
inline

Constructs an ATrousWaveletTransform instance that uses a non-separable kernel filter as a scaling function.

Parameters
fNon-separable filter that will be used as the scaling function of the transform. Must be a positive, low-pass filter function.
nNumber of wavelet layers. The transform will consist of n wavelet layers plus a residual layer, i.e. n+1 total layers.
dScaling sequence. If d <= 0, the transform will use the dyadic sequence: 1, 2, 4, ... 2^i. If d > 0, its value is the distance in pixels between two successive scales.

The default values for n and d are 4 and 0, respectively (four wavelet layers and the dyadic scaling sequence).

Definition at line 381 of file ATrousWaveletTransform.h.

◆ ATrousWaveletTransform() [4/6]

pcl::ATrousWaveletTransform::ATrousWaveletTransform ( const SeparableFilter f,
int  n = 4,
int  d = 0 
)
inline

Constructs an ATrousWaveletTransform instance that uses a separable kernel filter as a scaling function.

Parameters
fSeparable filter that will be used as the scaling function of the transform. Must be a positive, low-pass filter function.
nNumber of wavelet layers. The transform will consist of n wavelet layers plus a residual layer, i.e. n+1 total layers.
dScaling sequence. If d <= 0, the transform will use the dyadic sequence: 1, 2, 4, ... 2^i. If d > 0, its value is the distance in pixels between two successive scales.

The default values for n and d are 4 and 0, respectively (four wavelet layers and the dyadic scaling sequence).

Definition at line 405 of file ATrousWaveletTransform.h.

◆ ATrousWaveletTransform() [5/6]

pcl::ATrousWaveletTransform::ATrousWaveletTransform ( const ATrousWaveletTransform )
default

Copy constructor.

◆ ATrousWaveletTransform() [6/6]

pcl::ATrousWaveletTransform::ATrousWaveletTransform ( ATrousWaveletTransform &&  )
default

Move constructor.

◆ ~ATrousWaveletTransform()

virtual pcl::ATrousWaveletTransform::~ATrousWaveletTransform ( )
inlinevirtual

Destroys this ATrousWaveletTransform object. All existing wavelet layers and the internal scaling function filter object are destroyed and deallocated.

Definition at line 427 of file ATrousWaveletTransform.h.

Member Function Documentation

◆ NoiseKSigma() [1/2]

double pcl::ATrousWaveletTransform::NoiseKSigma ( int  j,
const ImageVariant image,
float  low = 0.00002F,
float  high = 0.99998F,
float  k = 3,
float  eps = 0.01,
int  n = 10,
size_type N = nullptr 
) const

Estimation of the standard deviation of the noise, assuming a Gaussian noise distribution, for a specified range of pixel values.

This routine implements essentially the same algorithm as its unbounded counterpart:

NoiseKSigma( int j, float k, float eps, int n, size_type* N ).

The difference is that this version allows you to specify a valid range of pixel values with the low, high and image parameters. The standard deviation of the noise will only be computed for those pixels whose values in the specified image pertain to the range (low,high), that is, for every pixel with value v in image such that the condition low < v < high is true.

The specified image must be compatible with the wavelet transform. In particular, the dimensions of image must be identical to those of the wavelet layers in this transform; otherwise an Error exception will be thrown. For selection of pixels within the specified range, only the currently selected channel in image will be taken into account. Normally, the specified image must be the same image that was used to compute the current wavelet decomposition in this object.

For detailed information on the rest of parameters, the implemented algorithm, and special usage conditions for this routine, refer to the documentation for the unbounded version of this member function.

◆ NoiseKSigma() [2/2]

double pcl::ATrousWaveletTransform::NoiseKSigma ( int  j = 0,
float  k = 3,
float  eps = 0.01,
int  n = 10,
size_type N = nullptr 
) const

Estimation of the standard deviation of the noise, assuming a Gaussian noise distribution. This routine implements the k-sigma clipping noise estimation algorithm described by Starck et al. (see the references in the detailed documentation for this class). The algorithm is described for example in Astronomical Image and Data Analysis, pp. 37-38.

This routine can be used to provide an initial estimate to the more accurate multiresolution support noise estimation algorithm, implemented as the NoiseMRS() routine. When used with a relative error bound (see the eps parameter), this routine can easily yield noise estimates to within 1% accuracy.

Parameters
jWavelet layer index (zero-based). The default index is 0.
kClipping multiplier in sigma units. The default value is 3.
epsFractional relative accuracy. If this parameter is greater than zero, the algorithm will iterate until the difference between two successive iterations is less than eps. The default value is 0.01, so this routine iterates to achieve an estimate to within 1% accuracy.
nMaximum number of iterations. When eps is zero, this is the fixed number of iterations of the noise estimation algorithm. Three iterations usually give an estimate to within 5% accuracy. 5 or 6 iterations can provide 1% accuracy in most cases. When eps is greater than zero, this parameter works as a security limit to prevent too long execution times when convergence is slow (which shouldn't happen under normal conditions). The default value is 10.
[out]NPointer to a variable that will receive the total number of pixels tagged as noise during the noise evaluation process. This pointer can legally be nullptr, which is also the default value of this parameter.

Returns the estimated standard deviation of the noise in the specified scale j of the wavelet transform after a relative eps accuracy has been reached or n sigma clipping iterations have been performed, whichever happens first.

The returned value must be scaled by the standard deviation of the Gaussian noise at the specified wavelet scale. The scaling factor depends on the wavelet scaling function used to perform the wavelet decomposition and must be coherent with the transform performed by this object.

If this ATrousWaveletTransform object does not contain a valid wavelet transform, or if the specified wavelet layer has been deleted, this routine throws an Error exception.

◆ NoiseMRS()

double pcl::ATrousWaveletTransform::NoiseMRS ( const ImageVariant image,
const float  sj[],
double  sigma = 0,
float  k = 3,
size_type N = nullptr,
float  low = 0.00002F,
float  high = 0.99998F 
) const

Estimation of the standard deviation of the Gaussian noise from the multiresolution support. This routine implements the iterative algorithm described by Jean-Luc Starck and Fionn Murtagh in their paper Automatic Noise Estimation from the Multiresolution Support (Publications of the Royal Astronomical Society of the Pacific, vol. 110, February 1998, pp. 193-199).

Parameters
imageThe original image. Normally this image should be the same image from which this wavelet transform has been calculated.
sjNoise standard deviation at each wavelet scale for a Gaussian noise distribution with unit sigma. There must be at least NumberOfLayers() elements in the array pointed to by this parameter.
sigmaInitial estimate of the noise standard deviation in the image. The default value is zero. The best starting value is the result of the NoiseKSigma() routine. However, the noise estimate provided by NoiseKSigma() is relative to a particular wavelet layer, so it must be scaled as appropriate to make it coherent with the whole image.
kClipping multiplier in sigma units. The default value is 3.
[out]NPointer to a variable that will receive the total number of pixels tagged as noise during the noise evaluation process. This pointer can legally be nullptr, which is also the default value of this parameter.
lowLower bound of the sampling range in the normalized [0,1] range. Pixel sample values less than or equal to low will be excluded from the noise evaluation process. The default value is 0.00002.
highUpper bound of the sampling range in the normalized [0,1] range. Pixel sample values greater than or equal to high will be excluded from the noise evaluation process. The default value is 0.99998.

Returns the estimated standard deviation of the noise from the multiresolution support, using all wavelet scales available. As long as successive noise estimates converge to a stable solution, this routine performs the necessary iterations until a relative fractional accuracy of 1e-4 is achieved. Normally this requires between 4 and 8 iterations, depending on the relation between the noise and significant structures in the image.

If no convergence is achieved after a large number of iterations, this function returns zero and, if a nonzero N argument pointer is specified, sets *N = 0. This should never happen if this wavelet transform defines a reasonable number of wavelet layers (4 or 5 layers are recommended) and the passed parameters are valid and coherent with the wavelet transform.

If this ATrousWaveletTransform object does not contain a valid wavelet transform, if any wavelet layer has been deleted, or if the specified image doesn't have the same geometry as the wavelet layers in this transform, this routine throws an Error exception.

◆ operator=() [1/2]

ATrousWaveletTransform& pcl::ATrousWaveletTransform::operator= ( ATrousWaveletTransform &&  )
default

Move assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

ATrousWaveletTransform& pcl::ATrousWaveletTransform::operator= ( const ATrousWaveletTransform )
default

Copy assignment operator. Returns a reference to this object.

◆ ScalingFunction()

const WaveletScalingFunction& pcl::ATrousWaveletTransform::ScalingFunction ( ) const
inline

Returns a reference to the (immutable) scaling function used by this wavelet transform.

Definition at line 445 of file ATrousWaveletTransform.h.

◆ SetScalingFunction() [1/3]

void pcl::ATrousWaveletTransform::SetScalingFunction ( const KernelFilter f)
inline

Sets a non-separable kernel filter as the scaling function f used by this wavelet transform.

Note
As a consequence of calling this member function, all existing wavelet layers in this transform are destroyed.

Definition at line 470 of file ATrousWaveletTransform.h.

◆ SetScalingFunction() [2/3]

void pcl::ATrousWaveletTransform::SetScalingFunction ( const SeparableFilter f)
inline

Sets a separable kernel filter as the scaling function f used by this wavelet transform.

Note
As a consequence of calling this member function, all existing wavelet layers in this transform are destroyed.

Definition at line 484 of file ATrousWaveletTransform.h.

◆ SetScalingFunction() [3/3]

void pcl::ATrousWaveletTransform::SetScalingFunction ( const WaveletScalingFunction f)
inline

Sets a new scaling function f for this wavelet transform.

Note
As a consequence of calling this member function, all existing wavelet layers in this transform are destroyed.

Definition at line 456 of file ATrousWaveletTransform.h.


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