Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

N-D filtering of multidimensional images

`B = imfilter(A,h)`

`B = imfilter(A,h,options,...)`

This function may take advantage of hardware optimization for data types

`uint8`

,`uint16`

,`int16`

,`single`

, and`double`

to run faster.

The

`imfilter`

function computes the value of each output pixel using double-precision, floating-point arithmetic. If the result exceeds the range of the data type, then`imfilter`

truncates the result to the allowed range of the data type. If it is an integer data type, then`imfilter`

rounds fractional values.If you specify an even-sized kernel

`h`

, then the center of the kernel is`floor((size(h) + 1)/2)`

.For example, the center of 4-element filter

`[0.25 0.75 -0.75 -0.25]`

is the second element,`0.75`

. This filter gives identical results as filtering with the 5-element filter`[0 0.25 0.75 -0.75 -0.25]`

.