PCL
|
Discrete isotropic à trous wavelet transform. More...
#include <ATrousWaveletTransform.h>
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 > |
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 |
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
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.
Definition at line 123 of file ATrousWaveletTransform.h.
Represents a wavelet layer.
Definition at line 130 of file ATrousWaveletTransform.h.
Represents a set of layer enabled/disabled states.
Definition at line 140 of file ATrousWaveletTransform.h.
Represents a set of wavelet layers, or wavelet transform.
Definition at line 135 of file ATrousWaveletTransform.h.
|
default |
Default constructor.
|
inline |
Constructs an ATrousWaveletTransform instance using the specified scaling function.
f | A wavelet scaling function that can be either a non-separable filter (KernelFilter) or a separable filter (SeparableFilter). |
n | Number of wavelet layers. The transform will consist of n wavelet layers plus a residual layer, i.e. n+1 total layers. |
d | Scaling 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.
|
inline |
Constructs an ATrousWaveletTransform instance that uses a non-separable kernel filter as a scaling function.
f | Non-separable filter that will be used as the scaling function of the transform. Must be a positive, low-pass filter function. |
n | Number of wavelet layers. The transform will consist of n wavelet layers plus a residual layer, i.e. n+1 total layers. |
d | Scaling 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.
|
inline |
Constructs an ATrousWaveletTransform instance that uses a separable kernel filter as a scaling function.
f | Separable filter that will be used as the scaling function of the transform. Must be a positive, low-pass filter function. |
n | Number of wavelet layers. The transform will consist of n wavelet layers plus a residual layer, i.e. n+1 total layers. |
d | Scaling 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.
|
default |
Copy constructor.
|
default |
Move constructor.
|
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.
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.
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.
j | Wavelet layer index (zero-based). The default index is 0. | |
k | Clipping multiplier in sigma units. The default value is 3. | |
eps | Fractional 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. | |
n | Maximum 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] | N | Pointer 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.
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).
image | The original image. Normally this image should be the same image from which this wavelet transform has been calculated. | |
sj | Noise 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. | |
sigma | Initial 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. | |
k | Clipping multiplier in sigma units. The default value is 3. | |
[out] | N | Pointer 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. |
low | Lower 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. | |
high | Upper 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.
|
default |
Move assignment operator. Returns a reference to this object.
|
default |
Copy assignment operator. Returns a reference to this object.
|
inline |
Returns a reference to the (immutable) scaling function used by this wavelet transform.
Definition at line 445 of file ATrousWaveletTransform.h.
|
inline |
Sets a non-separable kernel filter as the scaling function f used by this wavelet transform.
Definition at line 470 of file ATrousWaveletTransform.h.
|
inline |
Sets a separable kernel filter as the scaling function f used by this wavelet transform.
Definition at line 484 of file ATrousWaveletTransform.h.
|
inline |
Sets a new scaling function f for this wavelet transform.
Definition at line 456 of file ATrousWaveletTransform.h.