Raster region growing segmenter strategy. More...
#include <SegmenterRegionGrowingMeanStrategy.h>
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... | |
| const std::string & | getErrorMessage () const |
| Return the current error message if there is any. 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... | |
| SegmenterRegionGrowingMeanStrategy () | |
| bool | shouldComputeMinMaxValues () const |
| Returns if the min and max pixel values should be computed. More... | |
| ~SegmenterRegionGrowingMeanStrategy () | |
Protected Types | |
| typedef Matrix< SegmenterSegmentsBlock::SegmentIdDataType > | SegmentsIdsMatrixT |
| 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::MeanFeatureType > **actSegsListHeadPtr) |
| Initialize the segment objects container and the segment IDs container. More... | |
| void | setErrorMessage (const std::string &newErrorMessage) |
| Set the current error message. More... | |
Protected Attributes | |
| bool | m_isInitialized |
| true if this instance is initialized. More... | |
| SegmenterRegionGrowingMeanStrategy::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::MeanFeatureType > | m_segmentsPool |
| A pool of segments that can be reused on each strategy execution. More... | |
Raster region growing segmenter strategy.
Definition at line 52 of file SegmenterRegionGrowingMeanStrategy.h.
|
protected |
Internal segments ids matrix type definition.
Definition at line 138 of file SegmenterRegionGrowingMeanStrategy.h.
|
inherited |
Blocks merging method.
| Enumerator | |
|---|---|
| NoMerging |
No merging. |
| GradientMerging |
Gradient Merging. |
Definition at line 52 of file SegmenterStrategy.h.
| te::rp::SegmenterRegionGrowingMeanStrategy::~SegmenterRegionGrowingMeanStrategy | ( | ) |
Definition at line 99 of file SegmenterRegionGrowingMeanStrategy.cpp.
References te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::reset().
| te::rp::SegmenterRegionGrowingMeanStrategy::SegmenterRegionGrowingMeanStrategy | ( | ) |
Definition at line 94 of file SegmenterRegionGrowingMeanStrategy.cpp.
References m_isInitialized.
|
virtual | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Executes the segmentation strategy over region delimited by the given block.
| segmenterIdsManager | The segments IDs manager to be used when acquiring/releaseing unique segment IDs. |
| block2ProcessInfo | The information about the block of raster that must be processed. |
| inputRaster | Input raster. |
| inputRasterBands | Input raster bands. |
| inputRasterNoDataValues | A vector of values to be used as input raster no-data values. |
| inputRasterBandMinValues | The minimum value present on each band. |
| inputRasterBandMinValues | The maximum value present on each band. |
| outputRaster | Output raster. |
| outputRasterBand | Output raster band. |
| enableProgressInterface | Enable the internal strategy to update the progress interface. |
Implements te::rp::SegmenterStrategy.
Definition at line 145 of file SegmenterRegionGrowingMeanStrategy.cpp.
References te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::disable(), te::rp::Matrix< TemplateElementType >::getColumnsNumber(), te::rp::Matrix< TemplateElementType >::getLinesNumber(), te::rp::SegmenterRegionGrowingSegmentsPool< FeatureDataTypeT >::getNextSegment(), te::rp::SegmenterRegionGrowingSegmentsPool< FeatureDataTypeT >::initialize(), initializeSegments(), te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::m_enableLocalMutualBestFitting, te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::m_enableSameIterationMerges, m_isInitialized, te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::m_minSegmentSize, m_parameters, m_segmentsIdsMatrix, m_segmentsPool, te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::m_segmentsSimilarityThreshold, te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::m_segmentsSimIncreaseSteps, te::rp::Matrix< TemplateElementType >::reset(), and TERP_INSTANCE_TRUE_OR_RETURN_FALSE.
|
virtual |
Return the strategy blocks merging method.
Implements te::rp::SegmenterStrategy.
Definition at line 445 of file SegmenterRegionGrowingMeanStrategy.cpp.
References te::rp::SegmenterStrategy::GradientMerging.
|
inherited |
Return the current error message if there is any.
Definition at line 45 of file SegmenterStrategy.cpp.
References te::rp::SegmenterStrategy::m_errorMessage.
|
virtual |
Returns a memory estimation (bytes).
This parameter is used by the segmenter to guess the sub-image blocks size.
| bandsToProcess | The number of input raster bands that will be processed at the strategy execution time. |
| pixelsNumber | The number of pixels. |
Implements te::rp::SegmenterStrategy.
Definition at line 391 of file SegmenterRegionGrowingMeanStrategy.cpp.
References m_isInitialized, and TERP_TRUE_OR_THROW.
|
virtual |
Returns a optimal blocks overlap size (number of border pixels overlapped between blocks, under one direction).
Implements te::rp::SegmenterStrategy.
Definition at line 433 of file SegmenterRegionGrowingMeanStrategy.cpp.
References m_isInitialized, te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::m_minSegmentSize, m_parameters, and TERP_TRUE_OR_THROW.
|
virtual | ||||||||||||||
Initialize the segmentation strategy.
| strategyParams | A pointer to the user given specific segmentation strategy parameters ou NULL if no parameters are present. |
Implements te::rp::SegmenterStrategy.
Definition at line 104 of file SegmenterRegionGrowingMeanStrategy.cpp.
References m_isInitialized, te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::m_minSegmentSize, m_parameters, te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::m_segmentsSimilarityThreshold, te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::reset(), and TERP_INSTANCE_TRUE_OR_RETURN_FALSE.
|
protected |
Initialize the segment objects container and the segment IDs container.
| segmenterIdsManager | A segments ids manager to acquire unique segments ids. |
| block2ProcessInfo | Info about the block to process. |
| inputRaster | The input raster. |
| inputRasterBands | Input raster bands to use. |
| inputRasterNoDataValues | A vector of values to be used as input raster no-data values. |
| inputRasterBandMinValues | The minimum value present on each band. |
| inputRasterBandMinValues | The maximum value present on each band. |
| actSegsListHeadPtr | A pointer the the active segments list head or a null points if no segments were initialized (entire image with no data, i.e.). |
Definition at line 450 of file SegmenterRegionGrowingMeanStrategy.cpp.
References te::rp::SegmenterIdsManager::addFreeIDs(), te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::addNeighborSegmentPtr(), te::rp::SegmenterIdsManager::getNewIDs(), te::rp::SegmenterRegionGrowingSegmentsPool< FeatureDataTypeT >::getNextSegment(), te::rst::Raster::getValue(), te::rp::SegmenterSegmentsBlock::m_bottomCutOffProfile, te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::m_features, te::rp::SegmenterSegmentsBlock::m_height, te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::m_id, te::rp::SegmenterSegmentsBlock::m_leftCutOffProfile, te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::m_mergetIteration, te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::m_nextActiveSegment, te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::m_prevActiveSegment, te::rp::SegmenterSegmentsBlock::m_rightCutOffProfile, m_segmentsIdsMatrix, m_segmentsPool, te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::m_size, te::rp::SegmenterSegmentsBlock::m_startX, te::rp::SegmenterSegmentsBlock::m_startY, te::rp::SegmenterSegmentsBlock::m_topCutOffProfile, te::rp::SegmenterSegmentsBlock::m_width, te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::m_xBound, te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::m_xStart, te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::m_yBound, te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::m_yStart, and te::rp::SegmenterRegionGrowingSegment< FeatureDataTypeT >::removeAllNeighborSegmentsPtrs().
Referenced by execute().
|
virtual |
Clear all internal allocated resources and go back to the initial not-initialized state.
Reimplemented from te::rp::SegmenterStrategy.
Definition at line 135 of file SegmenterRegionGrowingMeanStrategy.cpp.
References te::rp::SegmenterRegionGrowingSegmentsPool< FeatureDataTypeT >::clear(), m_isInitialized, m_parameters, m_segmentsIdsMatrix, m_segmentsPool, te::rp::SegmenterStrategy::reset(), te::rp::SegmenterRegionGrowingMeanStrategy::Parameters::reset(), and te::rp::Matrix< TemplateElementType >::reset().
|
protectedinherited |
Set the current error message.
| newErrorMessage | New error message; |
Definition at line 50 of file SegmenterStrategy.cpp.
References te::rp::SegmenterStrategy::m_errorMessage.
|
virtual |
Returns if the min and max pixel values should be computed.
Implements te::rp::SegmenterStrategy.
Definition at line 439 of file SegmenterRegionGrowingMeanStrategy.cpp.
|
protected |
true if this instance is initialized.
Definition at line 143 of file SegmenterRegionGrowingMeanStrategy.h.
Referenced by execute(), getMemUsageEstimation(), getOptimalBlocksOverlapSize(), initialize(), reset(), and SegmenterRegionGrowingMeanStrategy().
|
protected |
Internal execution parameters.
Definition at line 148 of file SegmenterRegionGrowingMeanStrategy.h.
Referenced by execute(), getOptimalBlocksOverlapSize(), initialize(), and reset().
|
protected |
A internal segments IDs matrix that can be reused on each strategy execution.
Definition at line 154 of file SegmenterRegionGrowingMeanStrategy.h.
Referenced by execute(), initializeSegments(), and reset().
|
protected |
A pool of segments that can be reused on each strategy execution.
Definition at line 151 of file SegmenterRegionGrowingMeanStrategy.h.
Referenced by execute(), initializeSegments(), and reset().