Main Content

stdfilt

图像的本地标准偏差

Description

example

J= stdfilt(I)performs standard deviation filtering of imageIand returns the filtered imageJ。每个输出像素的值是相应输入像素周围3 x-3邻域的标准偏差。对于在边界上的像素I,stdfiltuses symmetric padding. In symmetric padding, the values of padding pixels are a mirror reflection of the border pixels inI

J= stdfilt(I,nhood)specifies the neighborhood,nhood, used to compute the standard deviation.

Examples

collapse all

This example shows how to perform standard deviation filtering usingstdfilt。Brighter pixels in the filtered image correspond to neighborhoods in the original image with larger standard deviations.

Read an image into the workspace.

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

Perform standard deviation filtering usingstdfilt

J = stdfilt(I);

Show the original image and the processed image.

imshow(I) title('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 Standard Deviation Filtering')

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

Input Arguments

collapse all

Image to be filtered, specified as a numeric array or logical array of any dimension.

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

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

By default,stdfiltuses the neighborhoodtrue(3)stdfiltdetermines the center element of the neighborhood byfloor((size(nhood) + 1)/2)

To specify neighborhoods of various shapes, such as a disk, use thestrelfunction to create a structuring element object of the desired shape. Then extract the neighborhood from theneighborhoodproperty of the structuring element.

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

Output Arguments

collapse all

Filtered image, returned as a numeric array of the same size as the input imageI。The class ofJisdouble

Algorithms

If the image containsInfs orNaNs, then the behavior ofstdfiltis undefined. Propagation ofInfs orNaNs might not be localized to the neighborhood around theInf或者NaNpixel.

Extended Capabilities

Introduced before R2006a