PCL
pcl::RedundantMultiscaleTransform Class Reference

Base class of all redundant multiscale transforms. More...

#include <RedundantMultiscaleTransform.h>

+ Inheritance diagram for pcl::RedundantMultiscaleTransform:

Public Types

using layer = Image
 
using layer_state_set = GenericVector< bool >
 
using transform = Array< layer >
 

Public Member Functions

 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
 

Protected Member Functions

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
 
- Protected Member Functions inherited from pcl::BidirectionalImageTransformation
virtual void Transform (const pcl::ComplexImage &image)
 
virtual void Transform (const pcl::DComplexImage &image)
 
virtual void Transform (const pcl::DImage &image)
 
virtual void Transform (const pcl::Image &image)
 
virtual void Transform (const pcl::UInt16Image &image)
 
virtual void Transform (const pcl::UInt32Image &image)
 
virtual void Transform (const pcl::UInt8Image &image)
 

Detailed Description

A redundant multiscale transform produces a set {w1,w2,...,wN,cN}, where each wj is a set of 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, so the generated multiscale transform is called redundant. Two well-known examples of redundant multiscale transform algorithms are the à trous (with holes) wavelet transform, also known as starlet transform, and the multiscale median transform.

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

In our implementation, each layer in a redundant multiscale 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 difference coefficients. Pixel samples in a detail layer can be negative, zero or positive real values.

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

See also
ATrousWaveletTransform, StarletTransform, MultiscaleMedianTransform, MultiscaleLinearTransform

Definition at line 102 of file RedundantMultiscaleTransform.h.

Member Typedef Documentation

◆ layer

Represents a multiscale layer.

Definition at line 110 of file RedundantMultiscaleTransform.h.

◆ layer_state_set

Represents a set of layer enabled/disabled states.

Definition at line 120 of file RedundantMultiscaleTransform.h.

◆ transform

Represents a set of multiscale layers, or multiscale transform.

Definition at line 115 of file RedundantMultiscaleTransform.h.

Constructor & Destructor Documentation

◆ RedundantMultiscaleTransform() [1/3]

pcl::RedundantMultiscaleTransform::RedundantMultiscaleTransform ( int  n = 4,
int  d = 0 
)
inline

Constructs a redundant multiscale transform.

Parameters
nNumber of detail layers. The transform will consist of n detail layers plus a residual layer, that is n+1 total layers. The default value is 4.
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 layers and the dyadic scaling sequence).

Successive layers are computed by applying linear or nonlinear operations with kernels of size 2*s + 1. The scaling sequence parameter d is interpreted as follows:

  • If the specified sequence parameter d is zero 0, then the transform uses the dyadic sequence: s = 1, 2, 4, ..., 2^j for 0 ≤ j < n.
  • If d > 0, then d is the constant increment in pixels between two successive scales (linear scaling sequence): s = d*j for 1 ≤ j < n.

Definition at line 146 of file RedundantMultiscaleTransform.h.

◆ RedundantMultiscaleTransform() [2/3]

pcl::RedundantMultiscaleTransform::RedundantMultiscaleTransform ( const RedundantMultiscaleTransform x)
inline

Copy constructor.

Definition at line 158 of file RedundantMultiscaleTransform.h.

◆ RedundantMultiscaleTransform() [3/3]

pcl::RedundantMultiscaleTransform::RedundantMultiscaleTransform ( RedundantMultiscaleTransform &&  )
default

Move constructor.

◆ ~RedundantMultiscaleTransform()

pcl::RedundantMultiscaleTransform::~RedundantMultiscaleTransform ( )
inlineoverride

Destroys a RedundantMultiscaleTransform object. All existing layers are destroyed and deallocated.

Definition at line 178 of file RedundantMultiscaleTransform.h.

Member Function Documentation

◆ Apply() [1/7]

void pcl::RedundantMultiscaleTransform::Apply ( pcl::ComplexImage image) const
overrideprotectedvirtual

Applies this transformation to a 32-bit complex image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [2/7]

void pcl::RedundantMultiscaleTransform::Apply ( pcl::DComplexImage image) const
overrideprotectedvirtual

Applies this transformation to a 64-bit complex image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [3/7]

void pcl::RedundantMultiscaleTransform::Apply ( pcl::DImage image) const
overrideprotectedvirtual

Applies this transformation to a 64-bit floating point image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [4/7]

void pcl::RedundantMultiscaleTransform::Apply ( pcl::Image image) const
overrideprotectedvirtual

Applies this transformation to a 32-bit floating point image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [5/7]

void pcl::RedundantMultiscaleTransform::Apply ( pcl::UInt16Image image) const
overrideprotectedvirtual

Applies this transformation to a 16-bit unsigned integer image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [6/7]

void pcl::RedundantMultiscaleTransform::Apply ( pcl::UInt32Image image) const
overrideprotectedvirtual

Applies this transformation to a 32-bit unsigned integer image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [7/7]

void pcl::RedundantMultiscaleTransform::Apply ( pcl::UInt8Image image) const
overrideprotectedvirtual

Applies this transformation to an 8-bit unsigned integer image.

Reimplemented from pcl::ImageTransformation.

◆ BiasLayer()

void pcl::RedundantMultiscaleTransform::BiasLayer ( int  i,
float  k 
)
inline

Biases a multiscale transform layer.

Parameters
iLayer index, 0 <= i <= n, where n is the number of generated multiscale layers. If i == n, the residual layer is biased.
kBias factor. Positive biases increase the relative weight of biased layers in image reconstructions (inverse transforms). Negative biases decrease relative layer weights. A zero bias factor does not change a layer.

This member function can be used to enhance or attenuate image structures at selected scales. Consider this code:

Image img;
// ...
// ...
*M << img; // decomposition (transform)
M->BiasLayer( 1, +2.5 );
M->BiasLayer( 3, -1 );
*M >> img; // reconstruction (inverse transform)

In the example above, the second and fourth layers of a multiscale transform have been biased. The layer at index 1 (the second layer) has been enhanced because a positive layer bias has been applied (2.5). The layer at index 3 (fourth layer) has been attenuated because a negative bias (-1) has been applied.

Note
Layer biasing is an irreversible operation because it works by multiplying all coefficients in the specified layer by a constant derived from the specified bias factor.

Definition at line 477 of file RedundantMultiscaleTransform.h.

◆ DeleteLayer()

void pcl::RedundantMultiscaleTransform::DeleteLayer ( int  i)
inline

Deletes the layer at layer index i, 0 <= i <= n, where n is the number of generated layers. If i == n this member function deletes the large-scale residual layer.

Deleted layers are excluded from image reconstructions performed by subsequent inverse multiscale transforms.

For example, if you delete the first two layers of a transform, a subsequent inverse transform will remove all small-scale image structures smaller than four pixels, assuming a dyadic scaling sequence.

Definition at line 376 of file RedundantMultiscaleTransform.h.

◆ DisableLayer()

void pcl::RedundantMultiscaleTransform::DisableLayer ( int  i,
bool  disable = true 
)
inline

Disables or enables the layer at index i, 0 <= i <= n, where n is the number of generated layers. If i == n, this member function disables or enables the large-scale residual layer.

This is a convenience function, equivalent to: EnableLayer( i, !disable );

Definition at line 425 of file RedundantMultiscaleTransform.h.

◆ EnableLayer()

void pcl::RedundantMultiscaleTransform::EnableLayer ( int  i,
bool  enable = true 
)
inline

Enables or disables the layer at index i, 0 <= i <= n, where n is the number of generated layers. If i == n, this member function enables or disables the large-scale residual layer.

Disabled layers are not generated during multiscale transforms, so they are obviously excluded from image reconstructions (inverse transforms). This has the advantage that a lot of memory can be saved if one or more layers aren't required or have to be excluded from the inverse transform.

For the reason explained, disabling layers is more efficient, in terms of memory consumption, if done before the multiscale transform. When the transform has already been performed, disabling one or more layers excludes them from reconstructions, but does not delete them, so the after-transformation layer disable operation, unlike layer deletion, is reversible.

Definition at line 411 of file RedundantMultiscaleTransform.h.

◆ FilterSize()

int pcl::RedundantMultiscaleTransform::FilterSize ( int  j) const
inline

Returns the filter size for the specified layer j. Returns an odd integer larger than or equal to three. For the dyadic scaling sequence, the returned value is equal to 1 + 2*2^j (3, 5, 9, 17, 33, ...). For a linear scaling sequence with distance d, returns 1 + 2*d*(1 + j).

Definition at line 271 of file RedundantMultiscaleTransform.h.

◆ IsLayer()

bool pcl::RedundantMultiscaleTransform::IsLayer ( int  i) const
inline

Returns true iff the layer at layer index i exists (0 <= i <= n, where n is the number of generated layers), that is, if the multiscale transform has been generated and the specified layer has been calculated (because it was not disabled) and has not been deleted.

Definition at line 388 of file RedundantMultiscaleTransform.h.

◆ IsLayerEnabled()

bool pcl::RedundantMultiscaleTransform::IsLayerEnabled ( int  i) const
inline

Returns true iff the layer at index i is enabled, false if it is disabled. See the documentation for EnableLayer( int, bool ) for detailed information about disabled layers.

Definition at line 435 of file RedundantMultiscaleTransform.h.

◆ Layer() [1/2]

layer& pcl::RedundantMultiscaleTransform::Layer ( int  i)
inline

Returns a reference to the (mutable) layer at scale index i. This is an overloaded member function, provided for convenience.

See Layer( int ) const for more information.

Definition at line 330 of file RedundantMultiscaleTransform.h.

◆ Layer() [2/2]

const layer& pcl::RedundantMultiscaleTransform::Layer ( int  i) const
inline

Returns a reference to the immutable layer at scale index i, 0 <= i <= n, where n is the number of generated detail layers. If i == n, this member function returns a reference to the large-scale residual layer.

Note
Before trying to access layers, the multiscale transform must be performed on an image. In addition, the specified layer must exist (must not have been deleted). Otherwise this function (as well as others that provide access to layer images) throws an Error exception.

Definition at line 318 of file RedundantMultiscaleTransform.h.

◆ NumberOfLayers()

int pcl::RedundantMultiscaleTransform::NumberOfLayers ( ) const
inline

Returns the number of detail layers that will be (or have been) generated by this transform.

The number returned does not include the residual layer. In other words, the total number of layers generated is always equal to one plus the value returned by this member function, since the large-scale residual layer is always generated by all multiscale transforms.

Definition at line 285 of file RedundantMultiscaleTransform.h.

◆ operator=() [1/2]

RedundantMultiscaleTransform& pcl::RedundantMultiscaleTransform::operator= ( const RedundantMultiscaleTransform x)
inline

Copy assignment operator. Returns a reference to this object.

Definition at line 185 of file RedundantMultiscaleTransform.h.

References pcl::Array< T, A >::EnsureUnique().

◆ operator=() [2/2]

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

Move assignment operator. Returns a reference to this object.

◆ operator[]() [1/2]

layer& pcl::RedundantMultiscaleTransform::operator[] ( int  i)
inline

Returns a reference to the (mutable) layer at scale index i. This is a convenience operator, equivalent to:

Layer( i );

The array subscript operators can produce more elegant code than the Layer functions.

Definition at line 359 of file RedundantMultiscaleTransform.h.

◆ operator[]() [2/2]

const layer& pcl::RedundantMultiscaleTransform::operator[] ( int  i) const
inline

Returns a reference to the (immutable) layer at scale index i. This is a convenience operator, equivalent to:

Layer( i ) const;

The array subscript operators can produce more elegant code than the Layer functions.

Definition at line 345 of file RedundantMultiscaleTransform.h.

◆ ReleaseTransform()

virtual transform pcl::RedundantMultiscaleTransform::ReleaseTransform ( )
inlinevirtual

Returns the set of layers in this transform, after clearing the transform without destroying its layers, whose ownership is then transferred to the caller.

If no multiscale transform has been performed, this function returns an empty set.

The caller is responsible for deallocation of the returned layers. After calling this function, this object will be empty, just as if no transform had been performed.

Definition at line 496 of file RedundantMultiscaleTransform.h.

◆ Reset()

virtual void pcl::RedundantMultiscaleTransform::Reset ( )
inlinevirtual

Destroys and deallocates all existing layers and resets all layer states so that all layers are enabled.

Definition at line 507 of file RedundantMultiscaleTransform.h.

◆ ScalingSequence()

int pcl::RedundantMultiscaleTransform::ScalingSequence ( ) const
inline

Returns the scaling sequence used by this multiscale transform.

Successive layers are computed by applying linear on nonlinear operations with kernels of size 2*s + 1.

If the value returned by this function is zero 0, then the transform uses the dyadic sequence: s = 1, 2, 4, ..., 2^j for 0 <= j < n.

If the returned value is > 0, it is the constant increment in pixels between two successive scales (linear scaling sequence): s = d*j for 1 <= j < n.

Definition at line 215 of file RedundantMultiscaleTransform.h.

◆ SetDyadicScalingSequence()

void pcl::RedundantMultiscaleTransform::SetDyadicScalingSequence ( )
inline

Selects the dyadic scaling sequence for this multiscale transform.

This is a convenience function, equivalent to: SetScalingSequence( 0 );

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

Definition at line 245 of file RedundantMultiscaleTransform.h.

◆ SetLinearScalingSequence()

void pcl::RedundantMultiscaleTransform::SetLinearScalingSequence ( int  d = 1)
inline

Selects a linear scaling sequence with distance d in pixels.

This is a convenience function, equivalent to: SetScalingSequence( d );

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

Definition at line 259 of file RedundantMultiscaleTransform.h.

References pcl::Max().

◆ SetNumberOfLayers()

void pcl::RedundantMultiscaleTransform::SetNumberOfLayers ( int  n)
inline

Sets the number of detail layers that will be generated by this transform.

Parameters
nNumber of detail layers, not including the last, large-scale residual layer. Must be n >= 1.
Note
Calling this function implicitly performs a complete reset of this object, including the deletion of all existing layers.

Definition at line 300 of file RedundantMultiscaleTransform.h.

References pcl::Max().

◆ SetScalingSequence()

void pcl::RedundantMultiscaleTransform::SetScalingSequence ( int  d)
inline

Sets the scaling sequence d used by this multiscale transform.

For the meaning of the d scaling sequence parameter, see the documentation for the ScalingSequence() member function.

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

Definition at line 229 of file RedundantMultiscaleTransform.h.

References pcl::Max().


The documentation for this class was generated from the following file:
Image
32-bit floating point real image.
pcl::RedundantMultiscaleTransform::Layer
const layer & Layer(int i) const
Definition: RedundantMultiscaleTransform.h:318
pcl::RedundantMultiscaleTransform::RedundantMultiscaleTransform
RedundantMultiscaleTransform(int n=4, int d=0)
Definition: RedundantMultiscaleTransform.h:146