shannon entropy and entropy of grayscale
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
elTurco
le 7 Avr 2023
Réponse apportée : the cyclist
le 8 Avr 2023
How can i find the entropy of a gray image without using the "entropy(I)" , "entropy" command? with just codes and arrays?![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1348889/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1348889/image.png)
2 commentaires
Réponse acceptée
the cyclist
le 8 Avr 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))
% Built-in entropy function
entropy(I)
0 commentaires
Plus de réponses (1)
埃博拉酱
le 8 Avr 2023
Entropy.m is open source, why don't you just check out its source code?
edit entropy
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!