te::rp::Contrast Class Reference

Contrast enhancement. More...

#include <Contrast.h>

Inheritance diagram for te::rp::Contrast:
te::rp::Algorithm

Classes

class  InputParameters
 Contrast input parameters. More...
 
class  OutputParameters
 Contrast output parameters. More...
 

Public Member Functions

 Contrast ()
 
bool execute (AlgorithmOutputParameters &outputParams) throw ( te::rp::Exception )
 Executes the algorithm using the supplied parameters. More...
 
const std::string & getErrorMessage () const
 Return the current error message if there is any. More...
 
bool initialize (const AlgorithmInputParameters &inputParams) throw ( te::rp::Exception )
 Initialize the algorithm instance making it ready for execution. More...
 
bool isInitialized () const
 Returns true if the algorithm instance is initialized and ready for execution. More...
 
void reset () throw ( te::rp::Exception )
 Clear all internal allocated objects and reset the algorithm to its initial state. More...
 
 ~Contrast ()
 

Static Public Member Functions

static bool getGainAndOffset (const InputParameters::ContrastType &type, const double &inRangeMin, const double &inRangeMax, const double &outRangeMin, const double &outRangeMax, double &gain, double &offset1, double &offset2)
 Returns gain and offset values for contrast types (when applicable). More...
 

Protected Types

typedef void(Contrast::* RemapFuncPtrT) (const double &inValue, double &outValue)
 Type definition for a remapping function pointer. More...
 

Protected Member Functions

void DecorrelationEnhancementRemap (const double &inValue, double &outValue)
 Remap on gray level using two offsets and gain. More...
 
bool execDecorrelationEnhancement ()
 Execute the decorrelation enhancement contrast following the internal parameters. More...
 
bool execHistogramEqualizationContrast ()
 Execute the histogram equalization contrast following the internal parameters. More...
 
bool execLinearContrast ()
 Execute a linear contrast following the internal parameters. More...
 
bool execLogContrast ()
 Execute a log contrast following the internal parameters. More...
 
bool execSetMeanAndStdContrast ()
 Execute the histogram equalization contrast following the internal parameters. More...
 
bool execSquareContrast ()
 Execute a square contrast following the internal parameters. More...
 
bool execSquareRootContrast ()
 Execute a square root contrast following the internal parameters. More...
 
void histogramEqualizationRemap (const double &inValue, double &outValue)
 Remap on gray level using two offsets and gain. More...
 
void logRemap (const double &inValue, double &outValue)
 Remap on gray level using a log. More...
 
void offSetGainRemap (const double &inValue, double &outValue)
 Remap on gray level using an offset and gain. More...
 
bool remapBandLevels (const te::rst::Band &inRasterBand, te::rst::Band &outRasterBand, RemapFuncPtrT remapFuncPtr, const bool enableProgress)
 Band gray levels remap using a remap function. More...
 
void setErrorMessage (const std::string &newErrorMessage)
 Set the current error message. More...
 
void squareRemap (const double &inValue, double &outValue)
 Remap on gray level using a square. More...
 
void squareRootRemap (const double &inValue, double &outValue)
 Remap on gray level using a square root. More...
 

Protected Attributes

double m_decorrelationEnhancementRemap_gain
 
double m_decorrelationEnhancementRemap_offset1
 
double m_decorrelationEnhancementRemap_offset2
 
std::map< double, double > m_histogramEqualizationRemap_cdf
 
double m_histogramEqualizationRemap_cDFMin
 
double m_histogramEqualizationRemap_gain
 
Contrast::InputParameters m_inputParameters
 Contrast input execution parameters. More...
 
bool m_isInitialized
 Tells if this instance is initialized. More...
 
double m_logRemap_gain
 
double m_logRemap_offset
 
double m_offSetGainRemap_gain
 
double m_offSetGainRemap_offset1
 
double m_offSetGainRemap_offset2
 
Contrast::OutputParametersm_outputParametersPtr
 Contrast input execution parameters. More...
 
double m_squareRemap_gain
 
double m_squareRootRemap_gain
 

Detailed Description

Contrast enhancement.

Apply contrast enhencement on the selected bands.

Definition at line 57 of file Contrast.h.

Member Typedef Documentation

◆ RemapFuncPtrT

typedef void(Contrast::* te::rp::Contrast::RemapFuncPtrT) (const double &inValue, double &outValue)
protected

Type definition for a remapping function pointer.

Definition at line 254 of file Contrast.h.

Constructor & Destructor Documentation

◆ Contrast()

te::rp::Contrast::Contrast ( )

◆ ~Contrast()

te::rp::Contrast::~Contrast ( )

Member Function Documentation

◆ DecorrelationEnhancementRemap()

void te::rp::Contrast::DecorrelationEnhancementRemap ( const double &  inValue,
double &  outValue 
)
inlineprotected

Remap on gray level using two offsets and gain.

Parameters
inValueInput gray level.
outValueOutput gray level.

Definition at line 391 of file Contrast.h.

◆ execDecorrelationEnhancement()

bool te::rp::Contrast::execDecorrelationEnhancement ( )
protected

Execute the decorrelation enhancement contrast following the internal parameters.

Returns
true if OK, false on errors.

◆ execHistogramEqualizationContrast()

bool te::rp::Contrast::execHistogramEqualizationContrast ( )
protected

Execute the histogram equalization contrast following the internal parameters.

Returns
true if OK, false on errors.

◆ execLinearContrast()

bool te::rp::Contrast::execLinearContrast ( )
protected

Execute a linear contrast following the internal parameters.

Returns
true if OK, false on errors.

◆ execLogContrast()

bool te::rp::Contrast::execLogContrast ( )
protected

Execute a log contrast following the internal parameters.

Returns
true if OK, false on errors.

◆ execSetMeanAndStdContrast()

bool te::rp::Contrast::execSetMeanAndStdContrast ( )
protected

Execute the histogram equalization contrast following the internal parameters.

Returns
true if OK, false on errors.

◆ execSquareContrast()

bool te::rp::Contrast::execSquareContrast ( )
protected

Execute a square contrast following the internal parameters.

Returns
true if OK, false on errors.

◆ execSquareRootContrast()

bool te::rp::Contrast::execSquareRootContrast ( )
protected

Execute a square root contrast following the internal parameters.

Returns
true if OK, false on errors.

◆ execute()

bool te::rp::Contrast::execute ( AlgorithmOutputParameters outputParams)
throw (te::rp::Exception
)
virtual

Executes the algorithm using the supplied parameters.

Parameters
outputParamsOutput parameters.
Returns
true if OK, false on errors.
Note
A return error string can be obtained via Algorithm::getErrorMessage()

Implements te::rp::Algorithm.

◆ getErrorMessage()

const std::string& te::rp::Algorithm::getErrorMessage ( ) const
inherited

Return the current error message if there is any.

Returns
Return the current error message if there is any.

◆ getGainAndOffset()

static bool te::rp::Contrast::getGainAndOffset ( const InputParameters::ContrastType type,
const double &  inRangeMin,
const double &  inRangeMax,
const double &  outRangeMin,
const double &  outRangeMax,
double &  gain,
double &  offset1,
double &  offset2 
)
static

Returns gain and offset values for contrast types (when applicable).

Parameters
inRangeMinInput values range minimum value.
inRangeMaxInput values range maximum value.
outRangeMinOutput values range minimum value.
outRangeMaxOutput values range maximum value.
gainCalculated gain.
offset1Calculated offset 1.
offset2Calculated offset 2.
Returns
true if OK, false on errors.

◆ histogramEqualizationRemap()

void te::rp::Contrast::histogramEqualizationRemap ( const double &  inValue,
double &  outValue 
)
inlineprotected

Remap on gray level using two offsets and gain.

Parameters
inValueInput gray level.
outValueOutput gray level.

Definition at line 403 of file Contrast.h.

◆ initialize()

bool te::rp::Contrast::initialize ( const AlgorithmInputParameters inputParams)
throw (te::rp::Exception
)
virtual

Initialize the algorithm instance making it ready for execution.

Parameters
inputParamsInput parameters.
Returns
true if OK, false on errors.
Note
A return error string can be obtained via Algorithm::getErrorMessage()

Implements te::rp::Algorithm.

◆ isInitialized()

bool te::rp::Contrast::isInitialized ( ) const
virtual

Returns true if the algorithm instance is initialized and ready for execution.

Returns
true if the algorithm instance is initialized and ready for execution.

Implements te::rp::Algorithm.

◆ logRemap()

void te::rp::Contrast::logRemap ( const double &  inValue,
double &  outValue 
)
inlineprotected

Remap on gray level using a log.

Parameters
inValueInput gray level.
outValueOutput gray level.
Note
outValue = m_logRemap_gain * std::log10( inValue + m_logRemap_offset + 1.0 );

Definition at line 381 of file Contrast.h.

◆ offSetGainRemap()

void te::rp::Contrast::offSetGainRemap ( const double &  inValue,
double &  outValue 
)
inlineprotected

Remap on gray level using an offset and gain.

Parameters
inValueInput gray level.
outValueOutput gray level.
Note
outValue = ( ( inValue + m_offSetGainRemap_offset1 ) * m_offSetGainRemap_gain ) + m_offSetGainRemap_offset2

Definition at line 347 of file Contrast.h.

◆ remapBandLevels()

bool te::rp::Contrast::remapBandLevels ( const te::rst::Band inRasterBand,
te::rst::Band outRasterBand,
RemapFuncPtrT  remapFuncPtr,
const bool  enableProgress 
)
protected

Band gray levels remap using a remap function.

Parameters
inRasterBandInput raster band.
outRasterBandOutput raster band.
remapFuncPtrThe remap function pointer used.
enableProgressEnable the use of a progress interface.
Returns
true if OK, false on errors.

◆ reset()

void te::rp::Contrast::reset ( )
throw (te::rp::Exception
)
virtual

Clear all internal allocated objects and reset the algorithm to its initial state.

Reimplemented from te::rp::Algorithm.

◆ setErrorMessage()

void te::rp::Algorithm::setErrorMessage ( const std::string &  newErrorMessage)
protectedinherited

Set the current error message.

Parameters
newErrorMessageNew error message;

◆ squareRemap()

void te::rp::Contrast::squareRemap ( const double &  inValue,
double &  outValue 
)
inlineprotected

Remap on gray level using a square.

Parameters
inValueInput gray level.
outValueOutput gray level.
Note
outValue = m_squareRemap_factor * std::pow( inValue, 2.0 )

Definition at line 359 of file Contrast.h.

◆ squareRootRemap()

void te::rp::Contrast::squareRootRemap ( const double &  inValue,
double &  outValue 
)
inlineprotected

Remap on gray level using a square root.

Parameters
inValueInput gray level.
outValueOutput gray level.
Note
outValue = m_squareRootRemap_gain * std::sqrt( inValue );

Definition at line 370 of file Contrast.h.

Member Data Documentation

◆ m_decorrelationEnhancementRemap_gain

double te::rp::Contrast::m_decorrelationEnhancementRemap_gain
protected

Definition at line 332 of file Contrast.h.

◆ m_decorrelationEnhancementRemap_offset1

double te::rp::Contrast::m_decorrelationEnhancementRemap_offset1
protected

Definition at line 333 of file Contrast.h.

◆ m_decorrelationEnhancementRemap_offset2

double te::rp::Contrast::m_decorrelationEnhancementRemap_offset2
protected

Definition at line 334 of file Contrast.h.

◆ m_histogramEqualizationRemap_cdf

std::map<double, double> te::rp::Contrast::m_histogramEqualizationRemap_cdf
protected

Definition at line 339 of file Contrast.h.

◆ m_histogramEqualizationRemap_cDFMin

double te::rp::Contrast::m_histogramEqualizationRemap_cDFMin
protected

Definition at line 337 of file Contrast.h.

◆ m_histogramEqualizationRemap_gain

double te::rp::Contrast::m_histogramEqualizationRemap_gain
protected

Definition at line 338 of file Contrast.h.

◆ m_inputParameters

Contrast::InputParameters te::rp::Contrast::m_inputParameters
protected

Contrast input execution parameters.

Definition at line 257 of file Contrast.h.

◆ m_isInitialized

bool te::rp::Contrast::m_isInitialized
protected

Tells if this instance is initialized.

Definition at line 260 of file Contrast.h.

◆ m_logRemap_gain

double te::rp::Contrast::m_logRemap_gain
protected

Definition at line 328 of file Contrast.h.

◆ m_logRemap_offset

double te::rp::Contrast::m_logRemap_offset
protected

Definition at line 329 of file Contrast.h.

◆ m_offSetGainRemap_gain

double te::rp::Contrast::m_offSetGainRemap_gain
protected

Definition at line 319 of file Contrast.h.

◆ m_offSetGainRemap_offset1

double te::rp::Contrast::m_offSetGainRemap_offset1
protected

Definition at line 317 of file Contrast.h.

◆ m_offSetGainRemap_offset2

double te::rp::Contrast::m_offSetGainRemap_offset2
protected

Definition at line 318 of file Contrast.h.

◆ m_outputParametersPtr

Contrast::OutputParameters* te::rp::Contrast::m_outputParametersPtr
protected

Contrast input execution parameters.

Definition at line 258 of file Contrast.h.

◆ m_squareRemap_gain

double te::rp::Contrast::m_squareRemap_gain
protected

Definition at line 322 of file Contrast.h.

◆ m_squareRootRemap_gain

double te::rp::Contrast::m_squareRootRemap_gain
protected

Definition at line 325 of file Contrast.h.


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