You are here: Start » AVL.NET » AVL.ConvolveImage(AvlNet.Image, AvlNet.Region, AvlNet.Matrix, bool, AvlNet.Location?, AvlNet.Image)

AVL.ConvolveImage(AvlNet.Image, AvlNet.Region, AvlNet.Matrix, bool, AvlNet.Location?, AvlNet.Image)

Computes a convolution of the input image with a user-specified mask.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void ConvolveImage(
	AvlNet.Image inImage,
	AvlNet.Region inRoi,
	AvlNet.Matrix inMask,
	bool inNormalizeMaskValues,
	AvlNet.Location? inMaskOrigin,
	out AvlNet.Image outImage
)

Parameters

inImage
Type: AvlNet.Image
Input image
inRoi
Type: AvlNet.Region
Range of outImage pixels to be computed, or null.
inMask
Type: AvlNet.Matrix
Image convolution kernel
inNormalizeMaskValues
Type: System.Boolean
Normalize sum of weights in mask to one
inMaskOrigin
Type: System.Nullable<AvlNet.Location>
Relative location of point to its mask, or null.
outImage
Type: AvlNet.Image
Output image

Description

The operation computes new value of pixel as a convolution of inImage pixels and the inMask values. Pixels which mask exceeds inRoi region are set to black. Input and output pixel have the same type. If result value does not fit into pixel type you should use ConvertPixelType.

Examples

ConvolveImage performed on the sample image with inMask \( \begin{pmatrix} -1 & -2 & -1 \\ 0 & 0 & 0 \\ 1 & 2 & 1 \\ \end{pmatrix} \).

Hardware Acceleration

This operation supports automatic parallelization for multicore and multiprocessor systems.

This operation supports processing on OpenCL compatible device (when inRoi=NIL).

Hardware acceleration settings may be manipulated with Settings class.

Errors

Error type Description
DomainError Empty convolution mask on input in ConvolveImage.
DomainError Mask origin is outside the dimensions of the mask in ConvolveImage.
DomainError Sum of weights in Mask is equal zero. Cannot normalize values.

See also