Azzera filtri
Azzera filtri

estimation/measure of entropy

5 visualizzazioni (ultimi 30 giorni)
Durga
Durga il 28 Nov 2014
Risposto: Behrang Mehrparvar il 10 Mag 2015
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.

Risposta accettata

Thorsten
Thorsten il 28 Nov 2014
Modificato: Thorsten il 28 Nov 2014
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 Commenti
Youssef  Khmou
Youssef Khmou il 29 Nov 2014
that is an efficient technique for controlling the histogram.
Durga
Durga il 13 Gen 2015
Thanks a lot for helping me to understand.

Accedi per commentare.

Più risposte (1)

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

Categorie

Scopri di più su Spatial Search in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by