Computes color histogram of an RGB image, number of bins(for each color component) is user input and is same for R,G and B. The output histogram can be un-normalized, l1-normalized or l2-normalized. The functin can compute color histogram for an image for a patch also.
Histogram of an RGB image
why it is nbins^3 long ?
@vijaya: If i understood your issue correctly, you are trying to cluster the rgb histograms. Which can be done using different clustering approaches. You can look from the simple K-means clustering. Many of clustering approaches are there in the literature like meanshift based, spectral etc. Most of them are implemented in MATLAB and you can get the codes in file-exchange.
can u tell me how to cluster the features which i have extracted using ur rgbhist_fast program. i need to extract the rgb features for videos and need to cluster them. please help me with the code.
It seems, you have executed the function directly (without the input parameters 'I' ans 'nBins'). Can you please read an rgb image into a variable 'I' using 'imread' and pass it as the input argument. For example, H=rgbhist_fast(I,4); will give the histogram into a variable 'H'.
dear, when i tried this code it gives me error
??? Input argument "I" is undefined.
Error in ==> rgbhist_fast at 16
if (size(I, 3) ~= 3)
could you explain me why it happens
Good implementation- short and efficient. A little bit straight forward- implemented pixel-wise. Will be best for small images.
sir can u tell me how to get the 32 dimensional RGB color histograms of an image in the range of [0,1] using matlab.help me with the code sir. please.
A new function 'rgbhist_fast.m' is added to the existing 'rgbhist.m' function. The new function is nearly four times faster.
Added the normalization option. The function can output un-normalized or l1-normalized or l2-normalized histogram.