By Abdul Rehman
fundus images are retina images of human eyes focusing eye retina and widely used in ophthalmology to recognize and track eye diseases. We require fundus images because it demonstrate the detail pictures of blood vessels in the retina which is helpful to identify diseases like diabetic retinopathy, glaucoma, cataract, etc.
This article will concentrate on utilizing the image processing toolbox in MATLAB to find and follow blood veins in fundus pictures. To extract the blood vessels from the fundus image, the article might cover subjects like color space conversion, filtering, thresholding, and morphological operations. The article also shows how to gauge the blood vessels’ length and diameter and examine their characteristics.
There are many other methods available to detect the blood vessels from Fundus images and this method is just for beginner to demonstrate the usage of MATLAB image processing toolbox and specifically application of MATLAB based color detection algorithm.
Here is the code for above mentioned Method
% Load fundus image
fundus = imread('fundus_image.jpg');
% Convert to grayscale and enhance contrast
gray = rgb2gray(fundus);
gray = adapthisteq(gray);
% Convert to LAB color space
lab = rgb2lab(fundus);
% Extract the 'a' channel from the LAB color space
channel_a = lab(:,:,2);
% Threshold the 'a' channel to isolate the red blood vessels
vessels_bw = channel_a > 20;
% Apply morphological operations to enhance the blood vessel segmentation
se = strel('disk', 5);
vessels_bw = imopen(vessels_bw, se);
vessels_bw = imclose(vessels_bw, se);
% Label and measure the blood vessels
vessels_labeled = bwlabel(vessels_bw);
stats = regionprops(vessels_labeled, 'Area', 'BoundingBox', 'MajorAxisLength', 'MinorAxisLength');
% Display the blood vessel segmentation and the measurements
imshow(fundus);
hold on;
for i = 1:numel(stats)
bb = stats(i).BoundingBox;
rectangle('Position', bb, 'EdgeColor', 'r', 'LineWidth', 2);
text(bb(1), bb(2) - 10, sprintf('Major axis: %.2f\nMinor axis: %.2f\nArea: %.2f', ...
stats(i).MajorAxisLength, stats(i).MinorAxisLength, stats(i).Area), ...
'Color', 'r', 'FontSize', 10);
end
Code language: JavaScript (javascript)
19 April 2023
07 April 2023
07 April 2023
FYP Solutions Powered By Impressive Business WordPress Theme