|
Wavelet and Image class library
1.3.2
|
#include <ImageDenoiser.hh>

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 | |
| Image * | m_image |
| PyramidTransform * | m_transform |
| FilterSet * | m_filter |
| int | m_from |
| int | m_to |
| unsigned | m_areas |
| double | m_alpha |
| int | m_significanceFunction |
| int | m_replacementFunction |
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.
| 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.
| img | a reference to the image to operate on. |
| areas | the areas to operate on. Use a binary OR to combine more than one area (see macros above). |
| fromSub | the subband to start building the trees |
| toSub | the target subband where the tree terminates |
| alpha | the scaling factor to the standard deviation for determining the significance threshold |
| filter | the filterset for decomposition |
| isSingleSignificant | the kind of function used to determine significance, 0: single values, 1: 3x3 regions, 2: channels in 3x3 environments |
| replacementFunction | the kind of function used to replace coefficient we consider as noise, 0: +-0.9*threshold, 1: more complicated formula depending on channel (see below) |
| invalid_argument | if 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.
| virtual void ImageDenoiser::denoise | ( | void | ) | [virtual] |
Apply the denoising algorithm to the image.
| invalid_argument | if 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.
| c | the coefficient |
| channel | which area inside a subband |
| threshold | the threshold |
| stop | set to true if we found an edge and want the processing of this tree to stop (always false here) |
| 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.
| c | the coefficient |
| channel | which area inside a subband |
| threshold | the threshold |
| stop | set to true if we found an edge and want the processing of this tree to stop |
| 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.
| c | the coefficient |
| channel | which area inside a subband |
| threshold | the threshold |
| stop | set to true if we found an edge and want the processing of this tree to stop |
| virtual void ImageDenoiser::processFrom | ( | PyramidTree & | tree, |
| coeff * | thresholds, | ||
| area | channel, | ||
| int | level | ||
| ) | [protected, virtual] |
Process one tree or subtree by applying the thresholds
| tree | the tree structure to process |
| thresholds | an array holding depth thresholds |
| channel | which area inside a subband |
| level | the 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.
| y | the row in the image |
| x | the column in the image |
| channel | which area inside a subband |
| threshold | the 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.
| y | the row in the image |
| x | the column in the image |
| channel | which area inside a subband |
| threshold | the threshold |
| coeff ImageDenoiser::threshold | ( | int | subband, |
| area | channel | ||
| ) | [protected] |
Calculate the threshold for a given area/subband.
| channel | the area |
| subband | the subband |
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.
FilterSet* ImageDenoiser::m_filter [protected] |
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.
Image* ImageDenoiser::m_image [protected] |
A reference to the image to process.
Definition at line 139 of file ImageDenoiser.hh.
int ImageDenoiser::m_replacementFunction [protected] |
The replacement function used.
Definition at line 157 of file ImageDenoiser.hh.
int ImageDenoiser::m_significanceFunction [protected] |
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.
PyramidTransform* ImageDenoiser::m_transform [protected] |
The wavelet transform to be used.
Definition at line 141 of file ImageDenoiser.hh.
1.7.6.1