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

    %% Erode Grayscale Image with Rolling Ball
%  
%%
% Read grayscale image into the workspace.
originalI = imread('cameraman.tif');
%%
% Create a nonflat offsetstrel object.
se = offsetstrel('ball',5,5);
%%
% Erode the image.
erodedI = imerode(originalI,se);
%%
% Display original image and eroded image.
figure
imshow(originalI)
figure
imshow(erodedI)