{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw8Sln - sum=0 for i=1:length(count sum=sum count(i end...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
N=sum(sum(S)); if ((N>0) & (min(S(:))>=0)) Snz=nonzeros(S); H=log2(N)-sum(Snz.*log2(Snz))/N; else H=0; end clear all; iran=imread('kidman1.jpg'); iran=rgb2gray(iran); iran=double(iran); iran=iran/max(max(iran)); [count,x]=imhist(iran);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: sum=0; for i=1:length(count), sum=sum+count(i); end prob=count./sum; zero_entropy=0; for i=1:length(prob), if prob(i)~=0 zero_entropy=zero_entropy-(prob(i)*log2(prob(i))); end end zero_entropy...
View Full Document

{[ snackBarMessage ]}