⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 medical.m

📁 提供的文件包含matlab的多个图象处理程序,其中有图象分割,以及图象边缘提取的.
💻 M
字号:
I = imread('rice.tif');
figure, imshow(I), title('原图');
BWs = edge(I, 'sobel', (graythresh(I) * .1));%边缘提取
figure, imshow(BWs), title('binary gradient mask');
se90 = strel('line', 3, 90);%建立结构函数
se0 = strel('line', 3, 0);%建立结构函数
BWsdil = imdilate(BWs, [se90 se0]);
figure, imshow(BWsdil), title('dilated gradient mask');
BWdfill = imfill(BWsdil, 'holes');
figure, imshow(BWdfill);title('binary image with filled holes');
BWnobord = imclearborder(BWdfill, 4);
figure, imshow(BWnobord), title('清除了边界的图像');
seD = strel('diamond',1);
BWfinal = imerode(BWnobord,seD);
BWfinal = imerode(BWfinal,seD);
figure, imshow(BWfinal), title('segmented image');
BWoutline = bwperim(BWfinal);
Segout = I; 
Segout(BWoutline) = 255; 
figure, imshow(Segout), title('outlined original image');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -