convolve
Applies a convolution filter to a pixmap and returns the result.
Syntax
-
convolve(pm, A)
-
pm
is a pixmap -
A
is a square matrix of odd size
-
Description
If pm
is a pixmap and A
a square matrix of odd size, then convolve(pm, A)
applies the convolution filter with kernel A
to pm
and returns the result.
A predefined convolution kernel can be returned by the ConvolutionKernel
function.
Examples
convolve(ExampleData("Sally"), RandomMatrix(11) / 20)
convolve(ExampleData("Sally"), ConvolutionKernel("3×3 sharpen"))
convolve(ExampleData("Sally"), ConvolutionKernel("3×3 Sobel 1") + ConvolutionKernel("3×3 Sobel 2"))