% Load the retinal image
originalImage = imread('image005.png');
% Convert the image to grayscale
grayImage = rgb2gray(originalImage);
% Perform matched filtering to enhance exudates
sigma = 2; % Adjust the LoG filter parameter based on image characteristics
h = fspecial('log', [15 15], sigma); % Laplacian of Gaussian filter
filteredImage = imfilter(double(grayImage), h, 'symmetric');
meanValue = mean(filteredImage(:));
matchedFilteredImage = abs(filteredImage - meanValue);
% Thresholding to obtain binary exudates mask
threshold = graythresh(matchedFilteredImage); % Compute threshold using Otsu's method
exudatesMask = imbinarize(matchedFilteredImage, threshold);
% Create an RGB image to overlay enhanced exudates in red
overlayedImage = cat(3, double(exudatesMask), zeros(size(exudatesMask)), zeros(size(exudatesMask))); % Red channel
% Overlay the red exudates on the original image
outputImage = im2uint8(grayImage) + uint8(255 * overlayedImage); % Overlay red on grayscale image
% Display the result
figure;
imshow(outputImage);
title('Enhanced Exudates in Red');
% Adjust figure properties if needed
set(gca, 'Visible', 'off'); % Hide axes
I am performing match filtering on retinal images to detect exudates, it is also enhancing the nerves in the image which I don't want, I only want the exudates to be detected. I have tried RGB channel split, Intensity Normalisation, Grayscaling, to mute the nerves. How do I mute the nerves and only enhance the exudates?