www.gusucode.com > images 案例代码 matlab源码程序 > images/FindRegionalMinimaInSimpleSampleImageExample.m

    %% Find Regional Minima in Simple Sample Image
% 
%%
% Create a simple sample array with several regional minima.
A = 10*ones(10,10);
A(2:4,2:4) = 3;       
A(6:8,6:8) = 8 
%%
% Calculate the regional minima. The function returns a binary image, the
% same size as the input image, in which pixels with the value |1|
% represent the regional minima. |imregionalmin| sets all other pixels in
% to |0|.
regmin = imregionalmin(A)