Plot multiple histograms in one figure and re-plot the overlay histogram

I used the code provided by Image Analyst to plot multiple RGB histograms in one figure, the result is shown in the following figure.
I want plot a new histogram based on the overlaid histograms. I don't know how to put it in words about what I want to do but it is something like this...
I'm not sure how to do it. Can anyone help me please?

댓글 수: 3

Hi , can u send the code u made ? i think u want to do somethink like this :
figure(1);
im = imread('name1.jpg');
im2 = imread('name2.jpg');
im3 = imread('name3.jpg');
imhist(im);
hold on
imhist(im2);
hold on
imhist(im3);
The code is from Image Analyst, named 'RGB_Histogram_Demo', I grabbed it from one of his Answers. The histograms are actually histogram of red, green and blue color channels of the same image. I read one image and extract the RGB. I want to know how do I plot/highlight only the un-overlapped part like the dark line in the second figure.
Image = imread('001.bmp');
Red = Image(:,:,1);
Green = Image(:,:,2);
Blue = Image(:,:,3);
[pixelCountRed grayLevels] = imhist(Red, 256);
[pixelCountGreen grayLevels] = imhist(Green, 256);
[pixelCountBlue grayLevels] = imhist(Blue, 256);
plot(pixelCountRed, 'r');
hold on;
plot(pixelCountGreen, 'g');
plot(pixelCountBlue, 'b');
Until this point, it will develop a plot with three histogram in one figure, as shown in figure above. May I know how do I plot the maximum lines of the histogram so it shows one graph with six peaks (as in the example figure)?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Histograms에 대해 자세히 알아보기

태그

질문:

Lim
2015년 7월 9일

댓글:

Lim
2015년 7월 22일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by