How to count exudates in retina binary image?

I 've got the following retina images, after implementing LAB and applying segmentation, I've got a binary image. The white is the exudates and I need to count each of them. Can you help me with code to count them accurately without including the borders and extra pixels.

3 Comments

What is an exudate in the image? Is each pixel considered an exudate? What do you consider as a 'border or extra pixel'? More detail might help you get a useful answer.
image-segmentation-tutorial-blobsdemo and regionprops might be good place to start.
[X Y]=ginput(1);
x=round(X);
y=round(Y);
template=double(imageIN(y ,x,:));
filterimage = ColourFilter3(imageIN,template);
subplot(2,2,1),imshow(filterimage), title 'Lab colour filtered image';
a=im2bw(filterimage,230./255);
figure,imshow(a),'title binary image';
Colourfilter3 is my code to that converts image to lab colour space, and then if you click with mouse, the template is the reference of that colour you clicked on. Exudates are the yellow spots on the retina... From the binary image attached here, how must I count them?
See the link above to get the image that is the output of this code.
Colourfilter3 function is called here above. I have its code here, but it is not necessary for the question.

Sign in to comment.

Answers (1)

I think you need to call imfill() to make them solid - it looks like all you have are the edge outlines. Then call regionprops(). See my image segmentation tutorial in my File Exchange if you want an example.

3 Comments

Please help, I am struggling to get this right:
I have obtained a thresholded image, which is in binary image format. My problem is from this image I want to locate the round optic disk by means of the kasa method. Optic disk is the biggest and the lightest circle in the retina image. I want to illuminate this, because this is normal for every eye. I know about bw label and region props. But Please in exact coding, how must I get the the xy datapoints to give to the function of KASA to draw circle. The circle must be drawn around where the most ones (maximumx) in the binary image are present. I want a circle be drawn effectively around the optic disk for every retina image.
Here is my MATLAB code and a image.
figure,imshow(a),'title binary image';
[L,num]=bwlabel(a);
[y x] = find(a);
XY=[y x] ;
figure,imshow(a),'title binary image';
hold on
Par = CircleFitByKasa(XY)
r=Par(3);
x=Par(2);
y=Par(1);
th = 0:pi/50:2*pi;
xunit = r * cos(th) + x;
yunit = r * sin(th) + y;
h = plot(xunit, yunit);
hold off
% [L,num]=bwlabel(a);
% blobMeasurements = regionprops(L, 'all')
% [r, c,v] = find(L);
% rbar=mean(r);
% cbar=mean(c);
% datapoints=[r,c,v];
% s = regionprops(L,'area');
% CC = bwconncomp(a)
See kasa circle fitting on matlab central for the function's coding Here is an example: http://imgur.com/PIgeATD LAB colourspace image
After filter and threshold image will look like this http://imgur.com/ziU7IxL
I never heard of kasa, and the link just shows an image and a histogram. regionprops() will give you the EquivDiameter and the Centroid which is all you need if you want to get the circle fit. Then just use rectangle() or plot() to put up the circle in the overlay over your image.

Sign in to comment.

Tags

No tags entered yet.

Asked:

on 7 Aug 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!