histogram doesn't work for .png images?

조회 수: 1 (최근 30일)
Lulu Firdaus
Lulu Firdaus 2020년 5월 7일
댓글: Lulu Firdaus 2020년 5월 8일
hello everyone. I am having trouble with displaying histogram for .png image. the image is grayscale already, so I just use this code.
I=imread('38_training.png');
figure,imhist(I)
but the histogram is.. empty.
any idea why? this is the image i'm trying to show the histagram of.
thank you! please help.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 7일
편집: Ameer Hamza 2020년 5월 7일
Your image is binary. It only has white and black pixels. Therefore it only has peaks at 0 and 255. Following example show, it has nothing to do it with png file.
im = imread('pears.png');
imhist(im)

추가 답변 (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