【图像增强】基于Frangi滤波器实现血管图像增强附matlab代码
【图像增强】基于Frangi滤波器实现血管图像增强附matlab代码
TT_Matlab
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。
1 简介
针对眼底视网膜图像对比度低,受病变区域边界干扰,很难正确提取血管细节的问题提出了一种基于Frangi滤波器的视网膜血管分割的方法,仿真结果表明上述方法对细小血管的提取表现出良好的效果,具备很强的实用价值.
2 部分代码
function I=imgaussian(I,sigma,siz)
% IMGAUSSIAN filters an
1
D,
2
D color/greyscale
or
3
D image with an
% Gaussian filter. This function uses
for
filtering IMFILTER
or
if
% compiled the fast mex code imgaussian.c . Instead of using a
% multidimensional gaussian kernel, it uses the fact that a Gaussian
% filter can be separated in
1
D gaussian kernels.
%
% J=IMGAUSSIAN(I,SIGMA,SIZE)
%
% inputs,
% I: The
1
D,
2
D greyscale/color,
or
3
D input image with
% data type Single
or
Double
% SIGMA: The sigma used
for
the Gaussian kernel
% SIZE: Kernel size (single value) (default: sigma*
6
)
%
% outputs,
% J: The gaussian filtered image
%
% note, compile the code with: mex imgaussian.c -v
%
% example,
% I = im2double(imread(
’peppers.png’
));
% figure, imshow(imgaussian(I,
10
));
%
% Function is written by D.Kroon University of Twente (September
2009
)
if
(~exist(
’siz’
,
’var’
)), siz=sigma*
6
; end
if
(sigma>
0
)
% Make
1
D Gaussian kernel
x
=-ceil(siz/
2
):ceil(siz/
2
);
H =
exp
(-(x.^
2
/(
2
*sigma^
2
)));
H = H/sum(H(:));
% Filter
each
dimension with the
1
D Gaussian kernels
if
(ndims(I)==
1
)
I=imfilter(I,H,
’same’
,
’replicate’
);
elseif(ndims(I)==
2
)
Hx=reshape(H,[
length
(H)
1
]);
Hy=reshape(H,[
1
length
(H)]);
I=imfilter(imfilter(I,Hx,
’same’
,
’replicate’
),Hy,
’same’
,
’replicate’
);
elseif(ndims(I)==
3
)
if
(size(I,
3
)<
4
) % Detect
if
3
D
or
color image
Hx=reshape(H,[
length
(H)
1
]);
Hy=reshape(H,[
1
length
(H)]);
for
k=
1
:size(I,
3
)
I(:,:,k)=imfilter(imfilter(I(:,:,k),Hx,
’same’
,
’replicate’
),Hy,
’same’
,
’replicate’
);
end
else
Hx=reshape(H,[
length
(H)
1
1
]);
Hy=reshape(H,[
1
length
(H)
1
]);
Hz=reshape(H,[
1
1
length
(H)]);
I=imfilter(imfilter(imfilter(I,Hx,
’same’
,
’replicate’
),Hy,
’same’
,
’replicate’
),Hz,
’same’
,
’replicate’
);
end
else
error(
’imgaussian:input’
,
’unsupported input dimension’
);
end
end
3 仿真结果
4 参考文献
[1]袁盼, 陈以. 基于多尺度Frangi滤波器的视网膜血管分割[J]. 现代信息科技, 2020.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
-
2023年血糖新标准公布,不是3.9-6.1,快来看看你的血糖正常吗? 2023-02-07
-
2023年各省最新电价一览!8省中午执行谷段电价! 2023-01-03
-
GB 55009-2021《燃气工程项目规范》(含条文说明),2022年1月1日起实施 2021-11-07
-
PPT导出高分辨率图片的四种方法 2022-09-22
-
2023年最新!国家电网27家省级电力公司负责人大盘点 2023-03-14
-
全国消防救援总队主官及简历(2023.2) 2023-02-10
-
盘点 l 中国石油大庆油田现任领导班子 2023-02-28
-
我们的前辈!历届全国工程勘察设计大师完整名单! 2022-11-18
-
关于某送变电公司“4·22”人身死亡事故的快报 2022-04-26
