estimation/measure of entropy

3 次查看(过去 30 天)
How to calculate entropy of an image without using the inbuilt functions? Entropy is the measure of loss of information.
-summation(P.*log2 P)
P is the count of histogram..but not getting the proper result!Anyone plz help.

采纳的回答

Thorsten
Thorsten 2014-11-28
编辑:Thorsten 2014-11-28
Make sure you run log2 only on values > 0. Otherwise you would get NaN.
I = im2double(rgb2gray(imread('peppers.png')));
P = hist(I(:), linspace(0, 1, 256)); P = P(:); P = P(P(:)>0);
E = -sum(P.*log2(P))
  4 个评论
Youssef  Khmou
Youssef Khmou 2014-11-29
that is an efficient technique for controlling the histogram.
Durga
Durga 2015-1-13
Thanks a lot for helping me to understand.

请先登录,再进行评论。

更多回答(1 个)

Behrang Mehrparvar
Behrang Mehrparvar 2015-5-10
this link might be useful in setting the bin size [ link ]

类别

Help CenterFile Exchange 中查找有关 Spatial Search 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by