| TerraLib 4.1

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

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

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
TePDIParaSegStrategy Class Reference
Algorithm strategies.

Multi-threaded image segmenter strategy base class. More...

`#include <TePDIParaSegStrategy.hpp>`

Inheritance diagram for TePDIParaSegStrategy:

List of all members.

## Public Types

typedef TePDIMatrix< double > | RasterBandDataT
typedef std::vector < RasterBandDataT > | RasterDataVecT

## Public Member Functions

virtual | ~TePDIParaSegStrategy ()
virtual bool | execute (const RasterDataVecT &rasterDataVector, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT &outSegsMatrix)=0
| Execute segmentation following the supplied strategy specific parameters.
virtual bool | setParameters (const TePDIParameters &params)=0
| Set the specific strategy parameters.
virtual bool | mergeSegments (TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT &centerMatrix, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT *topMatrixPtr, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT *leftMatrixPtr)=0
| Merge adjacent matrix border segments.
virtual double | getMemUsageFactor () const =0
| Returns a positive memory use weight factor.
TePDIParaSegSegment::SegIdDataType | acquireNewSegID ()
| Acquire an unique segment ID to be associated with a new generated segment.
bool | isBlockMergingEnabled () const
| Return true if adjacent segments blocks merging will be performed.

## Static Public Member Functions

static TePDIParaSegStrategy * | DefaultObject (const TePDIParaSegStrategyFactoryParams &params)

## Protected Member Functions

| TePDIParaSegStrategy (const TePDIParaSegStrategyParams &params)
| The default constructor.

## Detailed Description

Multi-threaded image segmenter strategy base class.

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

## Member Typedef Documentation

typedef TePDIMatrix< double > TePDIParaSegStrategy::RasterBandDataT

Raster data block (one band/channel)

typedef std::vector< RasterBandDataT > TePDIParaSegStrategy::RasterDataVecT

Raster data block type definition (one vector element for each raster band)

## Constructor & Destructor Documentation

TePDIParaSegStrategy::~TePDIParaSegStrategy | ( |  | ) | `[virtual]`

TePDIParaSegStrategy::TePDIParaSegStrategy | ( | const TePDIParaSegStrategyParams & | params | ) | `[protected]`

The default constructor.

Parameters:

  params | The strategy parameters.

## Member Function Documentation

TePDIParaSegSegment::SegIdDataType TePDIParaSegStrategy::acquireNewSegID | ( |  | ) |

Acquire an unique segment ID to be associated with a new generated segment.

Returns:
  An unique segment ID to be associated with a new generated segment or zero if an error occurred.

Note:
  The returned ID is unique, meaning that other calls to this method (by this or by other threads) will never generate the same values.

TePDIParaSegStrategy * TePDIParaSegStrategy::DefaultObject | ( | const TePDIParaSegStrategyFactoryParams & | params | ) | `[static]`

virtual bool TePDIParaSegStrategy::execute | ( | const RasterDataVecT & | rasterDataVector,
|  | TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT & | outSegsMatrix
| ) |  | `[pure 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.

Implemented in TePDIParaSegBaatzStrategy, and TePDIParaSegRegGrowStrategy.

virtual double TePDIParaSegStrategy::getMemUsageFactor | ( |  | ) | const`[pure 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).

Implemented in TePDIParaSegBaatzStrategy, and TePDIParaSegRegGrowStrategy.

bool TePDIParaSegStrategy::isBlockMergingEnabled | ( |  | ) | const`[inline]`

Return true if adjacent segments blocks merging will be performed.

Returns:
  Return true if adjacent segments blocks merging will be performed.

virtual bool TePDIParaSegStrategy::mergeSegments | ( | TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT & | centerMatrix,
|  | TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT * | topMatrixPtr,
|  | TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT * | leftMatrixPtr
| ) |  | `[pure 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.

Implemented in TePDIParaSegBaatzStrategy, and TePDIParaSegRegGrowStrategy.

virtual bool TePDIParaSegStrategy::setParameters | ( | const TePDIParameters & | params | ) | `[pure 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.

Implemented in TePDIParaSegBaatzStrategy, and TePDIParaSegRegGrowStrategy.

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines