![]() |
TerraLib 4.1
|
Multi-threaded image segmenter Region Growing strategy. More...
#include <TePDIParaSegRegGrowStrategy.hpp>
Classes | |
| class | MergingSegmentInfo |
| Information about a candidate segment for merging. More... | |
| class | Segment |
| Information about one segment. More... | |
Public Member Functions | |
| TePDIParaSegRegGrowStrategy (const TePDIParaSegStrategyParams ¶ms) | |
| ~TePDIParaSegRegGrowStrategy () | |
| bool | execute (const RasterDataVecT &rasterDataVector, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT &outSegsMatrix) |
| Execute segmentation following the supplied strategy specific parameters. | |
| bool | setParameters (const TePDIParameters ¶ms) |
| Set the specific strategy parameters. | |
| bool | mergeSegments (TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT ¢erMatrix, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT *topMatrixPtr, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT *leftMatrixPtr) |
| Merge adjacent matrix border segments. | |
| double | getMemUsageFactor () const |
| Returns a positive memory use weight factor. | |
Static Public Member Functions | |
| static bool | staticMergeSegments (TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT ¢erMatrix, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT *topMatrixPtr, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT *leftMatrixPtr, double eucTreshold) |
| template<class StrategyTemplateT > | |
| static bool | createSegsBlkFromLImg (const RasterDataVecT &rasterDataVector, TeRaster &labelRaster, StrategyTemplateT *stratPtr, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT &outSegsMatrix) |
| Create a segments matrix from a label image. | |
Protected Types | |
| typedef std::vector < MergingSegmentInfo > | MergingSegmentInfoVecT |
| Type definition for a vector of canditate merging segments information vector. | |
Static Protected Member Functions | |
| static bool | staticLocateMergingSegments (Segment const *inputSegPtr, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT const *inputSegMtxPtr, const MergingSegmentInfoVecT &candidateSegmentsVec, std::vector< unsigned int > &locatedSegsIndexes, double eucTreshold) |
| Locate, among the given candidate segments, those wich can be merged with the segment inputSegPtr. | |
Protected Attributes | |
| TePDITypes::TePDIRasterPtrType | inputRasterPtr_ |
| TePDITypes::TePDIRasterPtrType | outputRasterPtr_ |
| TePDIParameters | segParams_ |
| TePDIRegGrowSeg | segmenter_ |
| double | eucTreshold_ |
Multi-threaded image segmenter Region Growing strategy.
| euc_treshold | (double) - Maximum eclidean distance between each segment (This parameter is used to merge adjacent segments from adjacent image blocks). |
| area_min | (int) - cell pixel size min value. |
typedef std::vector< MergingSegmentInfo > TePDIParaSegRegGrowStrategy::MergingSegmentInfoVecT [protected] |
Type definition for a vector of canditate merging segments information vector.
| TePDIParaSegRegGrowStrategy::TePDIParaSegRegGrowStrategy | ( | const TePDIParaSegStrategyParams & | params | ) |
| TePDIParaSegRegGrowStrategy::~TePDIParaSegRegGrowStrategy | ( | ) |
| bool TePDIParaSegRegGrowStrategy::createSegsBlkFromLImg | ( | const RasterDataVecT & | rasterDataVector, |
| TeRaster & | labelRaster, | ||
| StrategyTemplateT * | stratPtr, | ||
| TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT & | outSegsMatrix | ||
| ) | [static] |
Create a segments matrix from a label image.
| rasterDataVector | The original input raster data vector. |
| labelRaster | The label image raster. |
| stratPtr | A pointer to the strategy calling this method.. |
| outSegsMatrix | A reference to the output generated segments matrix. |
| bool TePDIParaSegRegGrowStrategy::execute | ( | const RasterDataVecT & | rasterDataVector, |
| TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT & | outSegsMatrix | ||
| ) | [virtual] |
Execute segmentation following the supplied strategy specific parameters.
This method will be called many times as required to the same strategy instance to execute segmentation on each image block.
| rasterDataVector | The input raster data vector (each vector element represents one raster band/channel). |
| outSegsMatrix | The generated output segments matrix. |
Implements TePDIParaSegStrategy.
| double TePDIParaSegRegGrowStrategy::getMemUsageFactor | ( | ) | const [inline, virtual] |
Returns a positive memory use weight factor.
This parameter is used by the parallel segmenter to guess the sub-image blocks size.
Implements TePDIParaSegStrategy.
| bool TePDIParaSegRegGrowStrategy::mergeSegments | ( | TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT & | centerMatrix, |
| TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT * | topMatrixPtr, | ||
| TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT * | leftMatrixPtr | ||
| ) | [virtual] |
Merge adjacent matrix border segments.
This method will be called many times as required to the same strategy instance to merge the entire label image incrementally; on each call references to 3 adjacent image segments blocks will be passed as shown ahead.
________________________________
| | | | | |
________________________________
| | |top | | |
________________________________
| |left |center| | |
_______________________________
| | | | | |
________________________________
| centerMatrix | A reference to the image block matrix located at the merging region center. |
| topMatrixPtr | A pointer to the image block matrix located at the merging region top or null if this block does not exists. |
| leftMatrixPtr | A pointer to the image block matrix located at the merging region left or null if this block does not exists. |
Implements TePDIParaSegStrategy.
| bool TePDIParaSegRegGrowStrategy::setParameters | ( | const TePDIParameters & | params | ) | [virtual] |
Set the specific strategy parameters.
This method will be called once for each strategy instance created.
| params | A reference to the new parameters. |
Implements TePDIParaSegStrategy.
| bool TePDIParaSegRegGrowStrategy::staticLocateMergingSegments | ( | Segment const * | inputSegPtr, |
| TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT const * | inputSegMtxPtr, | ||
| const MergingSegmentInfoVecT & | candidateSegmentsVec, | ||
| std::vector< unsigned int > & | locatedSegsIndexes, | ||
| double | eucTreshold | ||
| ) | [static, protected] |
Locate, among the given candidate segments, those wich can be merged with the segment inputSegPtr.
| inputSegPtr | A pointer to the segment to merge with the located candidate. |
| inputSegMtxPtr | Input segment matrix pointer. |
| candidateSegmentsVec | The candidate segments information vector. |
| locatedSegsIndexes | The selected candidate segment indexes inside candidateSegmentsVec ordered from the best candidate (first locatedSegInfoIndexes vector element ) to the worse canditate (last locatedSegInfoIndexes vector element). |
| eucTreshold | Max euclidean distance between each segment. |
| bool TePDIParaSegRegGrowStrategy::staticMergeSegments | ( | TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT & | centerMatrix, |
| TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT * | topMatrixPtr, | ||
| TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT * | leftMatrixPtr, | ||
| double | eucTreshold | ||
| ) | [static] |
double TePDIParaSegRegGrowStrategy::eucTreshold_ [protected] |
Maximum allowed euclidean distance parameter
A raster generated from the input raster data vector.
A raster generated from the segmentation.
Segmenter instance
Segmentation algorithm parameters