LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::objectsFromMask Class Reference

This class works on channel8/imatrix to extract connected components and describes them as the topological order of "objects" and "holes". More...

#include <ltiObjectsFromMask.h>

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

List of all members.

Classes

class  objectStruct
 This node-structure for storing information about all objects and holes in the tree. More...
class  parameters
 the parameters for the class objectsFromMask More...

Public Types

enum  {
  Invalid = -1, E = 0, SE = 1, S = 2,
  SW = 3, W = 4, NW = 5, N = 6,
  NE = 7
}

Public Member Functions

 objectsFromMask ()
 objectsFromMask (const objectsFromMask &other)
virtual ~objectsFromMask ()
virtual const char * getTypeName () const
bool apply (const channel8 &src8, std::list< ioPoints > &lstIOPointLists)
bool apply (const matrix< int > &src, std::list< ioPoints > &lstIOPointLists)
bool apply (const channel8 &src8, std::list< borderPoints > &lstBorderPointLists)
bool apply (const imatrix &src, std::list< borderPoints > &lstBorderPointLists)
bool apply (const channel8 &src8, std::list< areaPoints > &lstAreaPointLists)
bool apply (const matrix< int > &src, std::list< areaPoints > &lstAreaPointLists)
bool apply (const channel8 &src8, std::list< areaPoints > &lstAreaPointLists, matrix< int > &labeledMask)
bool apply (const matrix< int > &src, std::list< areaPoints > &lstAreaPointLists, matrix< int > &labeledMask)
bool apply (const channel8 &src8, tree< objectStruct > &objectTree)
bool apply (const matrix< int > &src, tree< objectStruct > &objectTree)
objectsFromMaskcopy (const objectsFromMask &other)
virtual functorclone () const
const parametersgetParameters () const

Detailed Description

This class works on channel8/imatrix to extract connected components and describes them as the topological order of "objects" and "holes".

In the following example there are four objects, a triangle, a rectangle, a circle and a line. There are also two holes. The first one is inside the rectangle, the second is inside the circle. The circle itself and the line are inside the first hole.

  ---------------------------------
  ---*******-----------------------
  ----*****------------------------
  -----***----***************------
  ------*-----***************------
  ------------**-----------**------
  ------------**---***---*-**------
  ------------**--**-**--*-**------
  ------------**---***---*-**------
  ------------**---------*-**------
  ------------**-----------**------
  ------------***************------
  ------------***************------
  ---------------------------------

  "-" means background
  "*" indicates objects

The topological structure of objects and holes can be described as a tree, where odd numbered levels contain objects and even numbered contain holes. (Level 0 is an exception, because it represents the top-level, which in general stands for the whole image.

For the given example the tree looks like this:

 level 0             image
                       /\
                      /  \
 level 1   triangle(*)    rectangle(*)
                               \
                                \
 level 2                       hole(-)
                                /\
                               /  \
 level 3              circle(*)    line(*)
                        /
                       /
 level 4        hole(-)

Each node of the tree contains borderPoints, areaPoints and ioPoints. The tree can be obtained by using the apply(...tree<objectStruct>...) method.

If you are only interested in the objects and don't need the holes, then you can use the other apply() methods, which deliver a list of borderPoints, ioPoints or areaPoints for each object. A labeled mask is also available.


Member Enumeration Documentation

anonymous enum

Chain code constants (also used in geometricFeatures, hence public).

Enumerator:
Invalid 

Invalid.

E 

East or Right.

SE 

South-East or Bottom Right.

S 

South or Bottom.

SW 

South-West or Bottom Left.

W 

West or Left.

NW 

North-West or Upper Left.

N 

North or Top.

NE 

North-East or Upper Right.


Constructor & Destructor Documentation

lti::objectsFromMask::objectsFromMask (  ) 

constructor

lti::objectsFromMask::objectsFromMask ( const objectsFromMask other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::objectsFromMask::~objectsFromMask (  )  [virtual]

destructor


Member Function Documentation

bool lti::objectsFromMask::apply ( const matrix< int > &  src,
tree< objectStruct > &  objectTree 
)

operates on the given parameter to extract objects AND holes in their topological order.

Parameters:
src matrix<int> input-channel
objectTree tree, that contains io-, border- and areaPoints
bool lti::objectsFromMask::apply ( const channel8 src8,
tree< objectStruct > &  objectTree 
)

operates on the given parameter to extract objects AND holes in their topological order.

Parameters:
src8 channel8 input-channel
objectTree tree, that contains io-, border- and areaPoints
bool lti::objectsFromMask::apply ( const matrix< int > &  src,
std::list< areaPoints > &  lstAreaPointLists,
matrix< int > &  labeledMask 
)

operates on the given parameter to extract only objects.

Parameters:
src matrix<int> input-channel
lstAreaPointLists list of areaPoints. The boundary of each areaPoints object will be updated.
labeledMask returns a matrix of integers, what represent the number of the segmented object
bool lti::objectsFromMask::apply ( const channel8 src8,
std::list< areaPoints > &  lstAreaPointLists,
matrix< int > &  labeledMask 
)

operates on the given parameter to extract only objects.

Parameters:
src8 channel8 input-channel
lstAreaPointLists list of area points. The boundary of each areaPoints object will be updated.
labeledMask returns a matrix of integers, what represent the number of the segmented object
bool lti::objectsFromMask::apply ( const matrix< int > &  src,
std::list< areaPoints > &  lstAreaPointLists 
)

operates on the given parameter to extract only objects.

Parameters:
src matrix<int> input-channel
lstAreaPointLists std::list of areaPoints. The boundary of each areaPoints object will be updated.
bool lti::objectsFromMask::apply ( const channel8 src8,
std::list< areaPoints > &  lstAreaPointLists 
)

operates on the given parameter to extract only objects.

Parameters:
src8 channel8 input-channel
lstAreaPointLists std::list of areaPoints. The boundary of each areaPoints object will be updated.
bool lti::objectsFromMask::apply ( const imatrix src,
std::list< borderPoints > &  lstBorderPointLists 
)

operates on the given parameter to extract only objects.

Parameters:
src matrix<int> input-channel
lstBorderPointLists std::list of borderPoints
bool lti::objectsFromMask::apply ( const channel8 src8,
std::list< borderPoints > &  lstBorderPointLists 
)

operates on the given parameter to extract only objects.

Parameters:
src8 channel8 input-channel
lstBorderPointLists std::list of borderPoints
bool lti::objectsFromMask::apply ( const matrix< int > &  src,
std::list< ioPoints > &  lstIOPointLists 
)

operates on the given parameter to extract only objects.

Parameters:
src matrix<int> input-channel
lstIOPointLists std::list of ioPoints
bool lti::objectsFromMask::apply ( const channel8 src8,
std::list< ioPoints > &  lstIOPointLists 
)

operates on the given parameter to extract only objects.

Parameters:
src8 channel8 input-channel
lstIOPointLists std::list of ioPoints
virtual functor* lti::objectsFromMask::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::segmentation.

objectsFromMask& lti::objectsFromMask::copy ( const objectsFromMask other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::segmentation.

const parameters& lti::objectsFromMask::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

virtual const char* lti::objectsFromMask::getTypeName (  )  const [virtual]

returns the name of this type ("objectsFromMask")

Reimplemented from lti::segmentation.


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

Generated on Sat Apr 10 15:27:38 2010 for LTI-Lib by Doxygen 1.6.1