主要内容

熵风格

Local entropy of grayscale image

Description

example

J=熵filt(I)returns the arrayJ, where each output pixel contains the entropy value of the 9-by-9 neighborhood around the corresponding pixel in the input imageI

For pixels on the borders ofI,熵风格uses symmetric padding. In symmetric padding, the values of padding pixels are a mirror reflection of the border pixels inI

J=熵filt(I,nhood)执行输入图像的熵过滤Iusing the neighborhoodnhood

Examples

collapse all

This example shows how to perform entropy filtering using熵风格。Brighter pixels in the filtered image correspond to neighborhoods in the original image with higher entropy.

在工作区中阅读图像。

I = imread('电路.tif');

Perform entropy filtering using熵风格

J = entropyfilt(I);

Show the original image and the processed image.

imshow(i)标题('Original Image')

Figure contains an axes object. The axes object with title Original Image contains an object of type image.

figure imshow(J,[]) title('Result of Entropy Filtering')

Figure contains an axes object. The axes object with title Result of Entropy Filtering contains an object of type image.

Input Arguments

collapse all

Image to be filtered, specified as a numeric array of any dimension. If the input image has more than two dimensions (ndims(I) > 2), such as for an RGB image, then熵风格filters all 2-D planes along the higher dimensions. For data typesdoublesingle,强度values ofImust be in the range [0, 1].

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

Neighborhood, specified as a numeric or logical array containing0s and1s. The size ofnhood在每个维度中必须奇怪。

By default,熵风格uses the neighborhoodtrue(9)。The center element of the neighborhood isfloor((size(nhood) + 1)/2)

To specify neighborhoods of other shapes, such as a disk, use thestrel函数创建所需形状的结构元素对象。然后,从结构元素对象的对象中提取邻域neighborhoodproperty.

Data Types:single|double|int8|INT16|int32|int64|uint8|uint16|uint32|uint64|logical

Output Arguments

collapse all

Filtered image, returned as a numeric array the same size as the input imageI。The data type ofJisdouble。如果输入图像Iis a binary image (data typelogical), then the values ofJ在[0,1]范围内。对于所有其他数据类型I, the values ofJare in the range [0, 8].

Data Types:double

More About

collapse all

Entropy

Entropy is a statistical measure of randomness that can be used to characterize the texture of the input image.

熵定义为-sum(p。*log2(p)), wherep包含从imhist

Tips

  • By default,熵风格uses two bins for logical arrays.熵风格converts any other class touint8for the histogram count calculation and uses 256 bins so that the pixel values are discrete and directly correspond to a bin value.

  • 如果输入图像I是灰度图像,然后是Jcan exceed the range [0, 1] that some Image Processing Toolbox™ functions expect for images of typedouble。通过J作为这些功能的输入参数,请使用恢复function to rescale the values ofJto the range [0, 1].

参考

[1]Gonzalez, R. C., R. E. Woods, and S. L. Eddins.Digital Image Processing Using MATLAB。新泽西,Prentice Hall,2003年,第11章。

Version History

在R2006a之前引入