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)
  1 件のコメント
Lulu Firdaus
Lulu Firdaus 2020 年 5 月 8 日
I see. thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by