latest version v1.9 - last update 10 Apr 2010 |
Watershed segmentation of a channel8. More...
#include <ltiWatershedSegmentation.h>
Classes | |
class | parameters |
the parameters for the class watershedSegmentation More... | |
Public Member Functions | |
watershedSegmentation () | |
watershedSegmentation (const parameters &par) | |
watershedSegmentation (const watershedSegmentation &other) | |
virtual | ~watershedSegmentation () |
virtual const char * | getTypeName () const |
bool | apply (channel8 &srcdest) |
bool | apply (const channel8 &src, channel8 &dest) |
bool | apply (const channel8 &src, matrix< int > &result) |
watershedSegmentation & | copy (const watershedSegmentation &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Watershed segmentation of a channel8.
Algorithms:
Luc Vincent and Pierre Soille. "Watersheds in Digital Spaces: An Efficient Algorithm Based on Immersion Simulations". IEEE transactions on pattern analysis and machine intelligence, vol. 13, No. 6, June 1991, pp. 583-598
and
Patrick De Smet and Rui Luis V.P.M. Pires "Implementation and analysis of an optimized rainfalling watershed algorithm". IS&T\/SPIE's 12th Annual Symposium Electronic Imaging 2000, January 2000, pp. 759-766
Watershed segmentation is a morphological operator used to segment gray valued images, based on viewing the gray image as a topographical map. Valleys will be flooded with water until the water surpasses the sheds separating them. At the contact lines the "watershed lines" are created and constitute the limits between the image regions.
The topological map is usually a gradient map (the magnitude of the gradient) that can be obtained with the lti::orientationMap functor or with the lti::colorContrastGradient, or directly using the lti::gradientKernelX and lti::gradientKernelY and the lti::convolution operator.
Two kinds of apply() methods are provided:
lti::watershedSegmentation::watershedSegmentation | ( | ) |
default constructor
lti::watershedSegmentation::watershedSegmentation | ( | const parameters & | par | ) |
constructor with parameters
lti::watershedSegmentation::watershedSegmentation | ( | const watershedSegmentation & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::watershedSegmentation::~watershedSegmentation | ( | ) | [virtual] |
destructor
creates a region mask on the given matrix only exact watersheds are marked 0, regions are numbered 1,2,.
..
src | channel8 with the source data. This is usually the gradient of an intensity image or a color contrast gradient. | |
result | matrix<int> with the resulting region information, with a label per basin. |
bool lti::watershedSegmentation::apply | ( | channel8 & | srcdest | ) |
virtual functor* lti::watershedSegmentation::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Reimplemented from lti::segmentation.
watershedSegmentation& lti::watershedSegmentation::copy | ( | const watershedSegmentation & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::segmentation.
const parameters& lti::watershedSegmentation::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
virtual const char* lti::watershedSegmentation::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("watershedSegmentation")
Reimplemented from lti::segmentation.