| TerraLib 4.1

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

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

Public Member Functions | Protected Member Functions | Protected Attributes
TePDIRegGrowSeg Class Reference
Segmentation algorithms.

This is the class models an image segmentation process. More...

`#include <TePDIRegGrowSeg.hpp>`

Inheritance diagram for TePDIRegGrowSeg:

List of all members.

## Public Member Functions

| TePDIRegGrowSeg ()
| Default Constructor.
| ~TePDIRegGrowSeg ()
| Default Destructor.
bool | CheckParameters (const TePDIParameters &parameters) const
| Checks if the supplied parameters fits the requirements of each PDI algorithm implementation.

## Protected Member Functions

void | ResetState (const TePDIParameters &params)
| Reset the internal state to the initial state.
bool | RunImplementation ()
| Runs the current algorithm implementation.
TePDIRGSCell * | MergeCells (TePDIRGSCell *c1, TePDIRGSCell *c2)
| Merges two cells.
bool | InitWindow ()
| Initializes a window over a image.
void | Adjust ()
| Remove dead cells from list of cells.
bool | MergeSmallCells (long area, int linmax)
| Eliminates all cells with area smaller than argument area. The cells with area smaller than argument area are merged with its nearest neighbour cell.
bool | MergeSimilarCells ()
| Merges all pairs of neighbouring cells with euclidian distance bellow a threshold. The pair of cells say, c1 and c2 must satisfy the criteria: 1 - c1 = closestneighbour( c2 ) or c2 = closestneighbour( c1 ). 2 - dist( c1, c2) < threshold >
bool | MergeMutuallyClosestCells ()
| Merges all pairs of neighbouring cells with euclidian distance bellow a threshold. The pair of cells say, c1 and c2 must satisfy the criteria: 1 - c1 = closestneighbour( c2 ) or c2 = closestneighbour( c1 ). 2 - dist( c1, c2) < threshold >
bool | Resort ()
| Updates ImageLab by writing the cell id number for every pixel belonging to the cell.

## Protected Attributes

TePDITypes::TePDIRasterPtrType | Imagein_
| Array of pointer to images (input images).
TePDITypes::TePDIRasterPtrType | Imagelab_
| Pointer to the output image.
TePDITypes::TePDIRasterPtrType | Imageexc_
| Pointer to the image containing restrictions.
TePDIRGSCellList * | ListCell_
| Pointer to the list of cells.
TePDIRGSCell ** | WindowCell_
| Array of cells for a subimage.
long | OnLimbo_
| Number of cells which have been removed from ListCell due to distance criteria.
unsigned long * | tuple_
| tuple of pixel (auxiliar).
long | NWindow_
| Number of subimages in the image.
long | WindowLines_
| Number of subimages along the lines of image.
long | WindowColumns_
| Number of subimages along the columns of image.
long | CurrentWindow_
| Current subimage.
long | WindowOffset_
| Id number of the first cell in the subimage.
int | Areamin_
| Minimum area allowed to the final cells.
double | Difsim_
| Minimum euclidian distance between final cells.
int | Nlin_
| Number of lines in Imagelab.
int | Ncol_
| Number of colums in Imagelab.
int | Nban_
| Number of bands in Imagein.
int | ilin_
| auxiliar variables
int | flin_
| auxiliar variables
int | icol_
| auxiliar variables
int | fcol_
| auxiliar variables
int | sizelin_
| auxiliar variables
int | sizecol_
| auxiliar variables
CellStack | cellStack
| Cell stack.

## Detailed Description

This is the class models an image segmentation process.

Author:
  Nicolas Despres <nicolasdespres@wanadoo.fr>

Note:
  The segmentation is performed through a region growing approach described in: S. A. Bins, L. M. G. Fonseca, G. J. Erthal e F. M. Ii, "Satellite Imagery segmentation: a region growing approach", VIII Simp�sio Brasileiro de Sensoriamento Remoto, Salvador, BA, 14-19 abril 1996.
  The general required parameters :

Parameters:

  input_image | (TePDITypes::TePDIRasterPtrType),
  euc_treshold | (double) - euclidian distance treshold value.
  area_min | (int) - cell pixel size min value.

Note:
  The following parameters are optional and will be used if present.

Parameters:

  restriction_image | (TePDITypes::TePDIRasterPtrType) - Restriction (mask) image ( restriction image pixels with value zero will not be inside any segments generated from the input_image, they will be ignored ).
  output_polsets | ( TePDITypes::TePDIPolSetMapPtrType ) - The user supplied output polygon sets map where the generated polygons will be stored (each polygon set contains polygons related to the same pixel value).
  output_image | (TePDITypes::TePDIRasterPtrType), pointer to a Labelled image containing the final segmentation. Each pixel contains the cell id number to which it belongs. This image must have TeUNSIGNEDLONG data type.

Examples:

  TePDIClassification_test.cpp, and TePDISegmentation_test.cpp.

## Constructor & Destructor Documentation

TePDIRegGrowSeg::TePDIRegGrowSeg | ( |  | ) |

Default Constructor.

TePDIRegGrowSeg::~TePDIRegGrowSeg | ( |  | ) |

Default Destructor.

## Member Function Documentation

void TePDIRegGrowSeg::Adjust | ( |  | ) | `[protected]`

Remove dead cells from list of cells.

bool TePDIRegGrowSeg::CheckParameters | ( | const TePDIParameters & | parameters | ) | const`[virtual]`

Checks if the supplied parameters fits the requirements of each PDI algorithm implementation.

Note:
  Error log messages must be generated. No exceptions generated.

Parameters:

  parameters | The parameters to be checked.

Returns:
  true if the parameters are OK. false if not.

Implements TePDIAlgorithm.

bool TePDIRegGrowSeg::InitWindow | ( |  | ) | `[protected]`

Initializes a window over a image.

Returns:
  true if OK. false on error.

TePDIRGSCell * TePDIRegGrowSeg::MergeCells | ( | TePDIRGSCell * | c1,
|  | TePDIRGSCell * | c2
| ) |  | `[protected]`

Merges two cells.

Parameters:

  c1 | pointer to a cell to be merged
  c2 | pointer to a cell to be merged

Returns:
  pointer to cell resulting from merging..

bool TePDIRegGrowSeg::MergeMutuallyClosestCells | ( |  | ) | `[protected]`

Merges all pairs of neighbouring cells with euclidian distance bellow a threshold. The pair of cells say, c1 and c2 must satisfy the criteria: 1 - c1 = closestneighbour( c2 ) or c2 = closestneighbour( c1 ). 2 - dist( c1, c2) < threshold >

Returns:
  true if OK. false on error.

bool TePDIRegGrowSeg::MergeSimilarCells | ( |  | ) | `[protected]`

Merges all pairs of neighbouring cells with euclidian distance bellow a threshold. The pair of cells say, c1 and c2 must satisfy the criteria: 1 - c1 = closestneighbour( c2 ) or c2 = closestneighbour( c1 ). 2 - dist( c1, c2) < threshold >

Returns:
  true if OK. false on error.

bool TePDIRegGrowSeg::MergeSmallCells | ( | long | area,
|  | int | linmax
| ) |  | `[protected]`

Eliminates all cells with area smaller than argument area. The cells with area smaller than argument area are merged with its nearest neighbour cell.

Parameters:

  area | size in pixels which defines de area treshold for merging.
  linmax | lin max of the image to consider

Returns:
  true if OK. false on error.

void TePDIRegGrowSeg::ResetState | ( | const TePDIParameters & | params | ) | `[protected, virtual]`

Reset the internal state to the initial state.

Parameters:

  params | The new parameters referente at initial state.

Implements TePDIAlgorithm.

bool TePDIRegGrowSeg::Resort | ( |  | ) | `[protected]`

Updates ImageLab by writing the cell id number for every pixel belonging to the cell.

Returns:
  true if OK. false on error.

bool TePDIRegGrowSeg::RunImplementation | ( |  | ) | `[protected, virtual]`

Runs the current algorithm implementation.

Returns:
  true if OK. false on error.

Implements TePDIAlgorithm.

## Member Data Documentation

int TePDIRegGrowSeg::Areamin_`[protected]`

Minimum area allowed to the final cells.

CellStack TePDIRegGrowSeg::cellStack`[protected]`

Cell stack.

long TePDIRegGrowSeg::CurrentWindow_`[protected]`

Current subimage.

double TePDIRegGrowSeg::Difsim_`[protected]`

Minimum euclidian distance between final cells.

int TePDIRegGrowSeg::fcol_`[protected]`

auxiliar variables

int TePDIRegGrowSeg::flin_`[protected]`

auxiliar variables

int TePDIRegGrowSeg::icol_`[protected]`

auxiliar variables

int TePDIRegGrowSeg::ilin_`[protected]`

auxiliar variables

TePDITypes::TePDIRasterPtrType TePDIRegGrowSeg::Imageexc_`[protected]`

Pointer to the image containing restrictions.

TePDITypes::TePDIRasterPtrType TePDIRegGrowSeg::Imagein_`[protected]`

Array of pointer to images (input images).

TePDITypes::TePDIRasterPtrType TePDIRegGrowSeg::Imagelab_`[protected]`

Pointer to the output image.

TePDIRGSCellList* TePDIRegGrowSeg::ListCell_`[protected]`

Pointer to the list of cells.

int TePDIRegGrowSeg::Nban_`[protected]`

Number of bands in Imagein.

int TePDIRegGrowSeg::Ncol_`[protected]`

Number of colums in Imagelab.

int TePDIRegGrowSeg::Nlin_`[protected]`

Number of lines in Imagelab.

long TePDIRegGrowSeg::NWindow_`[protected]`

Number of subimages in the image.

long TePDIRegGrowSeg::OnLimbo_`[protected]`

Number of cells which have been removed from ListCell due to distance criteria.

int TePDIRegGrowSeg::sizecol_`[protected]`

auxiliar variables

int TePDIRegGrowSeg::sizelin_`[protected]`

auxiliar variables

unsigned long* TePDIRegGrowSeg::tuple_`[protected]`

tuple of pixel (auxiliar).

TePDIRGSCell** TePDIRegGrowSeg::WindowCell_`[protected]`

Array of cells for a subimage.

long TePDIRegGrowSeg::WindowColumns_`[protected]`

Number of subimages along the columns of image.

long TePDIRegGrowSeg::WindowLines_`[protected]`

Number of subimages along the lines of image.

long TePDIRegGrowSeg::WindowOffset_`[protected]`

Id number of the first cell in the subimage.

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines