ImageFilter

ImageFilter[f,image,r]
applies the function f to the range-r neighborhood of each pixel in each channel of image.

Details and OptionsDetails and Options

  • ImageFilter[f,image,r] replaces the value of each pixel by the result of applying the function f to the × array of values around that pixel.
  • ImageFilter operates separately on each channel in an image.
  • ImageFilter[f,image,{rrow,rcol}] uses range in height, and in width.
  • ImageFilter[f,image,{{rtop,rbottom},{rleft,rright}}] picks out neighborhoods that extend rows up, rows down, columns to the left, and columns to the right.
  • The channel values supplied to f are normally in the range 0 to 1, regardless of the underlying type used in the Image object. The function f is assumed to return channel values that are normally in the range 0 to 1.
  • ImageFilter returns an image of the same type as image.
  • The following options can be given:
  • Padding"Fixed"what values to assume beyond the image
    InterleavingFalsewhether to supply f lists of channel values
    MaskingAllregion of interest
  • With the default setting Interleaving->False, the elements in the arrays to which f is applied are individual channel values for the pixels.
  • With Interleaving->True, the elements are instead the list of all channel values for a particular pixel.
  • ImageFilter[f,image,] by default gives an image of the same dimensions as image.
  • With a setting Padding->None, ImageFilter[f,image,] normally gives an image smaller than image.
  • ImageFilter works with Image3D object.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Apply a local minimum filter:

In[1]:=
Click for copyable input
Out[1]=

Blur an image by replacing each pixel with the local mean:

In[1]:=
Click for copyable input
Out[1]=

Apply a local maximum filter to a 3D image:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2008
(7.0)
| Updated in 2012
(9.0)