shannon entropy and entropy of grayscale
9 次查看(过去 30 天)
显示 更早的评论
How can i find the entropy of a gray image without using the "entropy(I)" , "entropy" command? with just codes and arrays?
采纳的回答
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))
% Built-in entropy function
entropy(I)
0 个评论
更多回答(1 个)
埃博拉酱
2023-4-8
Entropy.m is open source, why don't you just check out its source code?
edit entropy
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!