w2img::Watershed Class Reference

List of all members.

Detailed Description

Segments a weather-type image using the watershed algorithm.

Author:
: Lakshman
Version:
:
Id
w2img_Watershed.h,v 1.3 2009/06/02 20:17:56 lakshman Exp


Public Member Functions

 Watershed (int marker_min, int marker_max)
 To create a Watershed object to use to segment.
code::Image< int > vincent_segment (const code::Image< int > &img, bool only_dividing_lines=false) const
 Segment the image.
code::Image< int > vincent_segment2 (const code::Image< int > &img, bool only_dividing_lines=false) const
 The Vincent/Soille Algorithm with some of the operations re-ordered for clarity.
code::Image< int > heir_segment (const code::Image< int > &img, int thresh, int dist_thresh) const
 Returns a heirarchially labeled image.
code::Image< int > najman_segment (const code::Image< int > &img) const
 The Najman/Schmitt Algorithm with some of the operations re-ordered for clarity.

Static Public Attributes

static const int WSHED

Protected Member Functions

bool is_valid (int val) const
 is the given value within bounds?
bool is_valid (code::Image< int > img, int x, int y) const
 Helper function to test whether pixel x,y contains a valid value.

Static Protected Member Functions

static bool within_thresh (const Pixel &p, const code::Image< int > &level, int dist_thresh)
 Helper function to find out whether the Hamming distance of the pixel from a level lower than it is < dist_thresh.

Classes

class  Pixel
class  RegionInfo


Constructor & Destructor Documentation

w2img::Watershed::Watershed ( int  marker_min,
int  marker_max 
)

To create a Watershed object to use to segment.

Parameters:
marker_min : the lowest "valid" value for a storm. This has to be greater than zero; if valid values can be negative, scale the data.
marker_max : the highest "valid" value for a storm.


Member Function Documentation

code::Image<int> w2img::Watershed::heir_segment ( const code::Image< int > &  img,
int  thresh,
int  dist_thresh 
) const

Returns a heirarchially labeled image.

Label 1 is the lowest and higher labels contain lower labels.

The watersheds are the Vincent-Soille dividing lines, so the heirarchial labels have no relation to the watershed dividing lines.

bool w2img::Watershed::is_valid ( code::Image< int >  img,
int  x,
int  y 
) const [inline, protected]

Helper function to test whether pixel x,y contains a valid value.

x,y need not be inside the image (bounds are tested)

bool w2img::Watershed::is_valid ( int  val  )  const [inline, protected]

is the given value within bounds?

code::Image<int> w2img::Watershed::najman_segment ( const code::Image< int > &  img  )  const

The Najman/Schmitt Algorithm with some of the operations re-ordered for clarity.

The result is identical to the original.

With optimization -O5 on g++, there is no performance cost: it takes 3 usec of CPU time to process a 1000x1000 image using either method.

code::Image<int> w2img::Watershed::vincent_segment ( const code::Image< int > &  img,
bool  only_dividing_lines = false 
) const

Segment the image.

(Vincent/Soille Algorithm) . If only_dividing_lines is set to true, then only those are retained in the resulting image. Ordinarily, the completely labeled image is returned.

Source: Luc Vincent and Pierre Soille, Watersheds in Digital Spaces, IEEE Transactions on Pattern Analysis and Machine Intelligence, June 1991.

code::Image<int> w2img::Watershed::vincent_segment2 ( const code::Image< int > &  img,
bool  only_dividing_lines = false 
) const

The Vincent/Soille Algorithm with some of the operations re-ordered for clarity.

The result is identical to the original.

With optimization -O5 on g++, there is no performance cost: it takes 3 usec of CPU time to process a 1000x1000 image using either method.

static bool w2img::Watershed::within_thresh ( const Pixel p,
const code::Image< int > &  level,
int  dist_thresh 
) [static, protected]

Helper function to find out whether the Hamming distance of the pixel from a level lower than it is < dist_thresh.


Member Data Documentation

const int w2img::Watershed::WSHED [static]


Generated on Fri May 4 13:40:23 2012 for WDSS-IIw2algs by  doxygen 1.4.7