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

lti::cwagmSegmentation Class Reference

CWAGM Segmentation. More...

#include <ltiCWAGMSegmentation.h>

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

List of all members.

Classes

class  parameters
 the parameters for the class cwagmSegmentation More...

Public Member Functions

 cwagmSegmentation ()
 cwagmSegmentation (const parameters &par)
 cwagmSegmentation (const cwagmSegmentation &other)
virtual ~cwagmSegmentation ()
virtual const char * getTypeName () const
bool apply (const image &src, imatrix &regions, ivector &regionSizes)
bool apply (const image &src, image &preproc, imatrix &regions, ivector &regionSizes)
bool apply (const image &src, image &preproc, imatrix &regions, ivector &regionSizes, channel &gradMag, channel &gradArg)
cwagmSegmentationcopy (const cwagmSegmentation &other)
cwagmSegmentationoperator= (const cwagmSegmentation &other)
virtual functorclone () const
const parametersgetParameters () const
virtual bool updateParameters ()

Protected Member Functions

bool preprocess (const image &src, image &dest) const
bool worker (const image &orig, const image &preproc, imatrix &regions, ivector &regionSizes, channel &gradM, channel &gradA, vector< float > &gradHisto, float &maxGrad)
bool enhanceContrast (image &src) const

Protected Attributes

local functors



medianFilter median
watershedSegmentation watershed
splitImagesplitter
colorContrastGradient colorContrast
regionGraphColorHaris haris

Detailed Description

CWAGM Segmentation.

CWAGM means Color Watershed - Adjacency Graph Merge. It is a segmentation algortihms based on low level information introduced in P. Alvarado "Segmentation of color images for interactive 3D object retrieval". Ph.D. Thesis. RWTH-Aachen, 2004. http://www.bth.rwth-aachen.de/job/disslist.pl

This watershed-based concept is based on the ideas of Haris et.al. for a segmentation concept of gray-valued image, extended to color images. It uses (optionally) a median filtering to reduce the noise in each color channel, computes an over-segmentation with the watershed transformation and merge the regions to minimize the mean square error of a piece-wise constant image approximation.


Constructor & Destructor Documentation

lti::cwagmSegmentation::cwagmSegmentation (  ) 

default constructor

lti::cwagmSegmentation::cwagmSegmentation ( const parameters par  ) 

Construct a functor using the given parameters.

lti::cwagmSegmentation::cwagmSegmentation ( const cwagmSegmentation other  ) 

copy constructor

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

destructor


Member Function Documentation

bool lti::cwagmSegmentation::apply ( const image src,
image preproc,
imatrix regions,
ivector regionSizes,
channel gradMag,
channel gradArg 
)

Segmentate the image src and return many internal partial results that can be used in further processing units.

Note that there are several segmentation modes (like color ACA or mean-shift segmentation) which do not require the gradient computation. These modes will leave the given gradMag and gradArg untouched. This way, the gradients won't be unnecessarily computed and you can detect if they are computed or not: just give empty channels and if they are still empty after calling this method, you will have to compute them, if you need to.

Parameters:
src image with the source data.
preproc resulting preprocessed image.
regions labeled mask as imatrix, where the result will be left.
regionSizes sizes of each region in the regions mask.
gradMag magnitude of the color gradient
gradArg orientation of the color gradient
Returns:
true if apply successful or false otherwise.
bool lti::cwagmSegmentation::apply ( const image src,
image preproc,
imatrix regions,
ivector regionSizes 
)

operates on a copy of the given parameters.

Parameters:
src image with the source data.
preproc preprocessed image.
regions labeled mask as imatrix, where the result will be left.
regionSizes sizes of each region in the regions mask.
Returns:
true if apply successful or false otherwise.
bool lti::cwagmSegmentation::apply ( const image src,
imatrix regions,
ivector regionSizes 
)

operates on a copy of the given parameters.

Parameters:
src image with the source data.
regions labeled mask as imatrix, where the result will be left.
regionSizes sizes of each region in the regions mask.
Returns:
true if apply successful or false otherwise.
virtual functor* lti::cwagmSegmentation::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::segmentation.

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

copy data of "other" functor.

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

Reimplemented from lti::segmentation.

bool lti::cwagmSegmentation::enhanceContrast ( image src  )  const [protected]

The simplest contrast enhancement consists in mapping the input value range of each channel into 0 to 255, each channel independently of the others.

src MUST be connected. (see matrix<T>::mode())

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

returns used parameters

Reimplemented from lti::functor.

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

returns the name of this type ("cwagmSegmentation")

Reimplemented from lti::segmentation.

cwagmSegmentation& lti::cwagmSegmentation::operator= ( const cwagmSegmentation 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::cwagmSegmentation::preprocess ( const image src,
image dest 
) const [protected]

Preprocess Denoise and Enhance Contrast.

virtual bool lti::cwagmSegmentation::updateParameters (  )  [virtual]

Update functor's parameters.

Update the internal state of the functor according to the parameters. This special case the functor used to split the image into its color componentes is initialized here.

Returns:
true if successful, false otherwise

Reimplemented from lti::functor.

bool lti::cwagmSegmentation::worker ( const image orig,
const image preproc,
imatrix regions,
ivector regionSizes,
channel gradM,
channel gradA,
vector< float > &  gradHisto,
float &  maxGrad 
) [protected]

Split and merge with watersheds.

Parameters:
orig original color image
preproc preprocessed image
regions labeld mask with initial partition
regionSizes number of pixels per region
gradM magnitude of the color gradient
gradA orientation of the color gradient
gradHisto histogram of the gradient values
maxGrad maximum gradient value which is also the last value in the histogram.

Member Data Documentation

color contrast gradient functor used in edge detection

Haris region merging method (well, my adaption of it).

median filter

pointer to splitter object

Watershed segmentation functor.


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

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