LTI-Lib latest version v1.9 - last update 24 Nov 2005
Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

lti::areaPoints Class Reference
[Aggregate Data TypesShape Analysis]

Contour classes: Area-Points. More...

#include <ltiContour.h>

Inheritance diagram for lti::areaPoints:

Inheritance graph
[legend]
Collaboration diagram for lti::areaPoints:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 areaPoints ()
 areaPoints (const areaPoints &other)
virtual ~areaPoints ()
const char * getTypeName () const
areaPointscastFrom (const borderPoints &theBorderPoints)
areaPointscastFrom (const ioPoints &theIOPoints)
areaPointscastFrom (const polygonPoints &theIOPoints)
areaPointsoperator= (const areaPoints &other)
bool getFromMask (const channel8 &mask)
bool generateMask (channel8 &mask, const bool computeBoundary=true, const bool exactBoundaryDimensions=false, const bool keepMaskData=false) const
void sort ()
int intersectionArea (const rectangle &rect) const

Detailed Description

Contour classes: Area-Points.

For the explanation of the contour description in this class, see following image:

   -- 00000000001111111111222222222233
   -- 01234567890123456789012345678901
   00 --------------------------------
   01 --------------------------------
   02 --------------------------------
   03 --------BBBB------BBBB----------
   04 -------B****BBB----B**B---------
   05 -------B*******B---B***B--------
   06 ------B*******B-----B*B---------
   07 -------B*******BBBBB**B---------
   08 ---------B*************B--------
   09 --------B**----*********B-------
   10 --------B**-----********B-------
   11 -------B**-----*******BB--------
   12 ------B**-----*******B----------
   13 ------B**-------******BB--------
   14 -----B**---------*******B-------
   15 -----B**--------*********B------
   16 ----B**-------**********BB------
   17 ---B***----*******----BB--------
   18 ----BBBBBBBBB***  --*B----------
   19 -------------BBBBBBBB-----------
   20 --------------------------------
   21 --------------------------------
   22 --------------------------------
   23 --------------------------------

  "-" means background and the rest is part of the object.
  "B" indicates a borderpoint.

This contour class allows three representations of a contour:

See also:
lti::ioPoints, lti::borderPoints


Constructor & Destructor Documentation

lti::areaPoints::areaPoints  ) 
 

default constructor creates an empty area-point-list

lti::areaPoints::areaPoints const areaPoints other  ) 
 

create this pointList as a copy of another pointList

Parameters:
other the pointList to be copied.

virtual lti::areaPoints::~areaPoints  )  [virtual]
 

destructor


Member Function Documentation

areaPoints& lti::areaPoints::castFrom const polygonPoints theIOPoints  ) 
 

creates this io-list from the given io-point-list

areaPoints& lti::areaPoints::castFrom const ioPoints theIOPoints  ) 
 

creates this io-list from the given io-point-list

areaPoints& lti::areaPoints::castFrom const borderPoints theBorderPoints  ) 
 

creates this area-point-list from the given border-point-list

bool lti::areaPoints::generateMask channel8 mask,
const bool  computeBoundary = true,
const bool  exactBoundaryDimensions = false,
const bool  keepMaskData = false
const
 

generate mask from area-points.

The dimensions of the resulting mask are the smallest rectangle to contain the point (0,0) (optional) and all points in this list, plus 1 pixel in both width and heigth. If the given mask is bigger than this size, its dimensions will be kept.

If the boundary of the point list is not up to date, it can be calculated if specified in the parameters:

Parameters:
mask The calculated mask will be stored here
computeBoundary If false, the internal boundary of the point list will be used, otherwise the boundary will be calculated (but NOT updated!!!).
exactBoundaryDimensions If true, the dimensions of the resulting mask will be the smallest rectangle to contain only the points in this list. The origin (0,0) may not be included, therefore a 1:1 correspondence of coordinates will generally not be given.
keepMaskData if false, the mask will be initialized with zero before getting the area mask. If true, the previous mask data is not deleted, but the mask will be resized if necessary.
Returns:
true if successful, false otherwise.

bool lti::areaPoints::getFromMask const channel8 mask  ) 
 

generate a area-point-list from the given mask image.

This function assumes that the mask contains JUST ONE connected object. To get the biggest object on the mask see the lti::objectsFromMask functor.

const char* lti::areaPoints::getTypeName void   )  const [inline, virtual]
 

returns the name of this class: "areaPoints"

Reimplemented from lti::tpointList< T >.

int lti::areaPoints::intersectionArea const rectangle rect  )  const
 

Compute intersection area with a rectangle.

areaPoints& lti::areaPoints::operator= const areaPoints other  )  [inline]
 

assigment operator (alias for copy(other)).

Parameters:
other the pointList to be copied
Returns:
a reference to the actual pointList

void lti::areaPoints::sort  ) 
 

sort the points of this in ascending order first of y, and than of x.


The documentation for this class was generated from the following file:
Generated on Thu Nov 24 16:37:29 2005 for LTI-Lib by Doxygen 1.4.4