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 |
w2img::Watershed::Watershed | ( | int | marker_min, | |
int | marker_max | |||
) |
To create a Watershed object to use to segment.
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. |
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.
const int w2img::Watershed::WSHED [static] |