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

lti::csPresegmentation Class Reference

The csPresegmentation functor (states for color space presegmentation) tries to detect which pixels belong to the background and which not. More...

#include <ltiCsPresegmentation.h>

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

List of all members.

Classes

class  parameters
 the parameters for the class csPresegmentation More...

Public Member Functions

 csPresegmentation ()
 csPresegmentation (const csPresegmentation &other)
virtual ~csPresegmentation ()
virtual const char * getTypeName () const
bool apply (const image &src, channel8 &mask)
csPresegmentationcopy (const csPresegmentation &other)
csPresegmentationoperator= (const csPresegmentation &other)
virtual functorclone () const
const parametersgetParameters () const

Protected Member Functions

bool validBackground (const rgbPixel &p, const trgbPixel< float > &mean, const trgbPixel< float > &var, const float &tolerance) const

Protected Attributes

palette lastPalette

Detailed Description

The csPresegmentation functor (states for color space presegmentation) tries to detect which pixels belong to the background and which not.

For its task there are some assumtions/requirements:

These conditions are not met in many applications, for which other segmentation approaches have to be found.

The algorithm works as follows:

First, a color quantization using k-Means is done. This produces usually a "noisy" index mask and a palette. A median filter or a k-Nearest-Neighbor Filter smooths this mask. Assuming that the border of the image contains mostly background pixels, some simple statistics are done, to decide which palette entries belong to the background. Pixels belonging to other palette entries are taken as the object pixels.

See the lti::csPresegmentation::parameters for more information.


Constructor & Destructor Documentation

lti::csPresegmentation::csPresegmentation (  ) 

default constructor

lti::csPresegmentation::csPresegmentation ( const csPresegmentation other  ) 

copy constructor

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

destructor


Member Function Documentation

bool lti::csPresegmentation::apply ( const image src,
channel8 mask 
)

apply the presegmentation algorithm to the given image and return a mask where the background pixels will be mark with the value zero and the non-background pixels with a non-zero value.

Note that some information of this segmentation is "stored" in the internal state, which affects the next segmentation steps. (see lti::csPresegmentation::parameters::useAlwaysNewPalette)

Parameters:
src image with the source data.
mask the mask with the found objects.
Returns:
true if apply successful or false otherwise.
virtual functor* lti::csPresegmentation::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::segmentation.

csPresegmentation& lti::csPresegmentation::copy ( const csPresegmentation 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::csPresegmentation::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

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

returns the name of this type ("csPresegmentation")

Reimplemented from lti::segmentation.

csPresegmentation& lti::csPresegmentation::operator= ( const csPresegmentation other  ) 

alias for copy member

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

Reimplemented from lti::functor.

bool lti::csPresegmentation::validBackground ( const rgbPixel p,
const trgbPixel< float > &  mean,
const trgbPixel< float > &  var,
const float &  tolerance 
) const [inline, protected]

valid background returns true if the given pixel lies between the mean value and the given variance.


Member Data Documentation

last used palette


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

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