[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] SDC Morphology Toolbox V1.1 15Jan02

mmswatershed - Detection of similarity-based watershed from markers.


Synopsis
y = mmswatershed( f, g, B, LINEREG )
Input
f: Gray-scale (uint8 or uint16) image.
g: Gray-scale (uint8 or uint16) or binary image (logical uint8). Marker image. If binary, each connected component is an object marker. If gray, it is assumed it is a labeled image.
B: Structuring element. (watershed connectivity) Default: Elementary cross (mmsecross).
LINEREG: String. 'LINES' or ' REGIONS'. Default: "LINES".
Output
y: Gray-scale (uint8 or uint16) or binary image (logical uint8).
Description
mmswatershed creates the image y by detecting the domain of the catchment basins of f indicated by g, according with the connectivity defined by B. This watershed is a modified version where each basin is defined by a similarity criteria between pixels. The original watershed is normally applied to the gradient of the image. In this case, the gradient is taken internally. According to the flag LINEREG y will be a labeled image of the catchment basins domain or just a binary image that presents the watershed lines. The implementation of this function is based on [LF00] .
Examples

Numerical

f = uint8([...
    0   0   0   0   0   0   0;...
    0   1   0   0   0   1   0;...
    0   1   0   0   0   1   0;...
    0   1   1   1   1   1   0;...
    0   1   0   0   0   0   0;...
    0   0   0   0   0   0   0]);
m = uint8([...
    0   0   0   0   0   0   0;...
    0   1   0   0   0   0   0;...
    0   0   0   0   0   0   0;...
    0   0   0   0   0   0   0;...
    0   0   0   0   0   0   0;...
    0   0   0   2   0   0   0]);
mmswatershed(f,m,mmsecross,'REGIONS')

ans =
     2     2     2     2     2     2     2
     2     1     2     2     2     1     2
     2     1     2     2     2     1     2
     2     1     1     1     1     1     2
     2     1     2     2     2     2     2
     2     2     2     2     2     2     2
See Also
mmcwatershed - Detection of watershed from markers.
mmfreedom - Control automatic data type conversion.
mmsebox - Create a box structuring element.
mmsecross - Cross structuring element.
mmwatershed - Watershed detection.

[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] Valid XHTML 1.0!
Copyright (c) 1998-2002 by SDC Information Systems