Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

color histogram for images

In color histogram, we usually extracts histograms in each color channel, this does not contains the information of how the colors are co-occurred, for example how many pixels have the intensity I(100,200,50)?

Are there any way to build a histogram that represents the co-occurance of colors? (how many pixels contains the intensity value (200,100,50)?)

I am looking for some improved version of this type of histograms for eg. like this paper

like image 355
user570593 Avatar asked Dec 21 '22 17:12

user570593


2 Answers

You can either build a really big histogram with 256^3 values, or you can quantize the values in each channel (e.g. 10 values per channel) which would lead to a histogram with 1000 entries.

like image 107
bjoernz Avatar answered Dec 29 '22 14:12

bjoernz


Since you want to use it as an image-level descriptor for further recognition, simple binning might not be the best option because colours are not distributed uniformly in your sample.

The typical approach is bag of words. You take all the pixel values from your whole set of images (points in 3D space) and quantize them using some clustering algorithm (like k-means or EM algorithm). Suppose you used K clusters (may depend on your purposes and sample size, you can start with K = 100). To describe an individual image, you find the closest cluster for each pixel (so-called visual word), and build the histogram with K bins, so that each bin value is the number of pixels corresponding to the visual word. This is your descriptor, and you can compare images using Euclidean distance or χ² distance over descriptors.

Note that there are a lot of implementations of clustering algorithms (and even bag-of-words frameworks) available, depending on your platform. OpenCV is among the most popular ones. Note that you can also use gradient-based descriptors like HOG, depending on your problem.

like image 40
Roman Shapovalov Avatar answered Dec 29 '22 12:12

Roman Shapovalov