How to calculate the proportion value of some colors to the all color in an image

2 views (last 30 days)
Dear all,
Let say I have an image as attached. I need to calculate the ratio or proportion between pixel with blue color compare to all part of image (except the background) Could anyone help how to implement it in a matlab code?
Many thanks

Answers (2)

Steven Lord
Steven Lord on 10 Sep 2015
First, define "blue." This may seem like a simple question, but it may not be; see John D'Errico's "fuzzycolor" submission on the File Exchange.
For example, take a look at the 9 on the side of the car. I say that to me the top of the 9 is yellow, the middle is orange, and the bottom is red. So where does the yellow-ness end and the orange-ness begin? Where is the dividing line between orange and red?

Image Analyst
Image Analyst on 10 Sep 2015
You need to do color segmentation. I have several examples/tutorials of how to do that in my File Exchange. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

Community Treasure Hunt

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

Start Hunting!