Effacer les filtres
Effacer les filtres

How can i get the difference in output between k-means and fuzzy c-means for dermoscopy images?

1 vue (au cours des 30 derniers jours)
I used built in k-means and fuzzy-cmeans function.Code structure are same.When i run the code for several images i got the same results for both the methods.I also got error for using reshape in the fuzzy c-means,that's why i commented it out.What is the dermoscopic criteria to get different output for these methods? or what should i change in the code ? **I used melanoma skin cancer images
<<
>>
if true
imdata=reshape(grayscaleImage,[],1);
imdata=double(imdata);
[imdx mn]=kmeans(imdata,2);
imIdx=reshape(imdx,size(replacedImage));
subplot(2,2,2);
imshow(imIdx,[]);
axis on;
title('K-means method...','FontSize', fontSize);
imdata1=reshape(GrayscaleImage,[],1);
imdata=double(imdata);
[imdx mn]=fcm(imdata,2);
%imIdx=reshape(imdx,size(replacedImage));
subplot(2,2,3);
imshow(imIdx,[]);
axis on;
title('fuzzy c-means method...','FontSize', fontSize);
end

Réponses (1)

Image Analyst
Image Analyst le 30 Juil 2017
First of all,
imdata=reshape(grayscaleImage,[],1);
imdata=double(imdata);
can be done with the (:) operation more simply as this:
imdata=double(grayscaleImage(:));
Next, the way you use kmeans and fcm are essentially the same - you're trying to come up with a threshold to split the image into foreground and background. That's essentially what imbinarize() does. If the image has two clear, well separated modes to the histogram, then all 3 methods may well decide upon the same threshold and give you the same foreground and background classes. If the thresholds are slightly different then they may give you very similar, but not exactly the same, images. So that's why both methods you tried are essentially no different than one another.
Next, there is no guarantee that automatic thresholding will be robust. For example, what if your image is of completely normal skin? You'd expect it to say there is no skin cancer. However your automatic thresholding methods will be forced to divide the image into two classes, and you're assuming one class is cancer. To avoid that you're going to have to say that if the means of the two classes are close, then essentially there is only one class, not two. Then you have to decide if that image is 100% normal or 100% cancer. If you require that your field of view has at least half the pixels be normal, then if there is just one class you can assume that it is normal, not cancerous.
  6 commentaires
Sadia Iffat
Sadia Iffat le 20 Août 2017
When i use k-means sometimes the background is black,foreground is white and vice-versa.Is their any way so that i always get one types of outcome such as ,always background as a black or white?
Image Analyst
Image Analyst le 20 Août 2017
The clusters will vary, that's the nature of kmeans. However you can determine which cluster is which after kmeans based on the properties such as intensity or whatever

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by