Loading...
Searching...
No Matches
te::rp::AssistedHarmonization Class Reference

Performs raster data assisted histogram harmonization. More...

#include <AssistedHarmonization.h>

Inheritance diagram for te::rp::AssistedHarmonization:
te::rp::Algorithm

Classes

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

Public Member Functions

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

Protected Member Functions

bool calcClassGainsOffsets (const std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > &referenceMeans, const std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > &referenceStdDevs, const std::map< InputParameters::TargetAreasClassIDT, unsigned int > &referenceSamplesNumber, const std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > &adjustMeans, const std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > &adjustStdDevs, std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > &classesGains, std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > &classesOffsets)
 
bool copyRasterData (const te::rst::Raster &inRaster, const std::vector< double > &gains, const std::vector< double > &inputOffsets, const std::vector< double > &outputOffsets, te::rst::Raster &outRaster)
 
bool CreateOutRaster (const te::mem::CachedRaster &adjInputCRaster, const std::vector< double > &gains, const std::vector< double > &inputOffsets, const std::vector< double > &outputOffsets, AssistedHarmonization::OutputParameters *outParamsPtr)
 
bool getRasterStatistics (const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBandsIndexes, const InputParameters::TargetAreasContT &targetAreas, std::map< InputParameters::TargetAreasClassIDT, unsigned int > &samplesNumber, std::map< unsigned int, std::vector< double > > &means, std::map< unsigned int, std::vector< double > > &stdDevs) const
 
bool linearRegression (std::vector< std::pair< double, double > > &coords, double &a, double &b)
 
bool MeanStdHMethodImp (const te::mem::CachedRaster &refInputCRaster, const te::mem::CachedRaster &adjInputCRaster, const InputParameters::TargetAreasContT &referenceTargetAreasReproj, const InputParameters::TargetAreasContT &adjustTargetAreasReproj, AssistedHarmonization::OutputParameters *outParamsPtr)
 
bool MSEHMethodImp (const te::mem::CachedRaster &refInputCRaster, const te::mem::CachedRaster &adjInputCRaster, const InputParameters::TargetAreasContT &referenceTargetAreasReproj, const InputParameters::TargetAreasContT &adjustTargetAreasReproj, AssistedHarmonization::OutputParameters *outParamsPtr)
 
void reprojectGeometries (const AssistedHarmonization::InputParameters::TargetAreasContT &inGeoms, AssistedHarmonization::InputParameters::TargetAreasContT &outGeoms, boost::ptr_vector< InputParameters::TargetAreasGeomT > &outGeomHandler, const int targetSRID)
 
void setErrorMessage (const std::string &newErrorMessage)
 Set the current error message.
 

Protected Attributes

AssistedHarmonization::InputParameters m_inputParameters
 Input execution parameters.
 
bool m_isInitialized
 Tells if this instance is initialized.
 

Private Attributes

std::string m_errorMessage
 Current error message.
 

Detailed Description

Performs raster data assisted histogram harmonization.

See also
Reference: MOREIRA, N. A. P. ; KORTING, T. S. ; DUTRA, L. V. ; CASTEJON, E. F. ; ARAI, E. . Calibração relativa para extensão de assinaturas em série de imagens MODIS. Journal of Information and Data Management, v. 20, p. 230-236, 2019.

Definition at line 44 of file AssistedHarmonization.h.

Constructor & Destructor Documentation

◆ AssistedHarmonization()

te::rp::AssistedHarmonization::AssistedHarmonization ( )

◆ ~AssistedHarmonization()

te::rp::AssistedHarmonization::~AssistedHarmonization ( )

Member Function Documentation

◆ calcClassGainsOffsets()

bool te::rp::AssistedHarmonization::calcClassGainsOffsets ( const std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > & referenceMeans,
const std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > & referenceStdDevs,
const std::map< InputParameters::TargetAreasClassIDT, unsigned int > & referenceSamplesNumber,
const std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > & adjustMeans,
const std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > & adjustStdDevs,
std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > & classesGains,
std::map< InputParameters::TargetAreasClassIDT, std::vector< double > > & classesOffsets )
protected

◆ copyRasterData()

bool te::rp::AssistedHarmonization::copyRasterData ( const te::rst::Raster & inRaster,
const std::vector< double > & gains,
const std::vector< double > & inputOffsets,
const std::vector< double > & outputOffsets,
te::rst::Raster & outRaster )
protected

◆ CreateOutRaster()

bool te::rp::AssistedHarmonization::CreateOutRaster ( const te::mem::CachedRaster & adjInputCRaster,
const std::vector< double > & gains,
const std::vector< double > & inputOffsets,
const std::vector< double > & outputOffsets,
AssistedHarmonization::OutputParameters * outParamsPtr )
protected

◆ execute()

bool te::rp::AssistedHarmonization::execute ( AlgorithmOutputParameters & outputParams)
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.

References getErrorMessage().

Referenced by getErrorMessage().

◆ getRasterStatistics()

bool te::rp::AssistedHarmonization::getRasterStatistics ( const te::rst::Raster & inputRaster,
const std::vector< unsigned int > & inputRasterBandsIndexes,
const InputParameters::TargetAreasContT & targetAreas,
std::map< InputParameters::TargetAreasClassIDT, unsigned int > & samplesNumber,
std::map< unsigned int, std::vector< double > > & means,
std::map< unsigned int, std::vector< double > > & stdDevs ) const
protected

◆ initialize()

bool te::rp::AssistedHarmonization::initialize ( const AlgorithmInputParameters & inputParams)
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::AssistedHarmonization::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.

◆ linearRegression()

bool te::rp::AssistedHarmonization::linearRegression ( std::vector< std::pair< double, double > > & coords,
double & a,
double & b )
protected

◆ MeanStdHMethodImp()

bool te::rp::AssistedHarmonization::MeanStdHMethodImp ( const te::mem::CachedRaster & refInputCRaster,
const te::mem::CachedRaster & adjInputCRaster,
const InputParameters::TargetAreasContT & referenceTargetAreasReproj,
const InputParameters::TargetAreasContT & adjustTargetAreasReproj,
AssistedHarmonization::OutputParameters * outParamsPtr )
protected

◆ MSEHMethodImp()

bool te::rp::AssistedHarmonization::MSEHMethodImp ( const te::mem::CachedRaster & refInputCRaster,
const te::mem::CachedRaster & adjInputCRaster,
const InputParameters::TargetAreasContT & referenceTargetAreasReproj,
const InputParameters::TargetAreasContT & adjustTargetAreasReproj,
AssistedHarmonization::OutputParameters * outParamsPtr )
protected

◆ reprojectGeometries()

void te::rp::AssistedHarmonization::reprojectGeometries ( const AssistedHarmonization::InputParameters::TargetAreasContT & inGeoms,
AssistedHarmonization::InputParameters::TargetAreasContT & outGeoms,
boost::ptr_vector< InputParameters::TargetAreasGeomT > & outGeomHandler,
const int targetSRID )
protected

◆ reset()

void te::rp::AssistedHarmonization::reset ( )
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;

References setErrorMessage().

Referenced by setErrorMessage().

Member Data Documentation

◆ m_errorMessage

std::string te::rp::Algorithm::m_errorMessage
privateinherited

Current error message.

Definition at line 104 of file Algorithm.h.

◆ m_inputParameters

AssistedHarmonization::InputParameters te::rp::AssistedHarmonization::m_inputParameters
protected

Input execution parameters.

Definition at line 164 of file AssistedHarmonization.h.

◆ m_isInitialized

bool te::rp::AssistedHarmonization::m_isInitialized
protected

Tells if this instance is initialized.

Definition at line 166 of file AssistedHarmonization.h.


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