| [Top] [Up] [Prev] [Next] | [Up] [Basic Concepts] [Demonstrations] [Functions] | SDC Morphology Toolbox V1.1 15Jan02 |
y = mmswatershed( f, g, B, LINEREG ) 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".y: Gray-scale (uint8 or uint16) or binary image (logical uint8). 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] .
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
|
| [Top] [Up] [Prev] [Next] | [Up] [Basic Concepts] [Demonstrations] [Functions] |
|
| Copyright (c) 1998-2002 by SDC Information Systems | ||