Reputation: 3520
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
Upvotes: 4
Views: 1392
Reputation: 2805
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.
Upvotes: 3
Reputation: 3852
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.
Upvotes: 6
Reputation: 20915
I think that you just answered your own question.
Yes, it is possible to build such a histogram. It should be fairly simple in terms of implementation, since usually (r,g,b)
is represented by 32 bits where the first three are r
,g
and b
Upvotes: 2