[英]Remove optical disk image of the retina, setting the color of the optical disk as background color
我一直在处理视网膜图像,目前我正在提交小波,但我注意到我有两个问题:
原始图像是下一个
我的计划是建立光盘底部的音调,以免丢失视网膜血管的任何细节(我发布了一个我玩的代码,但仍然不太了解,因为我知道的音调光盘以及如何在不改变血管的情况下将其设置为图像
而对于视网膜的外圈,我不知道你推荐我(我不知道面具,我会很感激,如果他们必须咨询我的文献可以提供)
c = [242 134 72];% Background to change
thresh = 50;
A = imread('E:\Prueba.jpg');
B = zeros(size(A));
Ar = A(:,:,1);
Ag = A(:,:,2);
Ab = A(:,:,3);
Br = B(:,:,1);
Bg = B(:,:,2);
Bb = B(:,:,3);
logmap = (Ar > (c(1) - thresh)).*(Ar < (c(1) + thresh)).*...
(Ag > (c(2) - thresh)).*(Ag < (c(2) + thresh)).*...
(Ab > (c(3) - thresh)).*(Ab < (c(3) + thresh));
Ar(logmap == 1) = Br(logmap == 1);
Ag(logmap == 1) = Bg(logmap == 1);
Ab(logmap == 1) = Bb(logmap == 1);
A = cat(3 ,Ar,Ag,Ab);
imshow(A);
礼貌的问题如何更改图像的背景颜色?
我得到的图像如下
我需要一张这样的照片,光盘在分割视网膜的血管时不会引起噪音。
我想成为统一的背景......只有静脉被感知到
我继续工作并获得了以下图像您可以意识到光盘会移除他上方的血管(静脉)的某些部分,因此我需要消除或使图像的整个底部均匀。
正如Wouter所说 ,你应该首先纠正图像的不均匀性。 我会以自己的方式做到这一点:
首先,您可以调整参数以优化输出:
gfilt = 3;
thresh = 0.4;
erode = 3;
brighten = 20;
您将看到它们在代码中的使用方式。
这是主要步骤:对图像应用高斯滤镜使其平滑,然后从原始图像中减去结果。 通过这种方式,您最终会得到数据的急剧变化,而这些变化恰好是船只:
A = imread('Prueba.jpg');
B = imgaussfilt(A, gfilt) - A; % Gaussian filter and subtraction
% figure; imshow(B)
然后我创建一个二进制掩码来删除图像中不需要的区域:
% the 'imadjust' makes sure that you get the same result even if you ...
% change the intensity of illumination. "thresh" is the threshold of ...
% conversion to black and white:
circ = im2bw(imadjust(A(:,:,1)), thresh);
% here I am shrinking the "circ" for "erode" pixels:
circ = imerode(circ, strel('disk', erode));
circ3 = repmat(circ, 1, 1, 3); % and here I extended it to 3D.
% figure; imshow(circ)
最后,我删除周围黑暗区域的所有内容并显示结果:
B(~circ3) = 0; % ignore the surrounding area
figure; imshow(B * brighten) % brighten and show the output
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.