Page 1 of 1

Compute the Color of the Foto

Posted: 2011-07-25T10:42:03-07:00
by binfch
Hi there

I have 10 different preset RGB colors (example red, blue, green, etc...).

Now I need to read foto files (.jpg, .gif, .png) and decide to what preset color the images best fits to. Example -> Let's supose on the foto there is a white cloud in the center surrounded by blue sky -> The result should then be the color "white". Or a black dog on a green lawn -> The result should be the color "black".

P.S: Google image search has such a functionality.

I was wondering how such a functionality could be implemented resp. what would be the most "performant" solution. An idea that comes to my mind is to simple resize the images to 3x3 pixel, then read the center pixel and decide what color is closest to it !?

Thx & cheers,
Peter

Re: Compute the Color of the Foto

Posted: 2011-07-25T21:07:00-07:00
by anthony
This is basically working out rough category or metrics for a photo.
I have note on this in IM Examples, Image Comparing
Image Types (BW, line, grayscale)
http://www.imagemagick.org/Usage/compare/#type_general
But I think it is more like image metrics
http://www.imagemagick.org/Usage/compare/#metrics
Which includes discussions of predominate color, central color, and 3x3 color matrix determination.

I would be interested in your views on this and how they fit in what you are after.


However Google is probably doing something I don't currently discuss. Its a metric that looked for rough ellipses of color in an image which is then used as the metric. Unfortunately the paper's original source is no longer online but a reference is
http://citeseerx.ist.psu.edu/viewdoc/su ... .1.80.3503
(there is a cache copy of the PDF there, but it is more of a starting point for the algorithms involved)

I have not looked into this method myself (which is why I don't discuss it), but will like to at some point.