Color image segmentation using K-Means

1 Ansicht (letzte 30 Tage)
Sabarinathan Vadivelu
Sabarinathan Vadivelu am 25 Aug. 2012
The Example for Color image segmentation which I was found here Here. In this example they have segmented the blue color. Is there any example to segment only the red color or green color?
  1 Kommentar
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran am 25 Aug. 2012
RGB color are referred as 1,2,3. where 3 stands for blue color. So, in the same code modify the value of 3 as 2 to get green color and change the value as 1 to get red color.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 25 Aug. 2012
I think you don't understand how k-means works. You specify k. In the example they specified 3 because they thought there should be, or wanted to be, 3 classes. Those three classes were magenta, blue, and white for that particular image. For your image they might be something different, say yellow, green, and cyan - it all depends on the content of the image. If your image has only two main colors, red and green, then maybe you should specify a k of 2 and it will find those two colors. Feel free to upload your image to the website of your choice if you want us to look at it.
  2 Kommentare
Laila Hayat
Laila Hayat am 27 Nov. 2012
i have the same problem image is onion.png n i have to segment out 5 colors bt i didnt understand how to work on this
Image Analyst
Image Analyst am 27 Nov. 2012
Can't you follow the example? Just change 3 to 5 and let it run. I can't try it because I don't have the Statistical Toolbox.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by