A series of well-known filtering algorithms for images, linear and non-linear.. More...
#include <Filter.h>
Classes | |
class | InputParameters |
Filter input parameters. More... | |
class | OutputParameters |
Filter output parameters. More... | |
Public Member Functions | |
bool | execute (AlgorithmOutputParameters &outputParams) throw ( te::rp::Exception ) |
Executes the algorithm using the supplied parameters. More... | |
Filter () | |
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... | |
~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... | |
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... | |
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... | |
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 | |
Filter::InputParameters | m_inputParameters |
Input parameters. More... | |
bool | m_isInitialized |
Is this instance already initialized? More... | |
A series of well-known filtering algorithms for images, linear and non-linear..
|
protected |
Type definition for a filter method pointer.
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstRaster | Destination raster. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
Filter::Filter | ( | ) |
Definition at line 136 of file Filter.cpp.
References reset().
Filter::~Filter | ( | ) |
Definition at line 141 of file Filter.cpp.
|
protected |
Applay the dilation filter over the source raster band.
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstRaster | Destination raster. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
Definition at line 905 of file Filter.cpp.
References te::rst::BandIteratorWindow< T >::begin(), te::rst::BandIteratorWindow< T >::end(), te::rst::Raster::getBand(), te::rst::BandIteratorWindow< T >::getColumn(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandIteratorWindow< T >::getRow(), te::rst::BandProperty::getType(), te::rst::BandIteratorWindow< T >::getValue(), m_inputParameters, te::rp::Filter::InputParameters::m_windowH, te::rp::Filter::InputParameters::m_windowW, te::rst::Raster::setValue(), TE_TR, TERP_DEBUG_TRUE_OR_THROW, and te::common::TaskProgress::UNDEFINED.
Referenced by execute().
|
protected |
Applay the erosion filter over the source raster band.
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstRaster | Destination raster. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
Definition at line 981 of file Filter.cpp.
References te::rst::BandIteratorWindow< T >::begin(), te::rst::BandIteratorWindow< T >::end(), te::rst::Raster::getBand(), te::rst::BandIteratorWindow< T >::getColumn(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandIteratorWindow< T >::getRow(), te::rst::BandProperty::getType(), te::rst::BandIteratorWindow< T >::getValue(), m_inputParameters, te::rp::Filter::InputParameters::m_windowH, te::rp::Filter::InputParameters::m_windowW, te::rst::Raster::setValue(), TE_TR, TERP_DEBUG_TRUE_OR_THROW, and te::common::TaskProgress::UNDEFINED.
Referenced by execute().
|
virtual |
Executes the algorithm using the supplied parameters.
outputParams | Output parameters. |
Implements te::rp::Algorithm.
Definition at line 145 of file Filter.cpp.
References DilationFilter(), te::rp::Filter::InputParameters::DilationFilterT, te::dt::DOUBLE_TYPE, ErosionFilter(), te::rp::Filter::InputParameters::ErosionFilterT, te::rst::Raster::getBand(), te::rst::Raster::getGrid(), te::rst::Raster::getNumberOfBands(), te::rst::Band::getProperty(), te::rp::Filter::InputParameters::m_enableProgress, te::rp::Filter::InputParameters::m_filterType, m_inputParameters, te::rp::Filter::InputParameters::m_inRasterBands, te::rp::Filter::InputParameters::m_inRasterPtr, m_isInitialized, te::rp::Filter::InputParameters::m_iterationsNumber, te::rp::Filter::OutputParameters::m_outputRasterPtr, te::rp::Filter::OutputParameters::m_rInfo, te::rp::Filter::OutputParameters::m_rType, te::rst::RasterFactory::make(), MeanFilter(), te::rp::Filter::InputParameters::MeanFilterT, MedianFilter(), te::rp::Filter::InputParameters::MedianFilterT, ModeFilter(), te::rp::Filter::InputParameters::ModeFilterT, RobertsFilter(), te::rp::Filter::InputParameters::RobertsFilterT, SobelFilter(), te::rp::Filter::InputParameters::SobelFilterT, TE_TR, TERP_LOG_AND_RETURN_FALSE, TERP_LOG_AND_THROW, TERP_TRUE_OR_RETURN_FALSE, TERP_TRUE_OR_THROW, te::common::TaskProgress::UNDEFINED, UserDefinedFilter(), and te::rp::Filter::InputParameters::UserDefinedWindowT.
Referenced by te::qt::widgets::FilterWizardPage::apply(), and te::qt::widgets::FilterWizard::execute().
|
virtual |
Initialize the algorithm instance making it ready for execution.
inputParams | Input parameters. |
Implements te::rp::Algorithm.
Definition at line 365 of file Filter.cpp.
References te::rst::Raster::getAccessPolicy(), te::rst::Raster::getNumberOfBands(), te::rp::Filter::InputParameters::InvalidFilterT, te::rp::Filter::InputParameters::m_filterType, m_inputParameters, te::rp::Filter::InputParameters::m_inRasterBands, te::rp::Filter::InputParameters::m_inRasterPtr, m_isInitialized, te::rp::Filter::InputParameters::m_iterationsNumber, te::rp::Filter::InputParameters::m_window, te::rp::Filter::InputParameters::m_windowH, te::rp::Filter::InputParameters::m_windowW, te::common::RAccess, reset(), TE_TR, TERP_TRUE_OR_RETURN_FALSE, and te::rp::Filter::InputParameters::UserDefinedWindowT.
Referenced by te::qt::widgets::FilterWizardPage::apply(), and te::qt::widgets::FilterWizard::execute().
|
virtual |
Returns true if the algorithm instance is initialized and ready for execution.
Implements te::rp::Algorithm.
Definition at line 423 of file Filter.cpp.
References m_isInitialized.
|
protected |
Applay the mean filter over the source raster band.
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstRaster | Destination raster. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
Definition at line 681 of file Filter.cpp.
References te::rst::BandIteratorWindow< T >::begin(), te::rst::BandIteratorWindow< T >::end(), te::rst::Raster::getBand(), te::rst::BandIteratorWindow< T >::getColumn(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandIteratorWindow< T >::getRow(), te::rst::BandProperty::getType(), te::rst::BandIteratorWindow< T >::getValue(), m_inputParameters, te::rp::Filter::InputParameters::m_windowH, te::rp::Filter::InputParameters::m_windowW, te::rst::Raster::setValue(), TE_TR, TERP_DEBUG_TRUE_OR_THROW, and te::common::TaskProgress::UNDEFINED.
Referenced by execute().
|
protected |
Applay the median filter over the source raster band.
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstRaster | Destination raster. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
Definition at line 829 of file Filter.cpp.
References te::rst::BandIteratorWindow< T >::begin(), te::rst::BandIteratorWindow< T >::end(), te::rst::Raster::getBand(), te::rst::BandIteratorWindow< T >::getColumn(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandIteratorWindow< T >::getRow(), te::rst::BandProperty::getType(), te::rst::BandIteratorWindow< T >::getValue(), m_inputParameters, te::rp::Filter::InputParameters::m_windowH, te::rp::Filter::InputParameters::m_windowW, OrderFunction(), te::rst::Raster::setValue(), TE_TR, TERP_DEBUG_TRUE_OR_THROW, and te::common::TaskProgress::UNDEFINED.
Referenced by execute().
|
protected |
Applay the mode filter over the source raster band.
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstRaster | Destination raster. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
Definition at line 755 of file Filter.cpp.
References te::rst::BandIteratorWindow< T >::begin(), te::rst::BandIteratorWindow< T >::end(), te::rst::Raster::getBand(), te::rst::BandIteratorWindow< T >::getColumn(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandIteratorWindow< T >::getRow(), te::rst::BandProperty::getType(), te::rst::BandIteratorWindow< T >::getValue(), m_inputParameters, te::rp::Filter::InputParameters::m_windowH, te::rp::Filter::InputParameters::m_windowW, te::stat::Mode(), te::rst::Raster::setValue(), TE_TR, TERP_DEBUG_TRUE_OR_THROW, and te::common::TaskProgress::UNDEFINED.
Referenced by execute().
|
staticprotected |
Returns true if i < j.
Definition at line 1126 of file Filter.cpp.
Referenced by MedianFilter().
|
virtual |
Clear all internal allocated objects and reset the algorithm to its initial state.
Implements te::rp::Algorithm.
Definition at line 359 of file Filter.cpp.
References m_inputParameters, m_isInitialized, and te::rp::Filter::InputParameters::reset().
Referenced by Filter(), initialize(), te::rp::Filter::InputParameters::InputParameters(), te::rp::Filter::InputParameters::operator=(), te::rp::Filter::OutputParameters::operator=(), te::rp::Filter::OutputParameters::OutputParameters(), te::rp::Filter::InputParameters::~InputParameters(), and te::rp::Filter::OutputParameters::~OutputParameters().
|
protected |
Applay the Roberts filter over the source raster band.
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstRaster | Destination raster. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
Definition at line 428 of file Filter.cpp.
References te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rst::Band::getValue(), te::rst::BandProperty::m_noDataValue, te::rst::Band::setValue(), TE_TR, TERP_DEBUG_TRUE_OR_THROW, and te::common::TaskProgress::UNDEFINED.
Referenced by execute().
|
protected |
Applay the Sobel filter over the source raster band.
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstRaster | Destination raster. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
Definition at line 537 of file Filter.cpp.
References te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rst::Band::getValue(), te::rst::BandProperty::m_noDataValue, te::rst::Band::setValue(), TE_TR, TERP_DEBUG_TRUE_OR_THROW, and te::common::TaskProgress::UNDEFINED.
Referenced by execute().
|
protected |
Applay the user defined filter over the source raster band.
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstRaster | Destination raster. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
Definition at line 1057 of file Filter.cpp.
References te::rst::BandIteratorWindow< T >::begin(), te::rst::BandIteratorWindow< T >::end(), te::rst::Raster::getBand(), te::rst::BandIteratorWindow< T >::getColumn(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandIteratorWindow< T >::getRow(), te::rst::BandProperty::getType(), te::rst::BandIteratorWindow< T >::getValue(), m_inputParameters, te::rp::Filter::InputParameters::m_window, te::rp::Filter::InputParameters::m_windowH, te::rp::Filter::InputParameters::m_windowW, te::rst::Raster::setValue(), TE_TR, TERP_DEBUG_TRUE_OR_THROW, and te::common::TaskProgress::UNDEFINED.
Referenced by execute().
|
protected |
Input parameters.
Definition at line 168 of file Filter.h.
Referenced by DilationFilter(), ErosionFilter(), execute(), initialize(), MeanFilter(), MedianFilter(), ModeFilter(), reset(), and UserDefinedFilter().
|
protected |
Is this instance already initialized?
Definition at line 166 of file Filter.h.
Referenced by execute(), initialize(), isInitialized(), and reset().