Package: vision
Perform 2D FIR filtering of input matrix
The ImageFilter
object performs 2D FIR filtering
of input matrix.
H = vision.ImageFilter
returns
a System object, H
. This object performs twodimensional FIR
filtering
of an input matrix using the specified filter coefficient matrix.
H = vision.ImageFilter(
returns
an image filter System object, Name
,Value
)H
, with each specified
property set to the specified value. You can specify additional namevalue
pair arguments in any order as (Name1
, Value1
,...,NameN
,ValueN
).
Code Generation Support 

Supports MATLAB^{®} Function block: Yes 
System Objects in MATLAB Code Generation. 
Code Generation Support, Usage Notes, and Limitations. 

Set to Using separable filter coefficients reduces the amount of calculations
the object must perform to compute the output. The function  

Source of filter coefficients Indicate how to specify the filter coefficients as one of  

Filter coefficients Specify the filter coefficients as a real or complexvalued
matrix. This property applies when you set the  

Vertical filter coefficients for the separable filter Specify the vertical filter coefficients for the separable filter
as a vector. This property applies when you set the  

Horizontal filter coefficients for the separable filter Specify the horizontal filter coefficients for the separable
filter as a vector. This property applies when you set the  

Output size as full, valid or same as input image size Specify how to control the size of the output as one of
When you set this property to When you set this property to
 

How to pad boundary of input matrix Specify how to pad the boundary of input matrix as one of
This property applies when you set the  

Source of padding value Specify how to define the constant boundary value as one of  

Constant value with which to pad matrix Specify a constant value with which to pad the input matrix.
This property applies when you set the  

Method for filtering input matrix Specify the method by which the object filters the input matrix
as one of 
clone  Create image filter object with same property values 
getNumInputs  Number of expected inputs to step method 
getNumOutputs  Number of outputs from step method 
isLocked  Locked status for input attributes and nontunable properties 
release  Allow property value and input characteristics changes 
step  Filter input image 
Filter an image to enhance the edges of 45 degree
img = im2single(rgb2gray(imread('peppers.png'))); hfir2d = vision.ImageFilter; hfir2d.Coefficients = [1 0; 0 .5]; fImg = step(hfir2d, img); subplot(2,1,1);imshow(img);title('Original image') subplot(2,1,2);imshow(fImg);title('Filtered image')
This object implements the algorithm, inputs, and outputs described on the 2D FIR Filter block reference page. The object properties correspond to the block parameters.