对图像的轮廓进行提取 先对原图像进行腐蚀,然后使用原图减去腐蚀后的图像即可得到原图像轮廓 close all;clear all;clc; I= imread('D:\数字图像处理\tx.jpg'); %模板 sc = strel('disk',1); %腐蚀函数 a = imerode(I,sc); g = I-a; subplot(121);imshow(I);title("原图"); subplot(122);imshow(g);title("轮廓");