Main Content

entropy

Entropy of grayscale image

Description

e = entropy(I) returns the entropy of grayscale image I. Entropy is a statistical measure of randomness that can be used to characterize the texture of the input image.

example

Examples

collapse all

Read image into the workspace.

I = imread('circuit.tif');

Calculate the entropy.

J = entropy(I)
J = 
6.9439

Input Arguments

collapse all

Grayscale image, specified as a numeric array or logical array of any dimension. The entropy function expects images of data type double and single to have values in the range [0, 1]. If I has values outside the range [0, 1], then you can rescale values to the expected range by using the rescale function.

Data Types: double | uint8 | uint16 | uint32 | logical

Output Arguments

collapse all

Entropy of image I, returned as a numeric scalar.

Data Types: double

More About

collapse all

References

[1] Gonzalez, R. C., R. E. Woods, and S. L. Eddins. Digital Image Processing Using MATLAB. New Jersey, Prentice Hall, 2003, Chapter 11.

Extended Capabilities

expand all

Version History

Introduced before R2006a

expand all