clc;
clear;
close all;
warning off;
addpath(genpath(pwd));
%****************************************************************************
%更多关于matlab和fpga的搜索“fpga和matlab”的CSDN博客:
%matlab/FPGA项目开发合作
%https://blog.csdn.net/ccsss22?type=blog
%****************************************************************************
%=======================================================================
%===============Extracting green channel from input image===============
%=======================================================================
image = imread('02_test.tif');
[r, g, b] = imsplit(image);
bw = adapthisteq(g);
%=======================================================================
%=======================================================================
%===========Opening by reconstruction (Erosion and Dilation)============
%=======================================================================
SE = strel('disk',5);
%SE = strel('square',5);
marker = imerode(bw,SE);
mask = bw;
mid = imreconstruct(marker,mask);
%======================================================================
%=======================================================================
%=========================Top hat transform=============================
%=======================================================================
mid = imbothat(mid, SE);
%mid = 255 - mid;
mid = adapthisteq(mid);
%=======================================================================
%=======================================================================
%=========================Matched Filtering=============================
%=======================================================================
img = im2double(mid);
s = 1.5; %sigma
L = 7;
theta = 0:15:360; %different rotations
out = zeros(size(img));
m = max(ceil(3*s),(L-1)/2);
[x,y] = meshgrid(-m:m,-m:m); % non-rotated coordinate system, contains (0,0)
for t = theta
t = t / 180 * pi; % angle in radian
u = cos(t)*x - sin(t)*y; % rotated coordinate system
v = sin(t)*x + cos(t)*y; % rotated coordinate system
N = (abs(u) <= 3*s) & (abs(v) <= L/2); % domain
k = exp(-u.^2/(2*s.^2)); % kernel
k = k - mean(k(N));
k(~N) = 0; % set kernel outside of domain to 0
res = conv2(img,k,'same');
out = max(out,res);
end
out = out/max(out(:));
%=======================================================================
%======================Local Entropy Thresholding=======================
%=======================================================================
out2 = uint8(255*out);
%[threshold, final] = maxentropie(out2);
for i = 1:size(out,1)
for j = 1:size(out,2)
if out(i,j) < (78/2*255)
out(i,j)=1;
else
out(i,j)=0;
end
end
end
out = uint8(255*out);
output = out;
%=======================================================================
%==============================Filtering================================
%=======================================================================
finalOutput = filterImage(out);
stel = strel('disk',1);
finalOutput = imerode(finalOutput,stel);
figure, montage({img,finalOutput});
没有合适的资源?快使用搜索试试~ 我知道了~
matlab-视网膜眼底静脉血管检测算法matlab仿真-源码
共6个文件
m:3个
tif:2个
jpg:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 165 浏览量
2021-09-20
00:33:18
上传
评论
收藏 1.17MB RAR 举报
温馨提示
matlab_视网膜眼底静脉血管检测算法matlab仿真_源码
资源推荐
资源详情
资源评论
收起资源包目录
matlab_视网膜眼底静脉血管检测算法matlab仿真_源码.rar (6个子文件)
matlab_视网膜眼底静脉血管检测算法matlab仿真_源码
02_test.tif 473KB
retinal.jpg 31KB
Runme.m 3KB
func
maxentropie.m 1KB
filterImage.m 389B
01_test.tif 713KB
共 6 条
- 1
资源评论
mYlEaVeiSmVp
- 粉丝: 1961
- 资源: 19万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功