1 简介
医学分割的准确性对医生判断疾病的真实情况并作出正确的诊断计划至关重要。医学图像分割效果的好坏直接决定后期的医学图像分析和图像理解的正确与否。分水岭分割是一种基于数学形态学的图像分割方法,具有计算速度快、精确定位图像边缘的特性,因而受到极大的关注,但它通常存在严重的过分割问题,如何克服过分割问题一直是研究的重点和热点。传统的分水岭算法是对图像的梯度图像进行分割,图像在获取、传输和接收的过程中易添加噪声,而梯度算子易受噪声或量化误差的影响,产生很多局部极小值,导致过度分割现象。
2 部分代码
function Watershed_Fun(fileName) rgb = imread(fileName); if ndims(rgb) == 3 I = rgb2gray(rgb); else I = rgb; end sz = size(I); if sz(1) ~= 256 I = imresize(I, 256/sz(1)); rgb = imresize(rgb, 256/sz(1)); end hy = fspecial('sobel'); hx = hy'; Iy = imfilter(double(I), hy, 'replicate'); set(h2,'PaperPositionMode','auto'); print(h2,'-dtiff','-r200',fileurl); h3 = figure(3); set(h3, 'Name', '图像梯度显示', 'NumberTitle', 'off'); subplot(1, 2, 1); imshow(rgb, []); title('待处理图像'); subplot(1, 2, 2); imshow(gradmag, []); title('梯度图像'); fileurl = fullfile(filefolder, '3'); set(h3,'PaperPositionMode','auto'); print(h3,'-dtiff','-r200',fileurl); h4 = figure(4); imshow(rgb, []); hold on; himage = imshow(Lrgb); set(h4, 'Name', '图像分水岭分割', 'NumberTitle', 'off'); set(himage, 'AlphaData', 0.3); hold off; fileurl = fullfile(filefolder, '4'); set(h4,'PaperPositionMode','auto'); print(h4,'-dtiff','-r200',fileurl);
3 仿真结果
4 参考文献
[1]毕浩宇, and 李燕. "一种基于形态学分水岭算法的图像分割改进算法." 长治学院学报 33.002(2016):69-71.