[英]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.