Local entropy of grayscale image
J = entropyfilt(I)
J = entropyfilt(I,NHOOD)
J = entropyfilt(I) returns
J, where each output pixel contains the
entropy value of the 9-by-9 neighborhood around the corresponding
pixel in the input image
have any dimension. If
I has more than two dimensions,
entropyfilt treats it as a multidimensional grayscale
image and not as a truecolor (RGB) image. The output image
the same size as the input image
For pixels on the borders of
symmetric padding. In symmetric padding, the values of padding pixels
are a mirror reflection of the border pixels in
J = entropyfilt(I,NHOOD) performs
entropy filtering of the input image
I where you
specify the neighborhood in
a multidimensional array of zeros and ones where the nonzero elements
specify the neighbors.
must be odd in each dimension.
entropyfilt uses the neighborhood
the center element of the neighborhood by
+ 1)/2). To specify neighborhoods of various shapes, such
as a disk, use the
strel function to create a structuring
element object and then use the
to extract the neighborhood from the structuring element object.
I can be
double, and must be real and nonsparse.
be logical or numeric and must contain zeros or ones. The output array
entropyfilt converts any class other than
uint8 for the histogram count calculation
so that the pixel values are discrete and directly correspond to a
This example shows how to perform entropy filtering using
entropyfilt. Brighter pixels in the filtered image correspond to neighborhoods in the original image with higher entropy.
Read an image into the workspace.
I = imread('circuit.tif');
Perform entropy filtering using
J = entropyfilt(I);
Show the original image and the processed image.
imshow(I) title('Original Image')
figure imshow(J,) title('Result of Entropy Filtering')
 Gonzalez, R.C., R.E. Woods, S.L. Eddins, Digital Image Processing Using MATLAB, New Jersey, Prentice Hall, 2003, Chapter 11.