te::rp::SegmenterRegionGrowingBaatzStrategy Class Reference

Raster region growing segmenter strategy. More...

#include <SegmenterRegionGrowingBaatzStrategy.h>

Inheritance diagram for te::rp::SegmenterRegionGrowingBaatzStrategy:
te::rp::SegmenterStrategy

Classes

class  Parameters
 Segmenter Parameters. More...
 

Public Types

enum  BlocksMergingMethod { NoMerging = 0, GradientMerging = 1 }
 Blocks merging method. More...
 

Public Member Functions

bool execute (SegmenterIdsManager &segmenterIdsManager, const te::rp::SegmenterSegmentsBlock &block2ProcessInfo, const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, const std::vector< std::complex< double > > &inputRasterNoDataValues, const std::vector< std::complex< double > > &inputRasterBandMinValues, const std::vector< std::complex< double > > &inputRasterBandMaxValues, te::rst::Raster &outputRaster, const unsigned int outputRasterBand, const bool enableProgressInterface) throw ( te::rp::Exception )
 Executes the segmentation strategy over region delimited by the given block. More...
 
BlocksMergingMethod getBlocksMergingMethod () const
 Return the strategy blocks merging method. More...
 
double getMemUsageEstimation (const unsigned int bandsToProcess, const unsigned int pixelsNumber) const
 Returns a memory estimation (bytes). More...
 
unsigned int getOptimalBlocksOverlapSize () const
 Returns a optimal blocks overlap size (number of border pixels overlapped between blocks, under one direction). More...
 
bool initialize (SegmenterStrategyParameters const *const strategyParams) throw ( te::rp::Exception )
 Initialize the segmentation strategy. More...
 
void reset ()
 Clear all internal allocated resources and go back to the initial not-initialized state. More...
 
 SegmenterRegionGrowingBaatzStrategy ()
 
bool shouldComputeMinMaxValues () const
 Returns if the min and max pixel values should be computed. More...
 
 ~SegmenterRegionGrowingBaatzStrategy ()
 

Protected Types

typedef Matrix< SegmenterSegmentsBlock::SegmentIdDataTypeSegmentsIdsMatrixT
 Internal segments ids matrix type definition. More...
 

Protected Member Functions

bool initializeSegments (SegmenterIdsManager &segmenterIdsManager, const te::rp::SegmenterSegmentsBlock &block2ProcessInfo, const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, const std::vector< std::complex< double > > &inputRasterNoDataValues, const std::vector< std::complex< double > > &inputRasterBandMinValues, const std::vector< std::complex< double > > &inputRasterBandMaxValues, SegmenterRegionGrowingSegment< rg::BaatzFeatureType > **actSegsListHeadPtr)
 Initialize the segment objects container and the segment IDs container. More...
 

Protected Attributes

bool m_isInitialized
 true if this instance is initialized. More...
 
SegmenterRegionGrowingBaatzStrategy::Parameters m_parameters
 Internal execution parameters. More...
 
SegmentsIdsMatrixT m_segmentsIdsMatrix
 A internal segments IDs matrix that can be reused on each strategy execution. More...
 
SegmenterRegionGrowingSegmentsPool< rg::BaatzFeatureTypem_segmentsPool
 A pool of segments that can be reused on each strategy execution. More...
 

Detailed Description

Raster region growing segmenter strategy.

Definition at line 52 of file SegmenterRegionGrowingBaatzStrategy.h.

Member Typedef Documentation

Internal segments ids matrix type definition.

Definition at line 148 of file SegmenterRegionGrowingBaatzStrategy.h.

Member Enumeration Documentation

Blocks merging method.

Enumerator
NoMerging 

No merging.

GradientMerging 

Gradient Merging.

Definition at line 52 of file SegmenterStrategy.h.

Constructor & Destructor Documentation

te::rp::SegmenterRegionGrowingBaatzStrategy::~SegmenterRegionGrowingBaatzStrategy ( )
te::rp::SegmenterRegionGrowingBaatzStrategy::SegmenterRegionGrowingBaatzStrategy ( )

Member Function Documentation

bool te::rp::SegmenterRegionGrowingBaatzStrategy::execute ( SegmenterIdsManager segmenterIdsManager,
const te::rp::SegmenterSegmentsBlock block2ProcessInfo,
const te::rst::Raster inputRaster,
const std::vector< unsigned int > &  inputRasterBands,
const std::vector< std::complex< double > > &  inputRasterNoDataValues,
const std::vector< std::complex< double > > &  inputRasterBandMinValues,
const std::vector< std::complex< double > > &  inputRasterBandMaxValues,
te::rst::Raster outputRaster,
const unsigned int  outputRasterBand,
const bool  enableProgressInterface 
)
throw (te::rp::Exception
)
virtual

Executes the segmentation strategy over region delimited by the given block.

Parameters
segmenterIdsManagerThe segments IDs manager to be used when acquiring/releaseing unique segment IDs.
block2ProcessInfoThe information about the block of raster that must be processed.
inputRasterInput raster.
inputRasterBandsInput raster bands.
inputRasterNoDataValuesA vector of values to be used as input raster no-data values.
inputRasterBandMinValuesThe minimum value present on each band.
inputRasterBandMinValuesThe maximum value present on each band.
outputRasterOutput raster.
outputRasterBandOutput raster band.
enableProgressInterfaceEnable the internal strategy to update the progress interface.
Returns
true if OK, false on errors.
Note
The used gaind/ofset calcule: new_value = ( old_value + offset ) * gain

Implements te::rp::SegmenterStrategy.

BlocksMergingMethod te::rp::SegmenterRegionGrowingBaatzStrategy::getBlocksMergingMethod ( ) const
virtual

Return the strategy blocks merging method.

Returns
The blocks merging method.

Implements te::rp::SegmenterStrategy.

double te::rp::SegmenterRegionGrowingBaatzStrategy::getMemUsageEstimation ( const unsigned int  bandsToProcess,
const unsigned int  pixelsNumber 
) const
virtual

Returns a memory estimation (bytes).

This parameter is used by the segmenter to guess the sub-image blocks size.

Parameters
bandsToProcessThe number of input raster bands that will be processed at the strategy execution time.
pixelsNumberThe number of pixels.
Returns
A positive memory use estimation.

Implements te::rp::SegmenterStrategy.

unsigned int te::rp::SegmenterRegionGrowingBaatzStrategy::getOptimalBlocksOverlapSize ( ) const
virtual

Returns a optimal blocks overlap size (number of border pixels overlapped between blocks, under one direction).

Note
This value will be used in the case where the image is splitted into blocks for segmentation.
Returns
The blocks overlap size.

Implements te::rp::SegmenterStrategy.

bool te::rp::SegmenterRegionGrowingBaatzStrategy::initialize ( SegmenterStrategyParameters const *const  strategyParams)
throw (te::rp::Exception
)
virtual

Initialize the segmentation strategy.

Parameters
strategyParamsA pointer to the user given specific segmentation strategy parameters ou NULL if no parameters are present.
Returns
true if OK, false on errors.

Implements te::rp::SegmenterStrategy.

bool te::rp::SegmenterRegionGrowingBaatzStrategy::initializeSegments ( SegmenterIdsManager segmenterIdsManager,
const te::rp::SegmenterSegmentsBlock block2ProcessInfo,
const te::rst::Raster inputRaster,
const std::vector< unsigned int > &  inputRasterBands,
const std::vector< std::complex< double > > &  inputRasterNoDataValues,
const std::vector< std::complex< double > > &  inputRasterBandMinValues,
const std::vector< std::complex< double > > &  inputRasterBandMaxValues,
SegmenterRegionGrowingSegment< rg::BaatzFeatureType > **  actSegsListHeadPtr 
)
protected

Initialize the segment objects container and the segment IDs container.

Parameters
segmenterIdsManagerA segments ids manager to acquire unique segments ids.
block2ProcessInfoInfo about the block to process.
inputRasterThe input raster.
inputRasterBandsInput raster bands to use.
inputRasterNoDataValuesA vector of values to be used as input raster no-data values.
inputRasterBandMinValuesThe minimum value present on each band.
inputRasterBandMinValuesThe maximum value present on each band.
actSegsListHeadPtrA pointer the the active segments list head.
Returns
true if OK, false on errors.
void te::rp::SegmenterRegionGrowingBaatzStrategy::reset ( )
virtual

Clear all internal allocated resources and go back to the initial not-initialized state.

Implements te::rp::SegmenterStrategy.

bool te::rp::SegmenterRegionGrowingBaatzStrategy::shouldComputeMinMaxValues ( ) const
virtual

Returns if the min and max pixel values should be computed.

Returns
True if min and max values should be computed. False otherwise.

Implements te::rp::SegmenterStrategy.

Member Data Documentation

bool te::rp::SegmenterRegionGrowingBaatzStrategy::m_isInitialized
protected

true if this instance is initialized.

Definition at line 153 of file SegmenterRegionGrowingBaatzStrategy.h.

SegmenterRegionGrowingBaatzStrategy::Parameters te::rp::SegmenterRegionGrowingBaatzStrategy::m_parameters
protected

Internal execution parameters.

Definition at line 158 of file SegmenterRegionGrowingBaatzStrategy.h.

SegmentsIdsMatrixT te::rp::SegmenterRegionGrowingBaatzStrategy::m_segmentsIdsMatrix
protected

A internal segments IDs matrix that can be reused on each strategy execution.

Definition at line 164 of file SegmenterRegionGrowingBaatzStrategy.h.

SegmenterRegionGrowingSegmentsPool< rg::BaatzFeatureType > te::rp::SegmenterRegionGrowingBaatzStrategy::m_segmentsPool
protected

A pool of segments that can be reused on each strategy execution.

Definition at line 161 of file SegmenterRegionGrowingBaatzStrategy.h.


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