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

    %% Dilate Grayscale Image with Rolling Ball
% 
%%
% Read grayscale image into the workspace.
originalI = imread('cameraman.tif');
%%
% Create a nonflat ball-shaped structuring element.
se = offsetstrel('ball',5,5);
%%
% Dilate the image.
dilatedI = imdilate(originalI,se);
%%
% Display the original image and the dilated image.
figure
imshow(originalI)
figure
imshow(dilatedI)