Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Please Help want to remove objects. URGENT!
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
</matlabcentral/answers/uploaded_files/8062/Screenshot%202014-03-15%2019.27.36.png> my output binary image.
Hello, Actually I am doing a project on automatic detection of diabetic retinopathy using rgb digital fundus images. I have a asked a doubt before also. Alhamdulillah I am at the ending part of my project. According to the paper I have to remove the unwanted vessels from a binary fundus image of eye. The vessels are bigger in size than the microaneurysms which are round and small which is to be detected. So I want to remove these long vessels. According to the paper I have to set a threshold value by experimentation and remove the objects below and above the threshold value area. Now please help me how to remove these objects based upon area .
My Current Code is: { clc;
clear all;
close all;
%seperating the RED GREEN BLUE components of a rgb image
X=imread('C:\MJCET\91280612.jpg');
imshow(X)
R = X(:,:,1);
image®, colormap([[0:1/255:1]', zeros(256,1), zeros(256,1)]), colorbar;title('Red Component');
set(gcf, 'Position', get(0, 'ScreenSize'));
%Green Component
G = X(:,:,2);
figure;
image(G), colormap([zeros(256,1),[0:1/255:1]', zeros(256,1)]), colorbar;title('Green Component');
set(gcf, 'Position', get(0, 'ScreenSize'));
%Blue component
B = X(:,:,3);
figure;
image(B), colormap([zeros(256,1), zeros(256,1), [0:1/255:1]']), colorbar;title('Blue Component');
set(gcf, 'Position', get(0, 'ScreenSize'));
Z=im2double(G);
%converting GREEN SCALE image to GRAY SCALE image
gray = 0.5870 * X(:,:,2);
figure,imshow(gray);title('Gray Image');
set(gcf, 'Position', get(0, 'ScreenSize'));
Y=im2double(gray);
%Median Filtering
A=im2double(Y);
U=medfilt2(A, [30 30]);
figure,imshow(U);title('Filtered Image');
set(gcf, 'Position', get(0, 'ScreenSize'));
L=im2double(U);
%Normalisation
zz = imsubtract(L,Z);
figure,imshow(zz),title('Normalised Image');
set(gcf, 'Position', get(0, 'ScreenSize'));
%Histogram Equalisation
%% HISTOGRAM EQULAIZER %%
figure,subplot(1,2,1),imshow(zz), title('Original Image')
set(gcf, 'Position', get(0, 'ScreenSize'));
subplot(1,2,2),imhist(zz),title('Original Image Histogram')
set(gcf, 'Position', get(0, 'ScreenSize'));
%% Calculating the CDF
hst=imhist(zz);
j=1;
cdff(1,1)=hst(1,1);
for i=2:256
cdff(i)=hst(i)+cdff(i-j);
end
cdff1=cdff';
cdf_min=min(cdff);
[row col]=size(zz);
mn=row*col;
figure, plot(cdff), title('CDF of Image')
set(gcf, 'Position', get(0, 'ScreenSize'));
%% calcuting new intensity
for indx=1:length(cdff)
h(indx)=round((cdff(indx)-cdf_min)/(mn-cdf_min)*255);
end
h1=h';
figure,plot(h1), title('New value for General Histogram')
set(gcf, 'Position', get(0, 'ScreenSize'));
%% EQULIZED IMAGE
HIm=double(zeros(size(zz,1),size(zz,2)));
for i=1:row;
for j=1:col;
HIm(i,j) = h((round(zz(i,j)+1.623)));
end
end
figure,subplot(1,2,1),imshow(HIm), title('Equlized Image')
subplot(1,2,2),imhist(HIm) ,title('Equlized Image Histogram')
set(gcf, 'Position', get(0, 'ScreenSize'));
% Multilevel Thresholding
K=im2double(HIm);
% Compute the thresholds
threshRGB = multithresh(K,1);
figure,imshow(threshRGB);
set(gcf, 'Position', get(0, 'ScreenSize'));
% Apply the thresholds to obtain segmented image
seg_I = imquantize(K,threshRGB);
figure,imshow(seg_I);
set(gcf, 'Position', get(0, 'ScreenSize'));
value = [0 threshRGB(2:end) 255];
% Quantize entire image using one threshold vector
quantRGB = imquantize(K, threshRGB, value);
% Quantize each RGB plane using threshold vector generated for that plane
imshow(quantRGB);
set(gcf,'Color',[1.0 1.0 1.0]); % set background color of figure
title('Thresholded Image');
set(gcf, 'Position', get(0, 'ScreenSize'));
%Removal Of Vessels
F=im2double(quantRGB);
binaryimage= F >= 30 & F <= 170;
figure,imshow(binaryimage);
set(gcf, 'Position', get(0, 'ScreenSize'));
}
NOW PLEASE HELP ME HOW TO REMOVE OBJECTS OR VESSELS FROM AN IMAGE BASED UPON AREA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1 commentaire
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!