Wavelet and Image class library  1.3.2
Public Member Functions | Protected Member Functions | Protected Attributes
ImageDenoiser Class Reference

#include <ImageDenoiser.hh>

Collaboration diagram for ImageDenoiser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ImageDenoiser (Image &img, unsigned areas, int fromSub, int toSub=1, double alpha=1.0, FilterSet &filter=Daub4, int isSingleSignificant=0, int replacementFunction=0)
virtual ~ImageDenoiser (void)
virtual void denoise (void)

Protected Member Functions

coeff threshold (int subband, area channel)
virtual void processFrom (PyramidTree &tree, coeff *thresholds, area channel, int level)
virtual bool isCoeffSingleSignificant (CoeffInformation &c, area channel, coeff threshold, bool &stop)
virtual bool isSingleSignificantInRegion (CoeffInformation &c, area channel, coeff threshold, bool &stop)
virtual bool isSingleSignificantInChannel (CoeffInformation &c, area channel, coeff threshold, bool &stop)
virtual void replaceSimple (int y, int x, area channel, coeff threshold)
virtual void replaceChannel (int y, int x, area channel, coeff threshold)

Protected Attributes

Imagem_image
PyramidTransformm_transform
FilterSetm_filter
int m_from
int m_to
unsigned m_areas
double m_alpha
int m_significanceFunction
int m_replacementFunction

Detailed Description

A simple DWT-based image denoiser. It uses the same tree structure as in Shapiro's Zerotree compression algorithm. Denoising means reducing the power of significant coefficients in finer subbands that have insignificant parents in the coarser subbands.

Definition at line 39 of file ImageDenoiser.hh.


Constructor & Destructor Documentation

ImageDenoiser::ImageDenoiser ( Image img,
unsigned  areas,
int  fromSub,
int  toSub = 1,
double  alpha = 1.0,
FilterSet filter = Daub4,
int  isSingleSignificant = 0,
int  replacementFunction = 0 
)

Constructor, initializes internal structures, sets up preferences.

Parameters:
imga reference to the image to operate on.
areasthe areas to operate on. Use a binary OR to combine more than one area (see macros above).
fromSubthe subband to start building the trees
toSubthe target subband where the tree terminates
alphathe scaling factor to the standard deviation for determining the significance threshold
filterthe filterset for decomposition
isSingleSignificantthe kind of function used to determine significance, 0: single values, 1: 3x3 regions, 2: channels in 3x3 environments
replacementFunctionthe kind of function used to replace coefficient we consider as noise, 0: +-0.9*threshold, 1: more complicated formula depending on channel (see below)
Exceptions:
invalid_argumentif the areas argument is zero or not at least two subbands are selected or an invalid significance function is selected
virtual ImageDenoiser::~ImageDenoiser ( void  ) [virtual]

Destructor, clean up.


Member Function Documentation

virtual void ImageDenoiser::denoise ( void  ) [virtual]

Apply the denoising algorithm to the image.

Exceptions:
invalid_argumentif some error occurs during decomposition or reconstruction of the image
virtual bool ImageDenoiser::isCoeffSingleSignificant ( CoeffInformation c,
area  channel,
coeff  threshold,
bool &  stop 
) [protected, virtual]

Return true if the coefficient's value is significant with respect to the threshold.

Parameters:
cthe coefficient
channelwhich area inside a subband
thresholdthe threshold
stopset to true if we found an edge and want the processing of this tree to stop (always false here)
Returns:
true if the coefficient is significant
virtual bool ImageDenoiser::isSingleSignificantInChannel ( CoeffInformation c,
area  channel,
coeff  threshold,
bool &  stop 
) [protected, virtual]

Return true if the coefficient is significant with respect to the threshold but the surrounding channel-dependent region is not.

Parameters:
cthe coefficient
channelwhich area inside a subband
thresholdthe threshold
stopset to true if we found an edge and want the processing of this tree to stop
Returns:
true if the coefficient's region is significant
virtual bool ImageDenoiser::isSingleSignificantInRegion ( CoeffInformation c,
area  channel,
coeff  threshold,
bool &  stop 
) [protected, virtual]

Return true if the coefficient is significant with respect to the threshold but the surrounding square region is not.

Parameters:
cthe coefficient
channelwhich area inside a subband
thresholdthe threshold
stopset to true if we found an edge and want the processing of this tree to stop
Returns:
true if the coefficient's region is significant
virtual void ImageDenoiser::processFrom ( PyramidTree tree,
coeff thresholds,
area  channel,
int  level 
) [protected, virtual]

Process one tree or subtree by applying the thresholds

Parameters:
treethe tree structure to process
thresholdsan array holding depth thresholds
channelwhich area inside a subband
levelthe current position's decomposition level
virtual void ImageDenoiser::replaceChannel ( int  y,
int  x,
area  channel,
coeff  threshold 
) [protected, virtual]

Replace a coefficient that we think is noise. This method uses the formula found in "Image Denoising Using a Local Gaussian Scale Mixture Model in the Wavelet Domain" by Strela/Portilla/Simoncelli: I_xy = sqrt (sum_n(I_xnyn^2)/n), however we only count vertical, horizontal or diagonal values depending on which channel a value is in.

Parameters:
ythe row in the image
xthe column in the image
channelwhich area inside a subband
thresholdthe threshold
virtual void ImageDenoiser::replaceSimple ( int  y,
int  x,
area  channel,
coeff  threshold 
) [protected, virtual]

Replace a coefficient that we think is noise. This method simply replaces it by the threshold multiplied by the original value's sign and 0.99.

Parameters:
ythe row in the image
xthe column in the image
channelwhich area inside a subband
thresholdthe threshold
coeff ImageDenoiser::threshold ( int  subband,
area  channel 
) [protected]

Calculate the threshold for a given area/subband.

Parameters:
channelthe area
subbandthe subband
Returns:
the threshold

Member Data Documentation

double ImageDenoiser::m_alpha [protected]

The scaling factor to the standard deviation for determining the significance threshold

Definition at line 153 of file ImageDenoiser.hh.

unsigned ImageDenoiser::m_areas [protected]

The areas to operate on. Use a binary OR to combine more than one area (see macros above).

Definition at line 150 of file ImageDenoiser.hh.

The filterset used for decomposition

Definition at line 143 of file ImageDenoiser.hh.

int ImageDenoiser::m_from [protected]

The subband to start building the trees

Definition at line 145 of file ImageDenoiser.hh.

A reference to the image to process.

Definition at line 139 of file ImageDenoiser.hh.

The replacement function used.

Definition at line 157 of file ImageDenoiser.hh.

The significance function used.

Definition at line 155 of file ImageDenoiser.hh.

int ImageDenoiser::m_to [protected]

The target subband where the tree terminates

Definition at line 147 of file ImageDenoiser.hh.

The wavelet transform to be used.

Definition at line 141 of file ImageDenoiser.hh.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines