How does the imhist function work for RGB image?

Hello everyone.
I looked up the use of imhist function. It plots the histogram for a grayscale image. But if the input is an RGB image, it still produces a histogram? Is it converting the RGB to grayscale and then showing the histogram?
And would it be technically correct to show the histogram for a RGB image this way? Thanks in advance!

 채택된 답변

Image Analyst
Image Analyst 2020년 5월 30일
편집: Image Analyst 2020년 5월 30일

1 개 추천

Did you try to look at the source code
>> edit imhist.m
Also, see attached demo. You might like it.

댓글 수: 2

John Doe
John Doe 2020년 5월 30일
Thanks for the prompt answer, Image analyst.
So, should I go for color histograms in case of RGB image or should I use the default imhist function? imhist shows a colorbar in graytone for RGB image. I just want to be technically correct here.
John Doe
John Doe 2020년 5월 30일
편집: John Doe 2020년 5월 30일
I checked the source code. I think it's performing operation determining the class (uint8/logical) etc.

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

추가 답변 (0개)

카테고리

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

질문:

2020년 5월 30일

편집:

2020년 5월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by