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

lti::meanShiftSegmentation Class Reference

This is the implementation of the mean shift segmentation algorithm. More...

#include <ltiMeanShiftSegmentation.h>

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

List of all members.

Classes

struct  luvPixel
 like rgbPixel for RGB-ColorSpace, is luvPixel for LUV-ColorSpace More...
class  parameters
 the parameters for the class meanShiftSegmentation More...

Public Member Functions

 meanShiftSegmentation ()
 meanShiftSegmentation (const parameters &par)
 meanShiftSegmentation (const meanShiftSegmentation &other)
virtual ~meanShiftSegmentation ()
virtual const char * getTypeName () const
bool apply (const lti::image &src, lti::image &dest)
bool apply (const lti::image &src, lti::imatrix &dest)
bool apply (const lti::image &src, lti::imatrix &labels, lti::palette &colorMap)
bool apply (const lti::channel8 &chnl1, const lti::channel8 &chnl2, const lti::channel8 &chnl3, lti::imatrix &dest)
bool apply (const lti::image &src, lti::image &destFiltered, lti::image &destSegmented, lti::imatrix &destLabels, lti::palette &destColorMap)
bool filter (const lti::image &src, lti::image &dest)
bool filter (lti::image &srcdest)
meanShiftSegmentationcopy (const meanShiftSegmentation &other)
virtual functorclone () const
const parametersgetParameters () const

Detailed Description

This is the implementation of the mean shift segmentation algorithm.

It is described in

D. Comaniciu, P. Meer, "Mean Shift: A Robust Approach toward Feature Space Analysis" appeared in IEEE Trans. Pattern Analysis Machine Intell. Vol. 24, No. 5, 603-619, 2002 (original link here )

http://www.caip.rutgers.edu/~comanici/Papers/MsRobustApproach.pdf

The code here is based on the code of the original authors, modified extensively for the use with the LTI-Lib. It has changed a lot since then to provide more functionality and configuration options.

There are two implementations available:

The classic implementation is selected setting the parameter parameters::classicAlgorithm to true. It is based on an old code example published by Comaniciu and colleagues a few years ago. This implementation was not as good as the newer version, but was already available in the LTI-Lib. Since several applications were adapted to use that mean-shift version, the default behaviour of this functors has not been changed.

The new implementation is an adaption of Comaniciu and Meer's EDISON code (http://www.caip.rutgers.edu/riul/research/robust.html). It can be selected setting parameters::classicAlgorithm to false. Decisive for the result of the new implementation is the choice of the parameters parameters::sigmaR, parameters::sigmaS, parameters::maxNeighbourColorDistance, and the parameters::speedup.

Warning:
This functor will be completely reviewed soon. Its interface may change a little bit to improve its usability. It has now the problem that the parameters for the classic version and the ones for the new algorithmic implementation are different and they shouldn't.
Todo:
The interface for classic and new algorithms has to be unified and simplified. There are also several efficiency aspects to be reviewed.

Constructor & Destructor Documentation

lti::meanShiftSegmentation::meanShiftSegmentation (  ) 

default constructor

lti::meanShiftSegmentation::meanShiftSegmentation ( const parameters par  ) 

default constructor

lti::meanShiftSegmentation::meanShiftSegmentation ( const meanShiftSegmentation other  ) 

copy constructor

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

destructor


Member Function Documentation

bool lti::meanShiftSegmentation::apply ( const lti::image src,
lti::image destFiltered,
lti::image destSegmented,
lti::imatrix destLabels,
lti::palette destColorMap 
)

Apply the mean shift segmentation algorithm to the given image.

This image will be internally transformed into the Luv color space, as proposed by Comaniciu et.al. in their original paper.

Parameters:
src image with the source data.
destFiltered the meanshift filtered image (not available for classic algorithm)
destSegmented the segmented image
destLabels label associating each pixel to a mode and thus a color to each pixel
destColorMap the colors of the found modes
Returns:
true if apply successful or false otherwise.
bool lti::meanShiftSegmentation::apply ( const lti::channel8 chnl1,
const lti::channel8 chnl2,
const lti::channel8 chnl3,
lti::imatrix dest 
)

Apply the mean shift segmentation algorithm to a color image, which has been already split into three channels.

The algorithm will work with these channels without converting them into the Luv color space. This allows the use of the mean shift segmentation in other color spaces than Luv.

Parameters:
chnl1 first channel of the source color image.
chnl2 second channel of the source color image.
chnl3 third channel of the source color image.
dest imatrix where the result (region-labels) will be left.
Returns:
true if apply successful or false otherwise.
bool lti::meanShiftSegmentation::apply ( const lti::image src,
lti::imatrix labels,
lti::palette colorMap 
)

Apply the mean shift segmentation algorithm to the given image.

This image will be internally transformed into the Luv color space, as proposed by Comaniciu et.al. in their original paper.

Parameters:
src image with the source data.
labels imatrix where the result (region-labels) will be left.
colorMap the color palette used
Returns:
true if apply successful or false otherwise.
bool lti::meanShiftSegmentation::apply ( const lti::image src,
lti::imatrix dest 
)

Apply the mean shift segmentation algorithm to the given image.

This image will be internally transformed into the Luv color space, as proposed by Comaniciu et.al. in their original paper.

Parameters:
src image with the source data.
dest imatrix where the result (region-labels) will be left.
Returns:
true if apply successful or false otherwise.
bool lti::meanShiftSegmentation::apply ( const lti::image src,
lti::image dest 
)

Apply the mean shift segmentation algorithm to the given image.

This image will be internally transformed into the Luv color space, as proposed by Comaniciu et.al. in their original paper.

Parameters:
src image with the source data.
dest image where the result (segmented image) will be left.
Returns:
true if apply successful or false otherwise.
virtual functor* lti::meanShiftSegmentation::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::segmentation.

meanShiftSegmentation& lti::meanShiftSegmentation::copy ( const meanShiftSegmentation 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::meanShiftSegmentation::filter ( lti::image srcdest  ) 

filter the image with meanshift algorithm

Parameters:
srcdest the image to be filtered
Returns:
true if apply successful or false otherwise.
bool lti::meanShiftSegmentation::filter ( const lti::image src,
lti::image dest 
)

filter the image with meanshift algorithm

Parameters:
src the image to be filtered
dest the result will be left here
Returns:
true if apply successful or false otherwise.
const parameters& lti::meanShiftSegmentation::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

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

returns the name of this type ("meanShiftSegmentation")

Reimplemented from lti::segmentation.


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

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