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

    %% Create H-Maxima Transform
% 
%%
% Create simple sample array of zeros with several maxima.
a = zeros(10,10);
a(2:4,2:4) = 3;  
a(6:8,6:8) = 8  
%%
% Calculate the maxima equal to 4 or more. Note how the area of the image
% set to 3 is not included. 
b = imhmax(a,4)