MATLAB图像形态学

BW1 = imread(‘circbw.tif’); %读取图像
subplot(121), imshow(BW1); title(’???’);
SE = strel(‘rectangle’,[40 30]); %生成矩形结构元素
BW2 = imopen(BW1,SE);%对图像直接进行开运算
subplot(122), imshow(BW3); title(‘开运算后的图像’);
在这里插入图片描述
originalBW = imread(‘circles.png’);
subplot(121), imshow(originalBW); title(‘原始的图像’);
se = strel(‘disk’,10);
closeBW = imclose(originalBW,se);
subplot(122), imshow(closeBW); title(‘关运算后的图像’)
在这里插入图片描述
BW1 = imread(‘circbw.tif’);
BW2 = bwmorph(BW1,‘skel’,Inf);
subplot(121), imshow(BW1) ; title(‘原始图像’);
subplot(122), imshow(BW2) ; title(‘骨架提取后的图像’)
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_38127487/article/details/115254291