A series of well-known filtering algorithms for images, linear and non-linear.. More...

#include <Filter.h>

Inheritance diagram for te::rp::Filter:
te::rp::Algorithm

Classes

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

Public Member Functions

bool execute (AlgorithmOutputParameters &outputParams) _NOEXCEPT_OP(false)
 Executes the algorithm using the supplied parameters. More...
 
 Filter ()
 
const std::string & getErrorMessage () const
 Return the current error message if there is any. More...
 
bool initialize (const AlgorithmInputParameters &inputParams) _NOEXCEPT_OP(false)
 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 () _NOEXCEPT_OP(false)
 Clear all internal allocated objects and reset the algorithm to its initial state. More...
 
 ~Filter ()
 

Protected Types

typedef bool(Filter::* FilterMethodPointerT) (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Type definition for a filter method pointer. More...
 

Protected Member Functions

bool DilationFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the dilation filter over the source raster band. More...
 
bool ErosionFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the erosion filter over the source raster band. More...
 
bool MeanFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the mean filter over the source raster band. More...
 
bool MedianFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the median filter over the source raster band. More...
 
bool ModeFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the mode filter over the source raster band. More...
 
void ResetConvBuffer (unsigned int lines, unsigned int columns)
 Resets the convolution buffer. More...
 
void ResetConvMatrix (unsigned int lines, unsigned int columns)
 Resets the convolution matrix. More...
 
bool RobertsFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the Roberts filter over the source raster band. More...
 
void setErrorMessage (const std::string &newErrorMessage)
 Set the current error message. More...
 
void setMorfConvMatrix ()
 Reset the convolution matrix and fills it with the user supplied matrix or with 1's if that matrix wasn't supplied. More...
 
bool SobelFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the Sobel filter over the source raster band. More...
 
void UpdateConvBuffer (const te::rst::Band &inBand, unsigned int line)
 Updates the convolution buffer with a new raster line (rool up + read new raster line). More...
 
bool UserDefinedFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the user defined filter over the source raster band. More...
 

Static Protected Member Functions

static bool OrderFunction (double i, double j)
 Returns true if i < j. More...
 

Protected Attributes

double ** m_convBuffer
 Convolution Buffer. More...
 
unsigned int m_convBufferColumns
 Convolution Buffer columns. More...
 
unsigned int m_convBufferLines
 Convolution Buffer lines. More...
 
double ** m_convMatrix
 Convolution matrix element. More...
 
unsigned int m_convMatrixColumns
 Convolution matrix element columns.
More...
 
unsigned int m_convMatrixLines
 Convolution matrix element lines. More...
 
Filter::InputParameters m_inputParameters
 Input parameters. More...
 
bool m_isInitialized
 Is this instance already initialized? More...
 

Private Attributes

std::string m_errorMessage
 Current error message. More...
 

Detailed Description

A series of well-known filtering algorithms for images, linear and non-linear..

Definition at line 47 of file Filter.h.

Member Typedef Documentation

◆ FilterMethodPointerT

typedef bool(Filter::* te::rp::Filter::FilterMethodPointerT) (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
protected

Type definition for a filter method pointer.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.
Returns
true if ok, false on errors.

Definition at line 164 of file Filter.h.

Constructor & Destructor Documentation

◆ Filter()

te::rp::Filter::Filter ( )

◆ ~Filter()

te::rp::Filter::~Filter ( )

Member Function Documentation

◆ DilationFilter()

bool te::rp::Filter::DilationFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Applay the dilation filter over the source raster band.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.

◆ ErosionFilter()

bool te::rp::Filter::ErosionFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Applay the erosion filter over the source raster band.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.

◆ execute()

bool te::rp::Filter::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.

◆ initialize()

bool te::rp::Filter::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::Filter::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.

◆ MeanFilter()

bool te::rp::Filter::MeanFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Applay the mean filter over the source raster band.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.

◆ MedianFilter()

bool te::rp::Filter::MedianFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Applay the median filter over the source raster band.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.

◆ ModeFilter()

bool te::rp::Filter::ModeFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Applay the mode filter over the source raster band.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.

◆ OrderFunction()

static bool te::rp::Filter::OrderFunction ( double  i,
double  j 
)
staticprotected

Returns true if i < j.

Returns
Returns true if i < j.

◆ reset()

void te::rp::Filter::reset ( )
virtual

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

Reimplemented from te::rp::Algorithm.

◆ ResetConvBuffer()

void te::rp::Filter::ResetConvBuffer ( unsigned int  lines,
unsigned int  columns 
)
protected

Resets the convolution buffer.

Parameters
linesConvolution buffer lines.
columnsConvolution buffer columns.

◆ ResetConvMatrix()

void te::rp::Filter::ResetConvMatrix ( unsigned int  lines,
unsigned int  columns 
)
protected

Resets the convolution matrix.

Parameters
linesConvolution matrix lines.
columnsConvolution matrix columns.

◆ RobertsFilter()

bool te::rp::Filter::RobertsFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Applay the Roberts filter over the source raster band.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.

◆ setErrorMessage()

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

Set the current error message.

Parameters
newErrorMessageNew error message;

◆ setMorfConvMatrix()

void te::rp::Filter::setMorfConvMatrix ( )
protected

Reset the convolution matrix and fills it with the user supplied matrix or with 1's if that matrix wasn't supplied.

◆ SobelFilter()

bool te::rp::Filter::SobelFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Applay the Sobel filter over the source raster band.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.

◆ UpdateConvBuffer()

void te::rp::Filter::UpdateConvBuffer ( const te::rst::Band inBand,
unsigned int  line 
)
protected

Updates the convolution buffer with a new raster line (rool up + read new raster line).

Parameters
inBandSource raster band.
lineRaster line.
bandRaster band.

◆ UserDefinedFilter()

bool te::rp::Filter::UserDefinedFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Applay the user defined filter over the source raster band.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.

Member Data Documentation

◆ m_convBuffer

double** te::rp::Filter::m_convBuffer
protected

Convolution Buffer.

Definition at line 172 of file Filter.h.

◆ m_convBufferColumns

unsigned int te::rp::Filter::m_convBufferColumns
protected

Convolution Buffer columns.

Definition at line 176 of file Filter.h.

◆ m_convBufferLines

unsigned int te::rp::Filter::m_convBufferLines
protected

Convolution Buffer lines.

Definition at line 174 of file Filter.h.

◆ m_convMatrix

double** te::rp::Filter::m_convMatrix
protected

Convolution matrix element.

Definition at line 178 of file Filter.h.

◆ m_convMatrixColumns

unsigned int te::rp::Filter::m_convMatrixColumns
protected

Convolution matrix element columns.

Definition at line 182 of file Filter.h.

◆ m_convMatrixLines

unsigned int te::rp::Filter::m_convMatrixLines
protected

Convolution matrix element lines.

Definition at line 180 of file Filter.h.

◆ m_errorMessage

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

Current error message.

Definition at line 104 of file Algorithm.h.

◆ m_inputParameters

Filter::InputParameters te::rp::Filter::m_inputParameters
protected

Input parameters.

Definition at line 170 of file Filter.h.

◆ m_isInitialized

bool te::rp::Filter::m_isInitialized
protected

Is this instance already initialized?

Definition at line 168 of file Filter.h.


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