巩膜血管增强和自适应阈值

时间:2016-05-15 13:10:36

标签: matlab image-processing

我在UBIRIS眼科数据库对600x800图像的彩色图像进行巩膜识别后,试图增强巩膜血管。我的问题是,在我试图按照这篇文章写下这个确切的问题后,我的结果与论文中的结果不匹配,增强和阈值处理没有给出必要的结果,所以我不能继续开发我的巩膜匹配算法。

以下是我正在尝试使用的参考文件:https://scholarworks.iupui.edu/bitstream/handle/1805/2096/Thesis_OneDoc_Thomas_FinalETD.pdf

您将在PDF的第61页和第62页找到不适合我的部分。

这是我从以下开始的输入图像: input

这是分割图像,回馈巩膜区域: segmented image

最后,这是血管增强和自适应阈值处理后的图像。血管增强已经不像纸上那么好,但自适应阈值是完全错误的。

blood vessel enhancement adaptive thresholding

最后,这是我试图根据我之前链接的文章编写的MATLAB代码:

    I = rgb2gray(segmentedImage);
gaborArray = gabor([3,4,5],[0,90,180,270]); %maybe 0,90,180,270 or 0,45,90,135
[gaborMag, gaborPhase] = imgaborfilt(I,gaborArray);
f = zeros(size(I,1),size(I,2));
for i = 1:size(I,1)
    for j = 1:size(I,2)
        for k = 1:12
            f(i,j) = f(i,j) + gaborMag(i,j,k).^2;
        end
        f(i,j) = sqrt(f(i,j));
    end
end

maxh = max(f(:));

for i = 1:size(I,1)
    for j = 1:size(I,2)
        f(i,j) = f(i,j)/maxh;
    end
end

TH = 0.33;
[x,y] = find(f~=0);
hist = [x,y];
histH = histogram(hist,255,'Normalization','probability');
dataH = histH.Values;

thresholdsH = zeros(1,255);

%calculate sum minus constant for each case of T with absolute value and save into array
for i = 1:255
    currentH = 0;
    for j = 1:i
        currentH = currentH + dataH(j);
    end
    currentH = currentH - TH;
    currentH = abs(currentH);
    thresholdsH(i) = currentH;
end

[MH, thH] = min(thresholdsH);
thH = thH / 255;

B = zeros(size(I,1),size(I,2));

for i = 1:size(I,1)
    for j = 1:size(I,2)
        if(f(i,j) > thH)
            B(i,j) = 1;
        else
            B(i,j) = 0;
        end
    end
end

filteredImage = B;

任何人都可以通过查找此代码的问题来帮助我吗?首先,我不确定我是否为Gabor滤波器组提供了正确的参数,用于本文中提到的4个均匀方向。之后,通过f的最大值进行归一化,因为否则我在血管增强后已经获得了完全白色的区域。你认为这个代码的问题在哪里?据我所知,这篇论文完全按照那里提到的那样完成。

1 个答案:

答案 0 :(得分:0)

我在这里有一个建议,你可以使用非常擅长这项工作的firangi过滤器 这里是获取代码的链接

http://www.mathworks.com/matlabcentral/fileexchange/24409-hessian-based-frangi-vesselness-filter/content/FrangiFilter2D.m

我在其他图片上尝试过这里是结果 enter image description here

在此之后你必须进行形态学操作以移除外部区域。为此,我会在regionprops中建议matlab

希望这可以帮助你!!