STIRA
0.1
|
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 | |
Image * | Run (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... | |
Image * | 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 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 | |
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.
stira::pyramidapplications::PyramidContrastEnhancer::PyramidContrastEnhancer | ( | double | sigma | ) |
constructor
pPyramid | pyramid with input data |
sigma | noise level, in order to avoid to amplify noise |
Image * stira::pyramidapplications::PyramidContrastEnhancer::Run | ( | Image * | pImage, |
int | nrScales, | ||
int | nrOrientations, | ||
bool | applyWavelet = false |
||
) |
run method Processes al color bands in the image independantly
pImage | input image to be enhanced |
nrScales | number of scales to use in the decomposition |
nrOrientations | number of orientations to use per scale in the decomposition |
applyWavelet | true: 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
pImage | input image to be enhanced |
nrScales | number of scales to use in the decomposition |
nrOrientations | number of orientations to use per scale in the decomposition |
applyWavelet | true: 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
pPyramid | input pyramid |
applyWavelet | true: 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
limit | the upper limit for amplification factor |
void stira::pyramidapplications::PyramidContrastEnhancer::SetNoiseThreshold | ( | double | threshold | ) |
sets the noise threshold
threshold | the noise threshold |
void stira::pyramidapplications::PyramidContrastEnhancer::SetNoiseThresholdFactor | ( | double | factor | ) |
sets the noise threshold factor
factor | the noise threshold factor |
void stira::pyramidapplications::PyramidContrastEnhancer::SetNonLinearityDegree | ( | double | degree | ) |
sets the non-linearity degree
degree | the non-linearity degree |
void stira::pyramidapplications::PyramidContrastEnhancer::SetSigmaNoise | ( | double | sigma | ) |
sets the sigma of the noise
sigma | the sigma of the noise |
void stira::pyramidapplications::PyramidContrastEnhancer::SetUpperLimitAmplification | ( | double | limit | ) |
gets the upper limit for amplification
limit | the upper limit for amplification |
void stira::pyramidapplications::PyramidContrastEnhancer::SetUpperLimitAmplificationFactor | ( | double | limit | ) |
sets the upper limit for amplification factor
limit | the 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
fileName | name of file to write factors to |
myMin | minimum of the range of coefficients to inspect |
myMax | maximum of the range of coefficients to inspect |
stepSize | step size to walk through the range |