Delete the image of the optical disc of the retina by setting the color of the optical disc as the background

I work with the image of the retina, I am currently sending a wavelet, but I noticed that I have two problems:

  • Optical disk that makes me image noise
  • And the circle bounding the retina

The original image is as follows

source image

My plan is to set the lower part of the tone of the optical disk so as not to lose the details of the blood vessels of the retina (I place the code with which I played, but still do not understand, because I know the tone of the optical disk and how to set it on the image without changes in blood vessels)

And in relation to the outer circle of the retina, I donโ€™t know what you recommend to me (I donโ€™t know about masks, I would be grateful if they had to consult my literature)

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); 

kindly asked question How do I change the background color of an image?

I get the following

enter image description here

I need an image like this when the optical disc does not cause me noise when segmenting the retinal blood vessels.

enter image description here

I want to be a uniform background ... and only veins are perceived

I continued to work and got the following image. As you can understand, the optical disk removes some parts of the blood vessels (veins) that are above it, so I require the removal or uniform full bottom of the image.

Image enhancement

+5
source share
2 answers

As Wouter said , you must first correct the heterogeneity of the image. I would do it my own way:

Firstly, the parameters that you can configure to optimize the output:

 gfilt = 3; thresh = 0.4; erode = 3; brighten = 20; 

You will see how they are used in the code.

This is the main step: apply a Gaussian filter to the image to make it smooth, and then subtract the result from the original image. Thus, you get dramatic changes in your data, which, apparently, are vessels:

 A = imread('Prueba.jpg'); B = imgaussfilt(A, gfilt) - A; % Gaussian filter and subtraction % figure; imshow(B) 

enter image description here

Then I create a binary mask to remove the unwanted area of โ€‹โ€‹the image:

 % 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) 

enter image description here

And finally, I delete everything in the surrounding dark area and show the result:

 B(~circ3) = 0; % ignore the surrounding area figure; imshow(B * brighten) % brighten and show the output 

enter image description here

Notes:

  • I do not see the last image as the final result, but you can probably apply some thresholds to it and separate the vessels from the rest.
  • The quality of the provided image is rather poor. I expect good results with better data.
  • Although the intensity of the blue channel is less than the rest, the vessels are expressed there better than the other channels, because the blood is red!
  • If you acquire this data or you have access to a person, I suggest that you use blue light for lighting, as it provides a higher contrast of blood vessels.
+3
source

Morphological operations are good for working with images of sphaghetti.

Original Image:

Source image

Convert to Grayscale:

 original = rgb2gray(gavrF); 

Rate background using morphological closure:

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

Background Rating:

background score

Then you could, for example, subtract this background from the original grayscale image. You can do this directly by converting the bottom hat to a grayscale image:

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

With an exit:

enter image description here

Noise, but now you have access to global threshold methods. Remember to change the data types twice if you want to do a few subtractions or split manually.

+1
source

All Articles