imimposemin
Impose regional minima at marker pixels.
📝Syntax
J = imimposemin(I, BW)
J = imimposemin(I, BW, conn)
📥Input Arguments
Parameter Description
I Input finite real 2-D image.
BW Binary marker mask with the same size as I.
conn Connectivity, either 4, 8, or an equivalent 3-by-3 matrix.
📤Output Arguments
Parameter Description
J Image whose marker pixels are forced to be minima.
📄Description

imimposemin modifies an image so that marker pixels become the lowest minima. This is useful before watershed segmentation when known markers should seed catchment basins.

💡Examples
Use markers before watershed
I=[5 4 5;4 3 4;5 4 5];
markers=false(3,3); markers(1,1)=true;
J=imimposemin(I,markers);
L=watershed(J,4);
figure; subplot(1,3,1); imagesc(I); title('Input');
subplot(1,3,2); imagesc(J); title('Imposed');
subplot(1,3,3); imagesc(L); title('Watershed');
Example illustration
🔗See Also
imhminimextendedminimregionalminwatershedactivecontour
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub