| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Static Public Member Functions | Protected Types | Static Protected Member Functions | Protected Attributes
TePDIParaSegRegGrowStrategy Class Reference
Algorithm strategies.

Multi-threaded image segmenter Region Growing strategy. More...

`#include <TePDIParaSegRegGrowStrategy.hpp>`

Inheritance diagram for TePDIParaSegRegGrowStrategy:

List of all members.

## Classes

class | MergingSegmentInfo
| Information about a candidate segment for merging. More...
class | Segment
| Information about one segment. More...

## Public Member Functions

| TePDIParaSegRegGrowStrategy (const TePDIParaSegStrategyParams &params)
| ~TePDIParaSegRegGrowStrategy ()
bool | execute (const RasterDataVecT &rasterDataVector, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT &outSegsMatrix)
| Execute segmentation following the supplied strategy specific parameters.
bool | setParameters (const TePDIParameters &params)
| Set the specific strategy parameters.
bool | mergeSegments (TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT &centerMatrix, 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 &centerMatrix, 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_

## Detailed Description

Multi-threaded image segmenter Region Growing strategy.

Author:
  Emiliano F. Castejon <castejon@dpi.inpe.br>.

Note:
  The strategy name that must be used to construct an instance of this class is "RegionGrowing".
  The general required parameters :

Parameters:

  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.

## Member Typedef Documentation

typedef std::vector< MergingSegmentInfo > TePDIParaSegRegGrowStrategy::MergingSegmentInfoVecT`[protected]`

Type definition for a vector of canditate merging segments information vector.

## Constructor & Destructor Documentation

TePDIParaSegRegGrowStrategy::TePDIParaSegRegGrowStrategy | ( | const TePDIParaSegStrategyParams & | params | ) |

TePDIParaSegRegGrowStrategy::~TePDIParaSegRegGrowStrategy | ( |  | ) |

## Member Function Documentation

template<class StrategyTemplateT >

bool TePDIParaSegRegGrowStrategy::createSegsBlkFromLImg | ( | const RasterDataVecT & | rasterDataVector,
|  | TeRaster & | labelRaster,
|  | StrategyTemplateT * | stratPtr,
|  | TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT & | outSegsMatrix
| ) |  | `[static]`

Create a segments matrix from a label image.

Parameters:

  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.

Returns:
  true if OK, false on errors.

Note:
  This method is templated by the strategy type inherithed from TePDIParaSegStrategy.

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.

Parameters:

  rasterDataVector | The input raster data vector (each vector element represents one raster band/channel).
  outSegsMatrix | The generated output segments matrix.

Returns:
  true if OK, false on errors.

Note:
  The generated segments IDs must be acquired by using the TePDIParaSegStrategy::acquireNewSegID() method.
  The generated segments reference counters must be initiated with value 1.

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.

Returns:
  A memory use weight factor (default:1,0).

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|     |     |
              _______________________________
              |     |     |      |     |     |
              ________________________________

Parameters:

  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.

Returns:
  true if OK, false on errors.

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.

Parameters:

  params | A reference to the new parameters.

Returns:
  true if OK, false on errors.

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.

Parameters:

  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.

Returns:
  true if one cadidate was located, false if no candidate was located.

bool TePDIParaSegRegGrowStrategy::staticMergeSegments | ( | TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT & | centerMatrix,
|  | TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT * | topMatrixPtr,
|  | TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT * | leftMatrixPtr,
|  | double | eucTreshold
| ) |  | `[static]`

## Member Data Documentation

double TePDIParaSegRegGrowStrategy::eucTreshold_`[protected]`

Maximum allowed euclidean distance parameter

TePDITypes::TePDIRasterPtrType TePDIParaSegRegGrowStrategy::inputRasterPtr_`[protected]`

A raster generated from the input raster data vector.

TePDITypes::TePDIRasterPtrType TePDIParaSegRegGrowStrategy::outputRasterPtr_`[protected]`

A raster generated from the segmentation.

TePDIRegGrowSeg TePDIParaSegRegGrowStrategy::segmenter_`[protected]`

Segmenter instance

TePDIParameters TePDIParaSegRegGrowStrategy::segParams_`[protected]`

Segmentation algorithm parameters

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

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/image_processing/TePDIParaSegRegGrowStrategy.hpp
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/image_processing/TePDIParaSegRegGrowStrategy.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines