2.85714

2.9 | 29 ratings Rate this file 258 downloads (last 30 days) File Size: 517 Bytes File ID: #4875

Color Image Histogram

by Jeff Mather

 

05 May 2004 (Updated 11 May 2004)

No BSD License  

Display a histogram showing the color balance of an image.

Download Now | Watch this File

File Information
Description

RGBHIST displays a histogram of the overall color balance of an image.

Use the 'RGB' mode to get a quick sense of which colors are present in particular highlight, shadow, and midtone regions. The 'LAB' mode is more useful for determining the actual color balance of an image, but it is slower.

This function supports UINT8, UINT16, INT8, INT16, and DOUBLE images without colormaps.

Required Products Image Processing Toolbox
MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (36)
07 Jul 2004 valla dafrel  
24 Jul 2004 feng Yang

asome

09 Dec 2004 reza saffari  
09 Dec 2004 reza saffari  
27 Dec 2004 visesh Jeetoo

It does seem to give the following error" In an assignment A(I) = B, the number of elements in B and I must be the same" when trying to find the histogram of a 256x256 colour image

07 Jun 2005 Lahmar karim

??? In an assignment A(I) = B, the number of elements in B and
 I must be the same.

17 Oct 2005 Arjan Gijsenij

Error: In an assignment A(I) = B, the number of elements in B and
I must be the same.

29 Nov 2005 hanif mohammadi  
11 Mar 2006 Lei sheng  
12 Mar 2006 Maria Gorlatova

Does not work. Error: In an assignment A(I) = B, the number of elements in B and
I must be the same.

Must be something version-dependent

24 May 2006 eman mehrabadi

log

21 Jun 2006 Jong-Cheon park  
12 Jul 2006 mohammed Alnafea  
20 Jul 2006 Mark Hayworth

This doesn't work in R14/2006a (and I doubt it did in his version either), or at least it needs fixing. It produces a stem plot, not a plot like his screenshot shows. And the stem plot is only for the B channel because he forgot to issue a HOLD command after the line h(1) = stem(1:256, rHist); so the green blows away the red plot, and the blue blows away the green plot so that only the blue stem plot is there after all is said and done. Finally, there is nothing in this macro about different color spaces, RGB or LAB, no radio buttons to select between them, in fact, no user interface at all.

14 Aug 2006 gabrielle tuijthof  
31 Aug 2006 muthu krishnan

good

18 Sep 2006 Kevin Ostheimer

??? Invalid handle object.

Error in ==> rgbhist at 19
set(h, 'marker', 'none')

19 Oct 2006 angry sam

doesn't work

08 Nov 2006 Syed Murtaza Hussain

Good one

09 Nov 2006 ayman nassar

it gives the following error
??? Invalid handle object.

Error in ==> rgbhist at 19
set(h, 'marker', 'none'

25 Nov 2006 dolly jain

??? Invalid handle object.

Error in ==> rgbhist at 19

29 Nov 2006 KAsper HAnsen

Doesn't work.

02 Feb 2007 Mourad Oussalah  
30 Mar 2007 Bruce Banner

Not working

31 Mar 2007 Divya Seelan  
24 May 2007 Joao Silva  
17 Nov 2007 kubilay i?ci

hello

20 Nov 2007 hanan yaseen

please sir can you explain the steps of the program to me? is it an intersection of the histograms of all the colors in the image or what exactly?
i hope you can respond me or any one who understand this program can explain it to me
i will be very thankful

19 Dec 2007 santosh saraf

Sir,

when u convert rgb2hsi we get an hsi component image. Sir, can i treat the h matrix as an image

Please reply

18 Feb 2008 keshamoni Divya  
02 Mar 2008 esraa ahmed  
21 Mar 2008 papu champu

good

22 Jun 2008 mustafa omar

no comment

06 Oct 2008 Sakthi Kandan

Hello
      In the above program how to get an image,is there any special syntax has to be used to get an image.
     I used the syntax
            I=imread('lena.jpg') ;
But it's giving me error.
  Is there any special syntax to get the RGB image.

04 Aug 2009 muhammad ashraf

Respected Sir,
             I am having error with your code.following is the error
??? Invalid handle object.

Error in ==> rgbhist at 19
set(h, 'marker', 'none')

Sir please tell how can i make histogram of color imag in matlab.
                    thanks

04 Aug 2009 muhammad ashraf

Respected Sir, ho to solve tis problem?
it gives the following error
??? Invalid handle object.

Error in ==> rgbhist at 19
set(h, 'marker', 'none'
 please help me how can i make color imag histogram?
                    thanks

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
color Jeff Mather 22 Oct 2008 07:19:04
rgbhist imhist color balance Jeff Mather 22 Oct 2008 07:19:04
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com