filter2Dcv

Apply a linear filter to the image, handle.

Syntax

R = filter2Dcv(handle, depth, kernel...)

R = filter2Dcv(handle, depth, kernel, anchor, delta, type)

Inputs

handle
Handle of an image.
Type: integer
depth
Depth of R. A value of -1 will resdult in the same depth as handle.
Type: scalar
kernel
2D real matrix specifying the convolution kernel.
Type: matrix
anchor
Optional vector of 2 integers specifying the relative position of a filtered point in the kernel. Default value is [-1 -1], indicating the center of the kernel.
Type: vector
delta
Optional value to be added to each pixel of R. Default value is 0.
Type: scalar
type
Optional parameter specifying the pixel extrapolation method. Default value is 4. Valid values are:
0
Type cv::BORDER_CONSTANT.
1
Type cv::BORDER_REPLICATE
2
Type cv::BORDER_REFLECT
4
Type cv::BORDER_DEFAULT - default
16
Type cv::BORDER_ISOLATED
Type: integer

Outputs

R
Handle of the filtered image.
Type: integer

Examples

Apply a linear filter on an image with default parameters:

handle = imreadcv('cv2.jpg');
depth = -1;
kernel = ones(3, 3)/(3 * 3);
R = filter2Dcv(handle, depth, kernel);


Figure 1. Input image


Figure 2. Filtered image