| Image Processing Toolbox User's Guide | ![]() |
Local standard deviation of an image
Syntax
Description
J = stdfilt(I)
returns the array J, where each output pixel contains the standard deviation of the 3-by-3 neighborhood around the corresponding pixel in the input image I. I can have any dimension. The output image J is the same size as the input image I.
For pixels on the borders of I, stdfilt uses symmetric padding. In symmetric padding, the values of padding pixels are a mirror reflection of the border pixels in I.
J = stdfilt(I,NHOOD)
calculates the local standard deviation of the input image I, where you specify the neighborhood in NHOOD. NHOOD is a multidimensional array of zeros and ones where the nonzero elements specify the neighbors. NHOOD's size must be odd in each dimension.
By default, stdfilt uses the neighborhood ones(3). stdfilt determines the center element of the neighborhood by floor((size(NHOOD) + 1)/2).
Class Support
I can be logical or numeric and must be real and nonsparse. NHOOD can be logical or numeric and must contain zeros and/or ones. J is of class double.
Notes
To specify neighborhoods of various shapes, such as a disk, use the strel function to create a structuring element object and then use the getnhood function to extract the neighborhood from the structuring element object.
Example
See also
entropyfilt, getnhood, rangefilt, std2, strel
| std2 | strel | ![]() |
© 1994-2005 The MathWorks, Inc.