Function File: E = entropyfilt (im)
Function File: E = entropyfilt (im, domain)
Function File: E = entropyfilt (im, domain, padding, …)

Computes the local entropy in a neighbourhood around each pixel in an image.

The entropy of the elements of the neighbourhood is computed as

E = -sum (P .* log2 (P)

where P is the distribution of the elements of im. The distribution is approximated using a histogram with nbins cells. If im is logical then two cells are used. For other classes 256 cells are used.

When the entropy is computed, zero-valued cells of the histogram are ignored.

The neighbourhood is defined by the domain binary mask. Elements of the mask with a non-zero value are considered part of the neighbourhood. By default a 9 by 9 matrix containing only non-zero values is used.

At the border of the image, extrapolation is used. By default symmetric extrapolation is used, but any method supported by the padarray function can be used. Since extrapolation is used, one can expect a lower entropy near the image border.

See also: entropy, paddarray, stdfilt.

Package: image