フィルターのクリア

shannon entropy and entropy of grayscale

16 ビュー (過去 30 日間)
elTurco
elTurco 2023 年 4 月 7 日
回答済み: the cyclist 2023 年 4 月 8 日
How can i find the entropy of a gray image without using the "entropy(I)" , "entropy" command? with just codes and arrays?
  2 件のコメント
the cyclist
the cyclist 2023 年 4 月 7 日
Sounds like homework.
Can you use imhist?
elTurco
elTurco 2023 年 4 月 8 日
Yes i can

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

採用された回答

the cyclist
the cyclist 2023 年 4 月 8 日
I = imread('image.png');
figure
imagesc(I)
% Using histogram from imhist
p = imhist(I);
p = p/numel(I);
p(p==0) = [];
entropyFromImhist = -sum(p.*log2(p))
entropyFromImhist = 4.3978
% Built-in entropy function
entropy(I)
ans = 4.3978

その他の回答 (1 件)

埃博拉酱
埃博拉酱 2023 年 4 月 8 日
Entropy.m is open source, why don't you just check out its source code?
edit entropy

Community Treasure Hunt

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

Start Hunting!

Translated by