dmIImageMap Class Reference

Compute various topological elements from a region description. More...

#include <CCI_ImageMap.h>

Inherits dmINotify.

List of all members.

Public Member Functions

bool Build (cci_object *params, dm_uint connect, dm_uint flags)
 build a region partition map
bool CreateRegion (cci_object *params, dm_int label, dm_bool include_holes)
 Create the mask corresponding to the object designated by label.
bool Clear (dm_int label)
 Remove object corresponding to label.
dm_uint GetLabels (CONST dmRegion *rgn, dm_int *&labels)
 Return a list of labels of objects that intersects the region rgn.
dm_int GetLabelFromPoint (dm_int x, dm_int y)
 Return the label of the object located at (x,y).
bool RemoveLabels (dm_int *labels _in dm_uint count)
 Clear all labels in labels.
bool SelectLabels (cci_object *params, dm_int *labels _in dm_uint count)
 Create the mask corresponding to all the objects in labels.
bool SetCalibration (dm_real uppx, dm_real ar)
 Set the spatial calibration.
dm_uint GetChildRegions (dm_int label, dm_int *&labels)
 Return a list of labels correponding to connnexe objects included in the object designated by label.
dm_uint GetIndexTable (dm_int *&table)
 Return a inversed index tables for all objects labels.
bool FillHoles ()
 Fill holes in objects.
bool CleanBorders ()
 Remove objects adjacent to borders.
bool GetProperties (dm_int label, dm_uint flags, Properties &props)
 Return properties for the object designated by label.
bool Reconstruct (cci_object *params)
 Perform a reconstruction using the mask given in params.
bool RegionProps (cci_object *store, tg_TagItem *params)
 Compute object properties.
bool CleanRegionBorders (cci_object *params)
 Remove all objects outside or adjacent to the border of the given roi.

Classes

struct  Properties
 Structure holding properties values. More...


Detailed Description

Compute various topological elements from a region description.

The ImageMap interface will compute topological attributs from a partition in connexe components of a given region. The partition is organized so has to take advantage of the hierarchical structure of objects and holes in the computation of the objects properties. Each connexe components is designated by a label used as an object réference in ImageMap methods.

Note that the label 0 always correspond to background.


Member Function Documentation

bool dmIImageMap::Build cci_object *  params,
dm_uint  connect,
dm_uint  flags
[inline]
 

build a region partition map

Build a partition from the mask obtained from the params object

Parameters:
params parameter object ( see dmIParameters )
connect the connectivity ( 4 or 8 )
flags flags cn be a combination of the following values:
  • CCIV_ImageMap_NoClip The region will not be clipped with the input image rectangle (if any). Instead the bounding rectangle will be set to the bounding rectangle of the input region.
  • CCIV_ImageMap_OffsetRoi Used in conjunction with CCIV_ImageMap_NoClip, the input region will be offset so as to have the bounding rectangle top left corner at the origin (0,0).

bool dmIImageMap::Clear dm_int  label  )  [inline]
 

Remove object corresponding to label.

Warning that label is likely to be affected to the parent object

bool dmIImageMap::CreateRegion cci_object *  params,
dm_int  label,
dm_bool  include_holes
[inline]
 

Create the mask corresponding to the object designated by label.

The mask will be stored in the params object (using dmIparameteres::SetMask).

  • If label==-1 the mask will correspond to the background region (i.e the region adjacent to borders).
  • If label== 0 the mask will correspond to the reunion of all objects.
  • If label== x the mask will correspond to object designated by label.

dm_uint dmIImageMap::GetChildRegions dm_int  label,
dm_int *&  labels
[inline]
 

Return a list of labels correponding to connnexe objects included in the object designated by label.

Warning that labels is a temporary object and should not be stored for later use.

dm_uint dmIImageMap::GetIndexTable dm_int *&  table  )  [inline]
 

Return a inversed index tables for all objects labels.

This table will enable to fetch values from labels in arrays returned by the Compute() method. Given a label value, the array return the index for the value of a given property.

Returns:
the number of elements in table
Warning that table is a temporary object and should not be stored for later use.

dm_uint dmIImageMap::GetLabels CONST dmRegion *  rgn,
dm_int *&  labels
[inline]
 

Return a list of labels of objects that intersects the region rgn.

Warning that labels is a temporary object and should not be stored for later use.

bool dmIImageMap::GetProperties dm_int  label,
dm_uint  flags,
Properties props
[inline]
 

Return properties for the object designated by label.

Parameters:
label the object label
flags A combinaison of CCIV_ImageMap_Values which deifine the property returned by the GetProperties() method. See the Properties structure for information on the returned properties and the associated flags.
props A reference to a Properties structure.

bool dmIImageMap::Reconstruct cci_object *  params  )  [inline]
 

Perform a reconstruction using the mask given in params.

The Reconstruction is done by constructing a new mask from objects that intersect the mask given in params.

This method is an equivalent of calling GetLabels() followed by the SelectLabels() method.

bool dmIImageMap::RegionProps cci_object *  store,
tg_TagItem *  params
[inline]
 

Compute object properties.

Parameters:
store an instance of a dmIStorageMap object. Storage will be obtained with dmIStorageMap::GetCol().
params array of tagitem structure defining the desired properties. The tg_Tag member can contain following values:
  • CCIA_RgnDesc_Labels return labels
  • CCIA_RgnDesc_Border return full border length
  • CCIA_RgnDesc_Boundary return external border length
  • CCIA_RgnDesc_Area return size
  • CCIA_RgnDesc_Dir return direction
  • CCIA_RgnDesc_Euler return euler number
  • CCIA_RgnDesc_CX return X-Centroid
  • CCIA_RgnDesc_CY return Y-Centroid
  • CCIA_RgnDesc_L1 return min axis length
  • CCIA_RgnDesc_L2 return max axis length
  • CCIA_RgnDesc_Moment return central moment of order (aguments: xn,yn)
The tg_Data member contains the string id of the the stored data together with any parameters that could be passed to the routines for computing the given property. Parameters are given use POST syntax: 'name?arg1=value1&arg2=value2...'

The following example will ask to compute the 2 order moment in x and y :

    tg_TagItem _params = { 
        CCIA_RgnDesc_Moment,dm_ptr_to_long("m22?xn=2&yn=2"),
        TGZ_DONE 
     };    


Generated on Tue May 9 12:34:57 2006 for Daim Library Module Set by  doxygen 1.4.6-NO