Code covered by the BSD License  

Highlights from
Color Histogram of an RGB Image

5.0

5.0 | 2 ratings Rate this file 156 Downloads (last 30 days) File Size: 2.17 KB File ID: #43630

Color Histogram of an RGB Image

by

 

25 Sep 2013 (Updated )

computes color histogram of an RGB image, number of bins is user input and is same for R,G and B.

| Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
21 Jan 2014 Konda Reddy Mopuri

@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.

17 Jan 2014 Vijaya

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.

28 Nov 2013 Konda Reddy Mopuri

@Ibrahim
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'.

27 Nov 2013 Ibrahim Thorig

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

27 Nov 2013 Tai Tran  
18 Nov 2013 Nikolay S.

Good implementation- short and efficient. A little bit straight forward- implemented pixel-wise. Will be best for small images.

13 Nov 2013 Vijaya

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.

Updates
10 Oct 2013

Added the normalization option. The function can output un-normalized or l1-normalized or l2-normalized histogram.

20 Nov 2013

A new function 'rgbhist_fast.m' is added to the existing 'rgbhist.m' function. The new function is nearly four times faster.

Contact us