This file contains very useful functions for linear image filtering, as well as routines to check whether a given filter mask is separable.
imfilter.q | This file contains very useful functions for linear image filtering, as well as routines to check whether a given filter mask is separable. |
Functions | |
is_filtermask_separable | Checks whether a given kernel is separable, and if so, returns the separable components |
imfilter_separable | Applies a 2D separable impulse response (FIR) filter to an image |
imfilter | Applies a 2D finite impulse response (FIR) filter to an image. |
hor_sobel | Extracts the horizontal edges of an image using a horizontal sobel filter |
ver_sobel | Extracts the vertical edges of an image using a vertical sobel filter |
sobel | Find the edge magnitude using the Sobel filters. |
hor_scharr | Extracts the horizontal edges of an image using a horizontal scharr filter |
ver_scharr | Extracts the vertical edges of an image using a vertical scharr filter |
scharr | Find the edge magnitude using the scharr filters. |
hor_prewith | Extracts the horizontal edges of an image using a horizontal prewith filter |
ver_prewith | Extracts the vertical edges of an image using a vertical prewith filter |
prewith | Find the edge magnitude using the prewith filters. |
gaussfilter | Applies a Gaussian filter to the image |
Checks whether a given kernel is separable, and if so, returns the separable components
function [result, mask_hor, mask_ver] = is_filtermask_separable(kernel)
kernel | the filter mask to check |
result | a boolean value indicating whether the mask is separable |
mask_hor | the horizontal filter mask (only when the filter is separable) |
mask_ver | the vertical filter mask (only when the filter is separable) |
Applies a 2D separable impulse response (FIR) filter to an image
function y = imfilter_separable(x, vmask, hmask, center = 0, boundary_mode = "zero")
x | the input image |
vmask | the vertical filter mask |
hmask | the horizontal filter mask |
center | a 2D vector containing the center of the filter mask |
boundary_mode | the boundary extension mode to be used for filtering |
mask = transpose(vmask) * hmask.
Applies a 2D finite impulse response (FIR) filter to an image.
function y = imfilter(x, mask, center = 0, boundary_mode = "zero")
x | the input image |
mask | the filter mask (i.e. filter impulse response) |
center | a 2D vector containing the center of the filter mask |
boundary_mode | the boundary extension mode to be used for filtering |
The function automatically checks whether the 2D filter mask is separable. If this is the case, a more efficient separable implementation is used.
periodize, mirror_ext, is_filtermask_separable, imfilter_separable