Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Watershed transform

- example
`L = watershed(A)`

`L = watershed(A,conn)`

returns
a label matrix `L`

= watershed(`A`

)`L`

that identifies the watershed
regions of the input matrix `A`

, which can have
any dimension. The watershed transform finds "catchment basins" or
"watershed ridge lines" in an image by treating it as a surface where
light pixels represent high elevations and dark pixels represent low
elevations. The elements of `L`

are integer values
greater than or equal to `0`

. The elements labeled `0`

do
not belong to a unique watershed region. The elements labeled `1`

belong
to the first watershed region, the elements labeled 2 belong to the
second watershed region, and so on. By default, `watershed`

uses
8-connected neighborhoods for 2-D inputs and 26-connected neighborhoods
for 3-D inputs. For higher dimensions, `watershed`

uses
the connectivity given by `conndef(ndims(A),'maximal')`

.

specifies the connectivity to be used in the watershed computation.`L`

= watershed(`A`

,`conn`

)

Code Generation support: Yes.

MATLAB^{®} Function Block support: No.

[1] Meyer, Fernand, "Topographic distance
and watershed lines," *Signal Processing *,
Vol. 38, July 1994, pp. 113-125.

`bwdist`

| `bwlabel`

| `bwlabeln`

| `regionprops`

Was this topic helpful?