Azzera filtri
Azzera filtri

This is my output image imshow(imIDX,[]); .How can i read this image into variable and how can i make it a binary image?

2 visualizzazioni (ultimi 30 giorni)
figure
imshow(imIDX,[]),title('Image after applying k-means Clustering Algorithm');
How can i read the image into a single variable ? how can i make it a binary image?
  2 Commenti
Stephen23
Stephen23 il 26 Feb 2017
Modificato: Stephen23 il 26 Feb 2017
imIDX is already a variable which you already have and use. imIDX is a single variable which contains the image data. Why not use imIDX?
sam  CP
sam CP il 26 Feb 2017
Okay..Then can i display the image by using imshow(imIDX); instead of imshow(imIDX,[]);

Accedi per commentare.

Risposta accettata

Image Analyst
Image Analyst il 26 Feb 2017
imIDX is already a variable. To create a binary (logical) image from it, or a processed/filtered version of it, you can threshold to get values above or below some special value
binaryImage = imIDX < someThreshold;
  5 Commenti
sam  CP
sam CP il 26 Feb 2017
Modificato: sam CP il 26 Feb 2017
Actually this tumor detection is a two step procedure..first i will get a ouput image with tumor after kmeans..Sometimes it will detect the tumor with sorrounding healthy tissue..Then HCSD method is used to remove such healthy tissue and seperate thee tumor section alone..
I got this idea from a IEEE paper. The tumor section is segmented in this ..check this code
Image Analyst
Image Analyst il 26 Feb 2017
If you use kmeans, you're finding different gray level ranges all the time. So if you stripped off the skull and ignored the pure black mask, then you have normal gray and black in the brain, and possibly a tumor, but possibly not. So if you used a k of 3 and there was a big tumor, it could find it. However if there was no tumor, it will still find 3 classes. But unlike before, one of those classes will NOT be a tumor - it will be normal tissue. So now you're going to have to examine that class and see if that class is a real tumor or just normal tissue. For example, you could look at the absolute gray level and see if it's white or gray. Well, if you're going to do that, then why not just do that from the start and not do kmeans()? That said, I haven't read the paper and perhaps kmeans plays some role in the complete tumor segmentation process, I just don't know what it could be and still be robust enough to handle all cases from 0% tumor to 100% tumor.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Agriculture in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by