How does Google's image color search work?

后端 未结 4 1291
囚心锁ツ
囚心锁ツ 2020-12-08 05:30

Let\'s say I query for

http://images.google.com.sg/images?q=sky&imgcolor=black

and I get all the black color sky, how actua

4条回答
  •  清歌不尽
    2020-12-08 05:59

    There are various ways of extracting color from an image, and I think other answers addressed them (K-Means, distributions, etc).

    Assuming you have extracted the colors, there are a few ways to search by color. One slow, but obvious approach would be to calculate the distance between the search color and the dominant colors of the image using some metric (e.g. Color Difference), and then weight the results based on "closeness."

    Another, much faster, approach would be to essentially downscale the resolution of your color space. Rather than deal with all possible RGB color values, limit the extraction to a smaller range like Google does (just Blue, Green, Black, Yellow, etc). Then the user can search with a limited set of color swatches and calculating color distance becomes trivial.

提交回复
热议问题