This file contains a class that represents the method to remove pixels from classified image.
More...
#include <MajorityFilter.h>
|
void | find4Neighbors (te::rst::Band &dstBand, unsigned int col, unsigned int row, int *contClass) |
| Find the neighbors (right, down, left and up) of the pixel located in a given column and row. This function is used in the full filter. More...
|
|
void | find8Neighbors (te::rst::Band &dstBand, unsigned int col, unsigned int row, int *contClass) |
| Find the eight neighbors of the pixel located in a given column and row. This function is used in the full filter. More...
|
|
void | findNeighbors (te::rst::Band &dstBand, unsigned int lcol, unsigned int lrow, unsigned int col, unsigned int row, int &index, int &totalPixel, int *contClass, std::vector< int > &veccol, std::vector< int > &vecrow) |
| Find the neighbors (right, down, left and up) of the pixel located in a given column and row. This function is used in the simple filter. More...
|
|
bool | FullFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, const unsigned int dstBandIdx, const bool useProgress) |
| Apply the full majority filter over the source raster band. More...
|
|
void | setErrorMessage (const std::string &newErrorMessage) |
| Set the current error message. More...
|
|
bool | SimpleFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, const unsigned int dstBandIdx, const bool useProgress) |
| Apply the simple majority filter over the source raster band. More...
|
|
This file contains a class that represents the method to remove pixels from classified image.
Definition at line 43 of file MajorityFilter.h.
◆ MajorityFilter()
te::rp::MajorityFilter::MajorityFilter |
( |
| ) |
|
◆ ~MajorityFilter()
te::rp::MajorityFilter::~MajorityFilter |
( |
| ) |
|
◆ execute()
Executes the algorithm using the supplied parameters.
- Parameters
-
outputParams | Output parameters. |
- Returns
- true if OK, false on errors.
- Note
- A return error string can be obtained via Algorithm::getErrorMessage()
Implements te::rp::Algorithm.
◆ find4Neighbors()
void te::rp::MajorityFilter::find4Neighbors |
( |
te::rst::Band & |
dstBand, |
|
|
unsigned int |
col, |
|
|
unsigned int |
row, |
|
|
int * |
contClass |
|
) |
| |
|
protected |
Find the neighbors (right, down, left and up) of the pixel located in a given column and row. This function is used in the full filter.
- Parameters
-
dstBand | Output raster band. |
col | Column of the current pixel |
row | Row of the current pixel |
contClass | Used to store the frequency of the classes |
◆ find8Neighbors()
void te::rp::MajorityFilter::find8Neighbors |
( |
te::rst::Band & |
dstBand, |
|
|
unsigned int |
col, |
|
|
unsigned int |
row, |
|
|
int * |
contClass |
|
) |
| |
|
protected |
Find the eight neighbors of the pixel located in a given column and row. This function is used in the full filter.
- Parameters
-
dstBand | Output raster band. |
col | Column of the current pixel |
row | Row of the current pixel |
contClass | Used to store the frequency of the classes |
◆ findNeighbors()
void te::rp::MajorityFilter::findNeighbors |
( |
te::rst::Band & |
dstBand, |
|
|
unsigned int |
lcol, |
|
|
unsigned int |
lrow, |
|
|
unsigned int |
col, |
|
|
unsigned int |
row, |
|
|
int & |
index, |
|
|
int & |
totalPixel, |
|
|
int * |
contClass, |
|
|
std::vector< int > & |
veccol, |
|
|
std::vector< int > & |
vecrow |
|
) |
| |
|
protected |
Find the neighbors (right, down, left and up) of the pixel located in a given column and row. This function is used in the simple filter.
- Parameters
-
dstBand | Output raster band. |
lcol | Column of the current pixel |
lrow | Row of the current pixel |
col | Column of the neighbor pixel |
row | Row of the neighbor pixel |
index | Index from vector of columns and rows |
totalPixel | Total pixels found with same class as the current pixel |
contClass | Used to store the frequency of the classes |
veccol | Vector to store the columns of the pixels to change the class |
vecrow | Vector to store the rows of the pixels to change the class |
◆ FullFilter()
bool te::rp::MajorityFilter::FullFilter |
( |
const te::rst::Raster & |
srcRaster, |
|
|
const unsigned int |
srcBandIdx, |
|
|
const unsigned int |
dstBandIdx, |
|
|
const bool |
useProgress |
|
) |
| |
|
protected |
Apply the full majority filter over the source raster band.
- Parameters
-
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
◆ 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()
Initialize the algorithm instance making it ready for execution.
- Parameters
-
inputParams | Input 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::MajorityFilter::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.
◆ reset()
void te::rp::MajorityFilter::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
-
newErrorMessage | New error message; |
◆ SimpleFilter()
bool te::rp::MajorityFilter::SimpleFilter |
( |
const te::rst::Raster & |
srcRaster, |
|
|
const unsigned int |
srcBandIdx, |
|
|
const unsigned int |
dstBandIdx, |
|
|
const bool |
useProgress |
|
) |
| |
|
protected |
Apply the simple majority filter over the source raster band.
- Parameters
-
srcRaster | Source raster. |
srcBandIdx | Source raster band index. |
dstBandIdx | Destination raster band index. |
useProgress | if true, the progress interface must be used. |
◆ m_errorMessage
std::string te::rp::Algorithm::m_errorMessage |
|
privateinherited |
◆ m_inputParameters
◆ m_isInitialized
bool te::rp::MajorityFilter::m_isInitialized |
|
protected |
◆ m_outputRaster
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_release/src/terralib/rp/MajorityFilter.h