shannon entropy and entropy of grayscale

9 Ansichten (letzte 30 Tage)
elTurco
elTurco am 7 Apr. 2023
Beantwortet: the cyclist am 8 Apr. 2023
How can i find the entropy of a gray image without using the "entropy(I)" , "entropy" command? with just codes and arrays?
  2 Kommentare
the cyclist
the cyclist am 7 Apr. 2023
Sounds like homework.
Can you use imhist?
elTurco
elTurco am 8 Apr. 2023
Yes i can

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

the cyclist
the cyclist am 8 Apr. 2023
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

Weitere Antworten (1)

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

Kategorien

Mehr zu Image Processing and Computer Vision finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by