Computes the linear filtering of the image I and the filter f. The computation is performed using double precision floating point numbers, but the class of the input image is preserved as the following example shows.
I = 255*ones(100, 100, "uint8"); f = fspecial("average", 3); J = imfilter(I, f); class(J) ⇒ ans = uint8
The function also accepts a number of optional arguments that control the details of the filtering. The following options is currently accepted
If a scalar input argument is given, the image is padded with this scalar as part of the filtering. The default value is 0.
The image is padded symmetrically.
The image is padded using the border of the image.
The image is padded by circular repeating of the image elements.
The size of the output image is the same as the input image. This is the default behaviour.
Returns the full filtering result.
The filtering is performed using correlation. This is the default behaviour.
The filtering is performed using convolution.
See also: conv2, filter2, fspecial, padarray.
Package: image