필터 지우기
필터 지우기

how to change color output of imhist function?

조회 수: 5 (최근 30일)
fred bnm
fred bnm 2016년 2월 9일
댓글: Edmond Lui 2016년 8월 21일
imhist function display histogram of image. for display histogram of color RGB image (in 3 color RED-GREEN-BLUE).In separate windows And also at the same time in a single window
img=imread('test.jpg');
img1=img(:,:,1);
img2=img(:,:,2);
img3=img(:,:,3);
rHist1 = imhist(img1);%histogram of red band
gHist1 = imhist(img2);%histogram of green band
bHist1 = imhist(img3);%histogram of blue band
figure(1),
subplot(2,3,1),imshow(img1),title('red band');
subplot(2,3,2),imshow(img2),title('green band');
subplot(2,3,3),imshow(img3),title('blue band');
subplot(2,3,4),imhist(img1),title('hist of R');
subplot(2,3,5),imhist(img2),title('hist of G');
subplot(2,3,6),imhist(img3),title('hist of B');
figure(2)
%show histogram of three band in 3 color

채택된 답변

Walter Roberson
Walter Roberson 2016년 2월 9일
copyobj([rHist1, gHist1, bHist1], gca)
  댓글 수: 2
fred bnm
fred bnm 2016년 2월 9일
@Walter Roberson please explain more
Edmond Lui
Edmond Lui 2016년 8월 21일
to plot them all together in 1 plot use:
hold on subplot... subplot... subplot... hold off

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by