Suppose I have block of pixels form an image as following
8 5 22 94 63
65 98 52 41 32
65 21 48 59 77
20 14 15 63 52
21 63 77 85 95
how can I find homogeneity
and energy
of these pixels (block)
and I tried to compute entropy for these values as following :
H=hist(block(:));
pro=H./25;
pro(pro==0)=[]; % remove zeros
Ent=-sum(pro.*log2(pro)); %entropy equation
Is this correct way to calculate the entropy?