Advice on Colour Segmentation Approach

1 view (last 30 days)
Keyes34
Keyes34 on 12 Jan 2015
Commented: Keyes34 on 13 Jan 2015
I am developing a program to identify blue regions (in granulomas) in stained lungs for MPO, iNOS and CD3 staining for multiple images (~150). So looking at MatLab-suggested techniques, I found the part where they recommended 2 colour segmentation techniques:
K-Means
and Colourspace
So I'm asking: why use one technique over the other? Does it really matter if I use K-means over defined thresholds? Which method will be better for me? My images look like these:
Thank you for your feedback!

Answers (1)

Image Analyst
Image Analyst on 12 Jan 2015
The first one assumes there will be three colors and tries to find them automatically. With the second one, you define 6 reference colors and it figures out which of the 6 colors each pixel is closest to.
  3 Comments
Image Analyst
Image Analyst on 12 Jan 2015
Edited: Image Analyst on 12 Jan 2015
First of all you need to get control over your images if you want to make it easy. If your images are varying all over the place (for a spot that should be a constant color) then it will be more difficult or impossible. So assuming that you have a standard, such as an IT8 target then you should use something like the second method. You just define certain colors that mean certain classes, like blue=nucleus, brown=disease, or whatever. Then you calculate the delta E between your pixels and the known, centroid color of each class. Whichever delta E is lower means your pixel belongs to that class.
I've attached two delta E demos, but they do something slightly different than what I described. Nonetheless they might be useful to you.
The problem with using a kmeans approach is that it will always find 3 (or however many you specified) clusters regardless if that's how many of the classes that mean something to you are there. For example, let's say you have classes of cell, nucleus, and disease. Well if you have an image and all three of those are in about the same proportion, then fine. But what if you have an image where there is no disease? Well it will pick something based on what is there, if you let it decide itself on an individual image basis. So it might pick some healthy cell area and call it disease just because you forced it to find 3 clusters. Obviously not what you want.
Keyes34
Keyes34 on 13 Jan 2015
All right; thank you for your advice. I'll reevaluate my code and see if I can incorporate your suggestions into mine.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!