STIRA  0.1
Public Member Functions | List of all members
stira::pyramidapplications::PyramidContrastEnhancer Class Reference

A class to demonstrate simple contrast enhancement The original reference used curvelets, we replaced these by a steerable pyramid Original reference: More...

#include <PyramidContrastEnhancer.h>

Public Member Functions

 PyramidContrastEnhancer (double sigma)
 constructor More...
 
 ~PyramidContrastEnhancer ()
 destructor
 
ImageRun (Image *pImage, int nrScales, int nrOrientations, bool applyWavelet=false)
 run method Processes al color bands in the image independantly More...
 
void RunPyramid (Pyramid< double > *pPyramid, bool applyWavelet=false)
 runs contrast enhancement on a already decomposed pyramid Corresponds to single color band More...
 
ImageRun3Colors (Image *pImage, int nrScales, int nrOrientations, bool applyWavelet=false)
 color version of contrast enhancement Color version has the following steps 1) 3 band image is transformed to Luv 2) Each band is decomposed in a pyramid 3) The enhancement factor is computed based on the L2 norm of the Luv vector of pyramid coefficients 4) The three components are multiplied with the enhancement factor 5) The pyramids are reconstructed 6) Result is transformed back to RGB 7) 3 band image is transformed to Luv More...
 
double GetSigmaNoise ()
 gets the sigma of the noise
 
void SetSigmaNoise (double sigma)
 sets the sigma of the noise More...
 
double GetNoiseThresholdFactor ()
 gets the noise threshold factor This is the factor with which sigma is multiplied to determine a minimum threshold for amplification; smaller coefficients are considered to be noise and are thus not amplified
 
void SetNoiseThresholdFactor (double factor)
 sets the noise threshold factor More...
 
double GetNoiseThreshold ()
 gets the noise threshold Is in fact (sigmaNoise x noiseThresholdFactor)
 
void SetNoiseThreshold (double threshold)
 sets the noise threshold More...
 
double GetNonLinearityDegree ()
 gets the non-linearity degree
 
void SetNonLinearityDegree (double degree)
 sets the non-linearity degree More...
 
double GetUpperLimitAmplificationFactor ()
 gets the upper limit for amplification factor (between 0 and 1) Is in fact the factor with which the maximum coefficient is multiplied to determine the threshold above which no amplification is applied
 
void SetUpperLimitAmplificationFactor (double limit)
 sets the upper limit for amplification factor More...
 
double GetDynamicRangeCompressionFactor ()
 gets the factor that determines the compression of the dynamic range
 
void SetDynamicRangeCompressionFactor (double factor)
 sets the factor that determines the compression of the dynamic range More...
 
double GetUpperLimitAmplification ()
 gets the upper limit for amplification Coefficients with an absolute value bigger than this value are not amplified Can also be determined by finding the coefficient with maximum absolute value multiplied with UpperLimitAmplificationFactor
 
void SetUpperLimitAmplification (double limit)
 gets the upper limit for amplification More...
 
bool TestAmplificationfactor (std::string fileName, double myMin, double myMax, double stepSize)
 creates a file to inspect the values of the amplification factors over a range of coefficients More...
 
void PrintParameters ()
 prints the parameters of the algorithm to standard output
 

Detailed Description

A class to demonstrate simple contrast enhancement The original reference used curvelets, we replaced these by a steerable pyramid Original reference:

"Gray and color image contrast enhancement by the curvelet transform" Murtagh, Fionn and Starck, J.L. and Candes, E.J. and Donoho, D.L. (2003) IEEE Transactions on Image Processing, 12 (6). pp. 706-717.

Constructor & Destructor Documentation

stira::pyramidapplications::PyramidContrastEnhancer::PyramidContrastEnhancer ( double  sigma)

constructor

Parameters
pPyramidpyramid with input data
sigmanoise level, in order to avoid to amplify noise

Member Function Documentation

Image * stira::pyramidapplications::PyramidContrastEnhancer::Run ( Image pImage,
int  nrScales,
int  nrOrientations,
bool  applyWavelet = false 
)

run method Processes al color bands in the image independantly

Parameters
pImageinput image to be enhanced
nrScalesnumber of scales to use in the decomposition
nrOrientationsnumber of orientations to use per scale in the decomposition
applyWavelettrue: apply old wavelet-based enhancement; false: use new approach of Murtagh et al

References stira::imagedata::Image::AddBand(), stira::steerable::PyramidReal::Decompose(), stira::imagedata::GridStatistics< T >::GetAbsMax(), stira::imagedata::Image::GetBands(), stira::imagedata::Image::GetHeight(), stira::imagedata::ArrayGrid< T >::GetHeight(), stira::imagedata::Image::GetNumberOfBands(), stira::imagedata::ArrayGrid< T >::GetValue(), stira::imagedata::Image::GetWidth(), stira::imagedata::ArrayGrid< T >::GetWidth(), and stira::imagedata::ArrayGrid< T >::MultiplyValue().

Image * stira::pyramidapplications::PyramidContrastEnhancer::Run3Colors ( Image pImage,
int  nrScales,
int  nrOrientations,
bool  applyWavelet = false 
)

color version of contrast enhancement Color version has the following steps 1) 3 band image is transformed to Luv 2) Each band is decomposed in a pyramid 3) The enhancement factor is computed based on the L2 norm of the Luv vector of pyramid coefficients 4) The three components are multiplied with the enhancement factor 5) The pyramids are reconstructed 6) Result is transformed back to RGB 7) 3 band image is transformed to Luv

Parameters
pImageinput image to be enhanced
nrScalesnumber of scales to use in the decomposition
nrOrientationsnumber of orientations to use per scale in the decomposition
applyWavelettrue: apply old wavelet-based enhancement; false: use new approach of Murtagh et al

References stira::imagedata::Image::AddBand(), stira::steerable::PyramidReal::Decompose(), stira::imagedata::Image::GetBands(), stira::imagedata::Image::GetHeight(), stira::imagedata::Image::GetImageName(), stira::imagedata::Image::GetNumberOfBands(), stira::imagedata::PyramidLevel< T >::GetOrientedBand(), stira::imagedata::Pyramid< T >::GetRecursiveScale(), stira::imagedata::Pyramid< T >::GetResidualScale(), and stira::imagedata::Image::GetWidth().

void stira::pyramidapplications::PyramidContrastEnhancer::RunPyramid ( Pyramid< double > *  pPyramid,
bool  applyWavelet = false 
)

runs contrast enhancement on a already decomposed pyramid Corresponds to single color band

Parameters
pPyramidinput pyramid
applyWavelettrue: apply old wavelet-based enhancement; false: use new approach of Murtagh et al

References stira::imagedata::Pyramid< T >::GetNumberOfOrientations(), stira::imagedata::Pyramid< T >::GetNumberOfScales(), stira::imagedata::PyramidLevel< T >::GetOrientedBand(), stira::imagedata::Pyramid< T >::GetRecursiveScale(), and stira::imagedata::Pyramid< T >::GetResidualScale().

void stira::pyramidapplications::PyramidContrastEnhancer::SetDynamicRangeCompressionFactor ( double  factor)

sets the factor that determines the compression of the dynamic range

Parameters
limitthe upper limit for amplification factor
void stira::pyramidapplications::PyramidContrastEnhancer::SetNoiseThreshold ( double  threshold)

sets the noise threshold

Parameters
thresholdthe noise threshold
void stira::pyramidapplications::PyramidContrastEnhancer::SetNoiseThresholdFactor ( double  factor)

sets the noise threshold factor

Parameters
factorthe noise threshold factor
void stira::pyramidapplications::PyramidContrastEnhancer::SetNonLinearityDegree ( double  degree)

sets the non-linearity degree

Parameters
degreethe non-linearity degree
void stira::pyramidapplications::PyramidContrastEnhancer::SetSigmaNoise ( double  sigma)

sets the sigma of the noise

Parameters
sigmathe sigma of the noise
void stira::pyramidapplications::PyramidContrastEnhancer::SetUpperLimitAmplification ( double  limit)

gets the upper limit for amplification

Parameters
limitthe upper limit for amplification
void stira::pyramidapplications::PyramidContrastEnhancer::SetUpperLimitAmplificationFactor ( double  limit)

sets the upper limit for amplification factor

Parameters
limitthe upper limit for amplification factor
bool stira::pyramidapplications::PyramidContrastEnhancer::TestAmplificationfactor ( std::string  fileName,
double  myMin,
double  myMax,
double  stepSize 
)

creates a file to inspect the values of the amplification factors over a range of coefficients

Parameters
fileNamename of file to write factors to
myMinminimum of the range of coefficients to inspect
myMaxmaximum of the range of coefficients to inspect
stepSizestep size to walk through the range

The documentation for this class was generated from the following files: