如何填补血管之间的空隙

时间:2017-07-11 05:57:39

标签: matlab image-segmentation

我必须填补血管之间的空隙。我尝试用磁盘和球型结构元件进行扩张,但它没有帮助它只扩张血管并且仍然出现间隙。下图是分割结果和相应的基本事实。 enter image description here

请帮助我填补空白。

1 个答案:

答案 0 :(得分:0)

    [imagename, imagepath] = uigetfile({'*.png; *.tif;*.jpg;*.png'},'Select file');
address = fullfile( imagepath,imagename);
a = imread(address);
% figure, imshow(a);
image = imresize(a,  [512 512]);          %Resizing image
tic;
gchanel=image(:,:,2);                         %Green Chanel Extraction
% figure,imshow(gchanel);        
Igchanel = imcomplement(gchanel);             %Inversion
% figure,imshow(Igchanel);
conenhance = adapthisteq(Igchanel);           %Contrast Enhancement
% figure,imshow(conenhance);
g = imgaussfilt(conenhance,2);                %Gaussian filtering
% figure,imshow(g);
se = strel('ball',8,8) ;                     
tophat = imtophat( conenhance,se);             %Tophat transform
% figure,imshow(tophat)
med = medfilt2(tophat);                        %Median filtering
background = imopen(med,strel('disk',15));      
I2 = med - background;                         % Background Removal
% figure,imshow(med);
I3 = imadjust(I2);                             %Intensity Adjustment
level = graythresh(I3);                        % Gray Threshold
bw = im2bw(I3,level);                          % Binarization                                
% figure,imshow(I2);
figure,imshow(bw);
上面的@ Carlos Borau是我在下面给出的示例图像上尝试的代码。 enter image description here