Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

how to create a histogram of R,G,B

Asked by preet

preet (view profile)

on 19 Jun 2013

i have three component R(0-255),G(0-255),B(0-255) i draw 3 different histograms of each component of 8 bins but i need one 2-D histogram of 8 bins.

1 Comment

Jan Simon

Jan Simon (view profile)

on 19 Jun 2013

What is your question? How do you want to transform the 3 components to a 2D space?

preet

preet (view profile)

Products

No products are associated with this question.

2 Answers

Answer by Youssef KHMOU

Youssef KHMOU (view profile)

on 19 Jun 2013

hi,

You mean putting them on one figure, with each component its corresponding color :

I=imread('autumn.tif');
R=imhist(I(:,:,1));
G=imhist(I(:,:,2));
B=imhist(I(:,:,3));
figure, plot(R,'r')
hold on, plot(G,'g')
plot(B,'b'), legend(' Red channel','Green channel','Blue channel');
hold off, 

0 Comments

Youssef  KHMOU

Youssef KHMOU (view profile)

Answer by Image Analyst

Image Analyst (view profile)

on 20 Jun 2013

What does this mean? Do you either want (1) histograms of each color channel (either on the same plot or on 3 separate plots), or (2) a scatterplot of the 3D color gamut? I have demos of each of those, just say what you want.

1 Comment

preet

preet (view profile)

on 24 Jun 2013

1 histogram of each color channel on same plot

Image Analyst

Image Analyst (view profile)

Contact us