processing.transform.starlet

exception pywi.processing.transform.starlet.StarletError[source]

Common starlet module’s error.

exception pywi.processing.transform.starlet.WrongDimensionError(msg=None)[source]

Raised when data having a wrong number of dimensions is given.

msg

str – Explanation of the error.

pywi.processing.transform.starlet.wavelet_transform[source]

Compute the starlet transform of input_image.

Pseudo code:

wavelet_transform(input_image, num_scales):

scales[0] $leftarrow$ input_image

for $i in [0, dots, ext{num_scales} - 2]$

$quad$ scales[$i + 1$] $leftarrow$ convolve(scales[$i$], $i$)

$quad$ scales[$i$] $leftarrow$ scales[$i$] - scales[$i + 1$]

Inspired by Sparce2D mr_transform (originally implemented in isap/cxx/sparse2d/src/libsparse2d/MR_Trans.cc)

```cpp static void mr_transform (Ifloat &Image,

MultiResol &MR_Transf, Bool EdgeLineTransform, type_border Border, Bool Details) {

// […] MR_Transf.band(0) = Image; for (s = 0; s < Nbr_Plan -1; s++) {

smooth_bspline (MR_Transf.band(s),MR_Transf.band(s+1),Border,s); MR_Transf.band(s) -= MR_Transf.band(s+1);

} // […]

Parameters:
  • input_image (array_like) – The input image to transform.
  • number_of_scales (int, optional) – The number of scales used to transform input_image or in other words the number of wavelet planes returned.
  • noise_distribution (EmpiricalDistribution, optional) – The noise distribution used to fill ‘empty’ NaN pixels with the appropriate random noise distribution. If none, NaN pixels are fill with zeros (which may add unwanted harmonics in wavelet planes).
Returns:

Return a list containing the wavelet planes.

Return type:

list

Raises:

WrongDimensionError – If input_image is not a 2D array.

pywi.processing.transform.starlet.inverse_wavelet_transform(wavelet_planes, last_plane='mask')[source]

Compute the inverse wavelet transform of wavelet_planes.

Parameters:
  • wavelet_planes (list of array_like) – The wavelet planes to (inverse) transform.
  • last_plane (str, optional) – Define what to do with the last plane: ‘keep’ to keep it in the inverse transform, ‘drop’ to remove it in the inverse transform, ‘mask’ to keep only pixels that are significant in the others planes.
Returns:

Return the cleaned image.

Return type:

array_like