Hi Sara Kadam,
To specifically enhance exudates while muting the appearance of nerves in retinal images, you need to focus on the characteristics that differentiate exudates from nerves. Exudates are typically brighter and more localized compared to the more diffused and fibrous appearance of nerves. Here are some strategies you can apply to enhance exudates:
- Morphological Processing: After getting the initial exudates mask, you can use morphological operations to remove elements that are likely to be nerves based on their shape or size.
% Remove small connected components that might not be exudates
exudatesMaskCleaned = bwareaopen(exudatesMask, 50); % Adjust the size threshold as needed
% Optionally, use morphological closing to fill gaps in the exudates
se = strel('disk', 1); % Adjust the structural element size as needed
- Contrast Limited Adaptive Histogram Equalization (CLAHE): Before using matched filtering, you can use “CLAHE” to enhance the contrast of the image, which might help in distinguishing exudates from nerves due to their different intensity distributions.
grayImageEnhanced = adapthisteq(grayImage, 'ClipLimit', 0.02); % Adjust ClipLimit as needed
Then, proceed with your filtering and thresholding on “grayImageEnhanced”.
- Multi-scale Filtering: Instead of using a single scale (sigma value) for the LoG filter, you can apply multi-scale filtering to target the specific size of exudates. This involves applying the LoG filter at multiple scales and combining the results to enhance regions that match the expected size of exudates more closely.
sigmas = [1, 2, 3]; % Example scales
filteredImageMultiScale = zeros(size(grayImage));
for i = 1:length(sigmas)
h = fspecial('log', [15 15], sigmas(i));
filteredImage = imfilter(double(grayImageEnhanced), h, 'symmetric');
filteredImageMultiScale = max(filteredImageMultiScale, filteredImage);
end
Then, continue with the mean subtraction, thresholding, and overlaying as before, using
“filteredImageMultiScale”.
- Edge Detection to Exclude Nerves: Since nerves often have linear structures, you can use edge detection to identify and potentially exclude these areas.
edges = edge(grayImage, 'Canny'); % Experiment with different edge detectors and parameters
exudatesMaskFinal = exudatesMaskClosed & ~edges; % Remove edges from the exudates mask
You can refer to the following documentation to know more about the functions used:
- bwareaopen: https://www.mathworks.com/help/images/ref/bwareaopen.html
- imclose: https://www.mathworks.com/help/images/ref/imclose.html
- adapthisteq: https://www.mathworks.com/help/images/ref/adapthisteq.html
- fspecial: https://www.mathworks.com/help/images/ref/fspecial.html
- imfilter: https://www.mathworks.com/help/images/ref/imfilter.html
- edge: https://www.mathworks.com/help/images/ref/edge.html
- strel: https://www.mathworks.com/help/images/ref/strel.html
Best Regards,
Abhishek Chakram