You are here: Start » AVL.NET » Function Reference » Image » Image Local Transforms » AVL.GradientImage_Mask

AVL.GradientImage_Mask

Computes a gradient image with a Sobel or Prewitt operator.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void GradientImage_Mask
(
	AvlNet.Image inImage,
	AvlNet.GradientMaskOperator inOperator,
	int inScale,
	AvlNet.Image outGradientImage
)

Parameters

Name Type Range Default Description
inImageAvlNet.ImageInput image.
inOperatorAvlNet.GradientMaskOperatorDefines how the gradient is computed.
inScaleint<1, 16>1Scales the resulting gradients. Default value: 1.
outGradientImageAvlNet.ImageGradients of the image.

Description

The operation computes the image gradient, which is directional change of the image intensity at each pixel. Each pixel of the resulting two-channel outGradientImage represents the gradient at the corresponding inImage pixel as a two-dimensional vector (each dimension on a separate, signed image channel). The length and direction of the vector represents the strength and direction of the intensity change.

Note that the format of the resulting image is not perfectly legible for a human eye. Firstly, the resulting image contains negative values. Secondly, directions of the gradients are represented indirectly.

  • To extract information about the sole strength of the intensity change one could use GradientMagnitudeImage filter.

Examples

GradientImage_Mask performed on the sample image with inOperator = Sobel. Image on the right is actually an absolute value of the resulting outGradientImage, so negative pixel values are also visible.

Hardware Acceleration

This operation is optimized for SSSE3 technology for pixels of type: UINT8.

This operation is optimized for AVX2 technology for pixels of type: UINT8.

This operation is optimized for NEON technology for pixels of type: UINT8.

This operation supports automatic parallelization for multicore and multiprocessor systems.

Hardware acceleration settings may be manipulated with Settings class.

Errors

List of possible exceptions:

Error type Description
DomainError Region exceeds an input image in GradientImage_Mask.

Function Overrides

See also