hw8Sln - sum=0; for i=1:length(count), sum=sum+count(i);...

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

View Full Document Right Arrow Icon
N=sum(sum(S)); 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

This homework help was uploaded on 04/05/2008 for the course EE/CPE 462 taught by Professor Prof.hongman during the Spring '07 term at Stevens.

Ask a homework question - tutors are online