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)`

`gpuarrayB = imfilter(gpuArrayA,h)`

`___= imfilter(___,options,...)`

filters
the multidimensional array `B`

= imfilter(`A`

,`h`

)`A`

with the multidimensional
filter `h`

. The array `A`

can
be `logical`

or a nonsparse numeric array of any
class and dimension. The result `B`

has the same
size and class as `A`

.

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, the `imfilter`

function truncates the result to that data type's
allowed range. If it is an integer data type, `imfilter`

rounds fractional
values.

This function may take advantage of hardware optimization for data types

`uint8`

,`uint16`

,`int16`

,`single`

, and`double`

to run faster.If you specify a large kernel, a kernel that contains large values, or specify an image containing large values, you can see different results between MATLAB and generated code using codegen for floating point data types. This happens because of accumulation errors due to different algorithm implementations.

Was this topic helpful?