Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5- Calculate the entropy H of several grayscale images, including the uniform random image generated above. Entropy is defined as where M is the number
5- Calculate the entropy H of several grayscale images, including the uniform random image generated above. Entropy is defined as
where M is the number of gray levels and pk is the probability associated with gray level k. Note that a base-2 logarithm is used conventionally. See the file entropy.m. Read p 532533 of the textbook.
___________________________________
function h = entropy(x) % % Entropy of an image % counts = imhist(x); counts = counts / sum(counts); i = find(counts); h = -sum(counts(i).*log2(counts(i)));
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started