How do I get the percentage of individul color of a color image?

2 ビュー (過去 30 日間)
Aditya
Aditya 2011 年 2 月 4 日
I have a color image with red and blue color.
How can I find out the percentage of individual red and blue color.
  2 件のコメント
Doug Hull
Doug Hull 2011 年 2 月 4 日
Aditya, this is the third time you have asked this same question. Why do you keep asking when it has already been answered? Use comments to discuss. You can edit your old questions to update them.
Walter Roberson
Walter Roberson 2011 年 5 月 13 日
duplicates http://www.mathworks.com/matlabcentral/answers/773-how-can-i-get-the-percentage-of-each-individual-color-from-an-rgb-image

サインインしてコメントする。

回答 (1 件)

Brett Shoelson
Brett Shoelson 2011 年 2 月 4 日
Aditya, If your image is binary blue / red, this is easy. Otherwise, you need to define what is "red" (is it [1 0 0]?) and what is blue ([0 0 1]?). What if it's [0.95 0.05 0.05]? Is that red?
You might consider kmeans clustering. Check out clusterImg on the File Exchange; it can help you create separate color masks of your image. Then you can easliy count the number of pixels in the resulting binary masks.
Cheers,
Brett

カテゴリ

Help Center および File ExchangeModify Image Colors についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by