te::rp::Segmenter Class Reference

Raster segmentation. More...

#include <Segmenter.h>

Inheritance diagram for te::rp::Segmenter:
te::rp::Algorithm

Classes

class  InputParameters
 Segmenter Input Parameters. More...
 
class  OutputParameters
 Segmenter Output Parameters. More...
 
class  SegmenterThreadEntryParams
 The parameters passed to the Segmenter::segmenterthreadEntry method. More...
 

Public Member Functions

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...
 
 Segmenter ()
 
 ~Segmenter ()
 

Protected Types

typedef te::rp::Matrix< SegmenterSegmentsBlockSegmentsBlocksMatrixT
 

Protected Member Functions

bool calcBestBlockSize (const unsigned int minExapandedBlockPixels, const unsigned int maxExapandedBlockPixels, unsigned int &blocksHOverlapSize, unsigned int &blocksVOverlapSize, unsigned int &nonExpandedBlockWidth, unsigned int &nonExpandedBlockHeight, unsigned int &expandedBlockWidth, unsigned int &expandedBlockHeight) const
 Calc the best sub-image block size for each thread to process. More...
 
bool createCutOffLinesTiff (const std::vector< std::vector< unsigned int > > &imageHorizontalProfiles, const std::vector< unsigned int > &imageHorizontalProfilesCenterLines, const std::vector< std::vector< unsigned int > > &imageVerticalProfiles, const std::vector< unsigned int > &imageVerticalProfilesCenterLines, const std::string &filename)
 
bool genImageHCutOffProfile (const unsigned int profileCenter, const te::rst::Raster &inRaster, const std::vector< unsigned int > &inRasterBands, const unsigned int pixelNeighborhoodSize, const unsigned int tileNeighborhoodSize, const unsigned int profileAntiSmoothingFactor, std::vector< unsigned int > &profile) const
 Generate the horizontal cutOff prifles for the entire image.. More...
 
bool genImageVCutOffProfile (const unsigned int profileCenter, const te::rst::Raster &inRaster, const std::vector< unsigned int > &inRasterBands, const unsigned int pixelNeighborhoodSize, const unsigned int tileNeighborhoodSize, const unsigned int profileAntiSmoothingFactor, std::vector< unsigned int > &profile) const
 Generate the vertical cutOff prifles for the entire image.. More...
 
void setErrorMessage (const std::string &newErrorMessage)
 Set the current error message. More...
 
bool updateBlockCutOffProfiles (const std::vector< std::vector< unsigned int > > &imageHorizontalProfiles, const std::vector< std::vector< unsigned int > > &imageVerticalProfiles, SegmenterSegmentsBlock &segmentsBlock) const
 Update the block cutOff profiles using the full image profiles. More...
 

Static Protected Member Functions

static void segmenterThreadEntry (SegmenterThreadEntryParams *paramsPtr)
 Segmenter thread entry. More...
 

Protected Attributes

Segmenter::InputParameters m_inputParameters
 Segmenter execution parameters. More...
 
bool m_instanceInitialized
 

Detailed Description

Raster segmentation.

Raster segmentation following the choosed segmentation strategy.

Note
The created label image will be written to the raster instance pointed by m_outRasterPtr (in this case the output band must also be passed by m_outRasterBand ); or written to a new raster instance created inside the given data source pointed by m_outDataSourcePtr (in this case the data set name must be supplied - m_outDataSetName ).
See also
te::rp::Segmenter::Parameters For detailed parameters description.
te::rp::SegmenterStrategy For detailed parameters description.

Definition at line 73 of file Segmenter.h.

Member Typedef Documentation

◆ SegmentsBlocksMatrixT

Segments blocks matrix type definition

Definition at line 194 of file Segmenter.h.

Constructor & Destructor Documentation

◆ Segmenter()

te::rp::Segmenter::Segmenter ( )

◆ ~Segmenter()

te::rp::Segmenter::~Segmenter ( )

Member Function Documentation

◆ calcBestBlockSize()

bool te::rp::Segmenter::calcBestBlockSize ( const unsigned int  minExapandedBlockPixels,
const unsigned int  maxExapandedBlockPixels,
unsigned int &  blocksHOverlapSize,
unsigned int &  blocksVOverlapSize,
unsigned int &  nonExpandedBlockWidth,
unsigned int &  nonExpandedBlockHeight,
unsigned int &  expandedBlockWidth,
unsigned int &  expandedBlockHeight 
) const
protected

Calc the best sub-image block size for each thread to process.

Parameters
minBlockPixelsThe minimun allowed pixels number for each block (expanded block).
maxBlockPixelsThe maximum allowed pixels number for each block (expanded block).
blocksHOverlapSizeThe blocks horizontal overlap size (number of columns).
blocksVOverlapSizeThe blocks vertical overlap size (number of rows).
nonExpandedBlockWidthThe calculated non-expanded block width (non-expanded block).
nonExpandedBlockHeightThe calculated non-expanded block height (non-expanded block).
expandedBlockWidthThe calculated expanded block width (non-expanded block).
expandedBlockHeightThe calculated expanded block height (non-expanded block).
Returns
true if OK, false on errors.

◆ createCutOffLinesTiff()

bool te::rp::Segmenter::createCutOffLinesTiff ( const std::vector< std::vector< unsigned int > > &  imageHorizontalProfiles,
const std::vector< unsigned int > &  imageHorizontalProfilesCenterLines,
const std::vector< std::vector< unsigned int > > &  imageVerticalProfiles,
const std::vector< unsigned int > &  imageVerticalProfilesCenterLines,
const std::string &  filename 
)
protected

◆ execute()

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

◆ genImageHCutOffProfile()

bool te::rp::Segmenter::genImageHCutOffProfile ( const unsigned int  profileCenter,
const te::rst::Raster inRaster,
const std::vector< unsigned int > &  inRasterBands,
const unsigned int  pixelNeighborhoodSize,
const unsigned int  tileNeighborhoodSize,
const unsigned int  profileAntiSmoothingFactor,
std::vector< unsigned int > &  profile 
) const
protected

Generate the horizontal cutOff prifles for the entire image..

Parameters
profileCenterThe profile center line.
inRasterThe input raster.
inRasterBandsThe input raster bands.
pixelNeighborhoodSizeThe pixel neighborhood size over the line transverse to each tile line.
tileNeighborhoodSizeThe buffer size around each tile.
profileAntiSmoothingFactorA positive profile anti-smoothing factor.
profileThe generated profile (each element is a inRaster line index ).
Returns
true if OK, false on errors.

◆ genImageVCutOffProfile()

bool te::rp::Segmenter::genImageVCutOffProfile ( const unsigned int  profileCenter,
const te::rst::Raster inRaster,
const std::vector< unsigned int > &  inRasterBands,
const unsigned int  pixelNeighborhoodSize,
const unsigned int  tileNeighborhoodSize,
const unsigned int  profileAntiSmoothingFactor,
std::vector< unsigned int > &  profile 
) const
protected

Generate the vertical cutOff prifles for the entire image..

Parameters
profileCenterThe profile center column.
inRasterThe input raster.
inRasterBandsThe input raster bands.
pixelNeighborhoodSizeThe pixel neighborhood size over the line transverse to each tile line.
tileNeighborhoodSizeThe buffer size around each tile.
profileAntiSmoothingFactorA positive profile anti-smoothing factor.
profileThe generated profile (each element is a inRaster column index )
Returns
true if OK, false on errors.

◆ 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::Segmenter::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::Segmenter::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::Segmenter::reset ( )
throw (te::rp::Exception
)
virtual

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

Reimplemented from te::rp::Algorithm.

◆ segmenterThreadEntry()

static void te::rp::Segmenter::segmenterThreadEntry ( SegmenterThreadEntryParams paramsPtr)
staticprotected

Segmenter thread entry.

Parameters
paramsPtrA pointer to the segmenter thread parameters.

◆ setErrorMessage()

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

Set the current error message.

Parameters
newErrorMessageNew error message;

◆ updateBlockCutOffProfiles()

bool te::rp::Segmenter::updateBlockCutOffProfiles ( const std::vector< std::vector< unsigned int > > &  imageHorizontalProfiles,
const std::vector< std::vector< unsigned int > > &  imageVerticalProfiles,
SegmenterSegmentsBlock segmentsBlock 
) const
protected

Update the block cutOff profiles using the full image profiles.

Parameters
imageVerticalProfilesThe generated horizontal profiles (empty profiles also will be accepted).
horizontalProfilesThe generated vertical profiles (empty profiles also will be accepted).
segmentsBlockThe block to update.
Returns
true if OK, false on errors.

Member Data Documentation

◆ m_inputParameters

Segmenter::InputParameters te::rp::Segmenter::m_inputParameters
protected

Segmenter execution parameters.

Definition at line 260 of file Segmenter.h.

◆ m_instanceInitialized

bool te::rp::Segmenter::m_instanceInitialized
protected

Definition at line 258 of file Segmenter.h.


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