Unsupervised evaluation of image segmentation

Good evening, do you can give me a program that the evaluation of unsupervised image segmentation (region)? THANK YOU GREETING

 Accepted Answer

Dear Sarah,
Your question is not completely clear to me, but if I guess correctly what you mean I suggest to search in the MATLAB help for Cluster Analysis and to take a look at the 'silhouette plot' function.
Success, Q

1 Comment

I tried with this program and this is what I have as a result:
Function definitions are not permitted in this context.
Imdep= imread('imdep.bmp');
i=im2double(Imdep);
figure(1),imshow(i);
Imseg= imread('imseg.bmp');
i2=im2double(Imseg);
figure(2),imshow(i2);
function valeur= Inter_LN(Imdep,Imseg)
% Calcul du contraste inter-région de Lévine et Nazif
% pour une image bmp 8bits en niveaux de gris stockée sous la forme d'une matrice
% Imseg : matrice correspondant à l'image segmentée avec des valeurs allant de 1 à n pour les n régions segmentées
% Imdep : matrice correspondant à l'image originale
%
%
% Utilitaires pour l'évaluation de la segmentation d'images
% Toolbox matlab (version 5.3)
%
% (c) Laboratoire de Vision et Robotique (UPRES EA 2078)
% ENSI de Bourges - Université d'Orléans
%
% Sébastien Chabrier : sebastien.chabrier@ensi-bourges.fr
%
% Si vous utilisez cette toolbox, veuillez citer ce papier svp.
%
%S. Chabrier, B. Emile, C. Rosenberger, H. Laurent,
%"Unsupervised performance evaluation of image segmentation",
%Special Issue on Performance Evaluation in Image Processing,
%EURASIP Journal on Applied Signal Processing, pages 1-12, 2006.
valeur=0;
NBCLASS=double(max(max(Imseg)));
moyenne=zeros(1,NBCLASS);
contraste=zeros(1,NBCLASS);
contraste_croise=zeros(NBCLASS);
perimetre=zeros(1,NBCLASS);
frontiere=zeros(NBCLASS);
aire=zeros(1,NBCLASS);
for k=1:NBCLASS
[region_k]=find(Imseg==k);
aire(k)=length(region_k); %nb de pixels de la région k
if (aire(k)>0)
moyenne(k)=sum(sum(Imdep(region_k)))/aire(k);
else
moyenne(k)=0;
end;
Imbin=zeros(size(Imseg));
Imbin(region_k)=ones(size(region_k));
contour_k=find((double(dilate(Imbin,ones(3)))-double(Imbin))==1);
for l=1:NBCLASS
if (contour_k)
M=find(Imseg(contour_k)==l);
if (M)
frontiere(k,l)=length(M);
else
frontiere(k,l)=0;
end;
else
frontiere(k,l)=0;
end;
end;
perimetre(k)=length(contour_k);
if (perimetre(k)==0)
frontiere(k,:)=0;
else
frontiere(k,:)=frontiere(k,:)/perimetre(k);
end;
end;
for k=1:NBCLASS
for l=1:NBCLASS
if (moyenne(k)+moyenne(l)==0)
contraste_croise(k,l)=0;
else
contraste_croise(k,l)=abs(moyenne(k)-moyenne(l))/(moyenne(k)+moyenne(l));
end;
end;
contraste(k)=frontiere(k,:)*contraste_croise(k,:)';
end;
%[contraste_croise]
%pause;
valeur=(aire*contraste')/sum(aire);
disp(valeur)

Sign in to comment.

More Answers (1)

Often this is done by constructing an ROC Curve. ROC means "Receiver Operating Characteristic" http://en.wikipedia.org/wiki/Receiver_operating_characteristic. Basically it's the plot of the true positive rate against the false positive rate. If you have various segmentation algorithms that you want to evaluate, you need to know the "ground truth" - in other words the "right" answer or what a perfect segmentation would give. This could simply be your expert opinion as to what's right. Then you see how many pixels the algorithms got right and how many they got wrong and plot them. This will let you evaluate/compare the different algorithms you used to do your segmentation. Do some internet research for more info on ROC curves. There are ROC files in the File Exchange http://www.mathworks.com/matlabcentral/fileexchange/?term=ROC

14 Comments

I tried with this program and this is what I have as a result:
Function definitions are not permitted in this context.
Imdep= imread('imdep.bmp');
i=im2double(Imdep);
figure(1),imshow(i);
Imseg= imread('imseg.bmp');
i2=im2double(Imseg);
figure(2),imshow(i2);
function valeur= Inter_LN(Imdep,Imseg)
% Calcul du contraste inter-région de Lévine et Nazif
% pour une image bmp 8bits en niveaux de gris stockée sous la forme d'une matrice
% Imseg : matrice correspondant à l'image segmentée avec des valeurs allant de 1 à n pour les n régions segmentées
% Imdep : matrice correspondant à l'image originale
%
%
% Utilitaires pour l'évaluation de la segmentation d'images
% Toolbox matlab (version 5.3)
%
% (c) Laboratoire de Vision et Robotique (UPRES EA 2078)
% ENSI de Bourges - Université d'Orléans
%
% Sébastien Chabrier : sebastien.chabrier@ensi-bourges.fr
%
% Si vous utilisez cette toolbox, veuillez citer ce papier svp.
%
%S. Chabrier, B. Emile, C. Rosenberger, H. Laurent,
%"Unsupervised performance evaluation of image segmentation",
%Special Issue on Performance Evaluation in Image Processing,
%EURASIP Journal on Applied Signal Processing, pages 1-12, 2006.
valeur=0;
NBCLASS=double(max(max(Imseg)));
moyenne=zeros(1,NBCLASS);
contraste=zeros(1,NBCLASS);
contraste_croise=zeros(NBCLASS);
perimetre=zeros(1,NBCLASS);
frontiere=zeros(NBCLASS);
aire=zeros(1,NBCLASS);
for k=1:NBCLASS
[region_k]=find(Imseg==k);
aire(k)=length(region_k); %nb de pixels de la région k
if (aire(k)>0)
moyenne(k)=sum(sum(Imdep(region_k)))/aire(k);
else
moyenne(k)=0;
end;
Imbin=zeros(size(Imseg));
Imbin(region_k)=ones(size(region_k));
contour_k=find((double(dilate(Imbin,ones(3)))-double(Imbin))==1);
for l=1:NBCLASS
if (contour_k)
M=find(Imseg(contour_k)==l);
if (M)
frontiere(k,l)=length(M);
else
frontiere(k,l)=0;
end;
else
frontiere(k,l)=0;
end;
end;
perimetre(k)=length(contour_k);
if (perimetre(k)==0)
frontiere(k,:)=0;
else
frontiere(k,:)=frontiere(k,:)/perimetre(k);
end;
end;
for k=1:NBCLASS
for l=1:NBCLASS
if (moyenne(k)+moyenne(l)==0)
contraste_croise(k,l)=0;
else
contraste_croise(k,l)=abs(moyenne(k)-moyenne(l))/(moyenne(k)+moyenne(l));
end;
end;
contraste(k)=frontiere(k,:)*contraste_croise(k,:)';
end;
%[contraste_croise]
%pause;
valeur=(aire*contraste')/sum(aire);
disp(valeur)
Everything from the line "function" onwards must be moved to a file named Inter_LN.m and then deleted from your original file. That will solve the problem about "function definitions not permitted in this context".
I didn't follow the code exactly (my French being somewhat weak) but it looks like it computes some kind of normalized count of the number of correct or incorrect pixel classifications. This could work for one image but to evaluate your algorithm over multiple images you should still do an ROC analysis.
Hello, is that you can give me the chart of this program and explain the program line by line.
thank you
Sorry, explaining a program line by line takes a lot of time anyhow, and as you are obviously a beginning MATLAB user, explaining the program line by line would involve having to write tutorials about how each of the MATLAB features work.
If you look at the comments, you will find a reference to a specific paper in Journal on Applied Signal Processing. Please read that paper; please also read through the MATLAB "Getting Started" documentation.
hello, for the graphical interface of this program you can help me.
All of those commands are well described in the documentation, except that the reason why one would want to use im2double() is usually not obvious to beginners. That one is a bit drawn out to describe the reasoning for.
Can you give me the GUI of this program
Based upon the information you have provided so far, your existing code
Imdep= imread('imdep.bmp');
i=im2double(Imdep);
figure(1),imshow(i);
Imseg= imread('imseg.bmp');
i2=im2double(Imseg);
figure(2),imshow(i2);
*is* the GUI for the program.
Perhaps it would help to be more descriptive of what you are looking for.
I did not understand how I made the GUI of this program in matlab
What does the GUI need to do?
For example:
"The GUI should have a single black button in the center on an all-black screen, and on the button there should be big black letters that say 'Please do not push this'. And if the button is ever pushed, the screen should light up black on black, with the message, 'I asked you not to push this!'"
you can explain the operation of the program in general roughly
the benefits of calculating inter-region contrast Levine and Nazif
In general terms, the program you gave the code for reads in two images and displays them on the screen, and then stops.
I not understand the Levine and Nazif reference. Are you now asking that someone give you an overview of how a different program works? If so then you would need to post the code or a link to it.
If you are hoping for an explanation of the theory behind a published paper, then that is something you should probably talk about with a professor, or at least raise the matter in a forum dedicated to image processing theory. This forum is dedicated to answering questions about MATLAB.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!