Function directConvolution

  • Apply a direct convolution on an image using the specified kernel. The convolution corresponds of a weighted average of the surrounding pixels, the weights being defined in the kernel.

    Parameters

    • image: Image

      The image to process.

    • kernel: number[][]

      Kernel to use for the convolution. Should be a 2D matrix with odd number of rows and columns.

    • options: ConvolutionOptions = {}

      Convolution options.

    Returns Image

    The convoluted image.