You are here: Start » AVL.NET » AVL.GradientMagnitudeImage(AvlNet.Image, AvlNet.Region, AvlNet.GradientMaskOperator, AvlNet.MagnitudeMeasure, int, AvlNet.Image)

AVL.GradientMagnitudeImage(AvlNet.Image, AvlNet.Region, AvlNet.GradientMaskOperator, AvlNet.MagnitudeMeasure, int, AvlNet.Image)

Measures the strength of gradient at each pixel location with Sobel or Prewitt operator.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void GradientMagnitudeImage(
	AvlNet.Image inImage,
	AvlNet.Region inRoi,
	AvlNet.GradientMaskOperator inOperator,
	AvlNet.MagnitudeMeasure inMeasure,
	int inScale,
	out AvlNet.Image outValueImage
)

Parameters

inImage
Type: AvlNet.Image
Input image
inRoi
Type: AvlNet.Region
Range of output pixels to be computed, or null.
inOperator
Type: AvlNet.GradientMaskOperator
Defines how the gradient is computed
inMeasure
Type: AvlNet.MagnitudeMeasure
Defines how the gradient magnitude is computed
inScale
Type: System.Int32
Scales the resulting gradient magnitudes
outValueImage
Type: AvlNet.Image
Gradient magnitudes of the image

Description

The operation computes the magnitude of the intensity change at each pixel of the inImage. Firstly the selected inOperator is used to obtain two-dimensional gradient vector at each pixel. Then the magnitudes of the vectors are estimated using the inMeasure method.

Specified by inMeasure method computes magnitude (A) from horizontal gradient component (x) and vertical gradient component (y) using one of following formulas:
\[A_{Horizontal}=|x|\] \[A_{Vertical}=|y|\] \[A_{Average}=\frac{|x|+|y|}{2}\] \[A_{Sum}=|x|+|y|\] \[A_{Maximum}=Max(|x|,|y|)\] \[A_{Hypot}=\sqrt{x^{2}+y^{2} }\]

The magnitudes are multiplied by inScale factor and saturated if they exceed the greatest value of their type.

Examples

GradientMagnitudeImage performed on the sample image with inOperator = Sobel, inMeasure = Hypot.

Hardware Acceleration

This operation is optimized for SSE2 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.

See also