%膨胀和腐蚀
f=imread('aerial.tif');
subplot(2,2,1),imshow(f),title('原图像')
se=strel('square',3);%结构算子
gd=imdilate(f,se);%膨胀
subplot(2,2,2),imshow(gd),title('膨胀后的图像')
ge=imerode(f,se);%腐蚀
subplot(2,2,3),imshow(ge),title('腐蚀后的图像')
morph_grad=imsubtract(gd,ge);%形态学梯度
subplot(2,2,4),imshow(morph_grad),title('形态学梯度')
膨胀和腐蚀
最新推荐文章于 2025-05-25 23:26:42 发布