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.
- depth
- Depth of R. A value of -1 will resdult in the same depth as handle.
- kernel
- 2D real matrix specifying the convolution kernel.
- 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.
- delta
- Optional value to be added to each pixel of R. Default value is 0.
- 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
Outputs
- R
- Handle of the filtered image.
Examples
handle = imreadcv('cv2.jpg');
depth = -1;
kernel = ones(3, 3)/(3 * 3);
R = filter2Dcv(handle, depth, kernel);