簡體   English   中英

取下視網膜的光盤圖像,將光盤的顏色設置為背景顏色

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

在此輸入圖像描述

筆記:

  • 我沒有看到最后一張圖片作為最終結果,但可能你可以對它應用一些閾值並將其與其他圖像分開。
  • 您提供的圖像質量非常低。 我希望通過更好的數據獲得良好的結果。
  • 雖然藍色通道的強度小於其他通道,但血管在那里的表現要好於其他通道, 因為血液是紅色的!
  • 如果您正在獲取此數據或您可以訪問此人,我建議您使用藍光進行照明,因為它可以為您提供更高的血管對比度。

形態操作適用於使用sphagetti圖像。

原始圖片:

原始圖像

轉換為灰度:

original = rgb2gray(gavrF);

通過形態學關閉估算背景:

se = strel('disk', 3);
background = imclose(original, se);

估計背景:

估計背景

然后,您可以從原始灰度圖像中減去此背景。 您可以通過對灰度圖像執行底部變換來直接執行此操作:

flatImage = imbothat(original, strel('disk', 4));

輸出:

在此輸入圖像描述

吵,但現在你可以訪問全局閾值方法了。 如果您希望手動進行減法或除法,請記住將數據類型更改為double。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM