<< imradon Image Transforms Image Types and Color Space Conversions >>

IPCV >> Image Transforms > imwatershed

imwatershed

Performs a marker-based image segmentation using the watershed algorithm.

Syntax

imout = imwatershed(imin)

Parameters

imin :

Input 8-bit 3-channel image.

markers :

Double precision single-channel image (map) of markers. It should have the same size as image.

imout :

Output labelled image

Description

The function implements one of the variants of watershed, non-parametric marker-based segmentation algorithm.

Examples

S = imread(fullpath(getIPCVpath() + "/images/three_objects.png"));
Sgray = rgb2gray(S);
Sb = im2bw(Sgray,0.1);
Sd = imdistransf(Sb);
dist = Sd > 0.4;
[markers,n] = imlabel(dist);
markers(1:5,1:5) = 255;
Sw = imwatershed(S, markers);
imshow(Sw,hsvcolormap(3));

See also

Authors

Bibliography

1. OpenCV 4.1.2 Online Documentation


Report an issue
<< imradon Image Transforms Image Types and Color Space Conversions >>