You are here: Start » Image » Image Local Transforms » GradientImage_Mask
GradientImage_Mask
Header: | AVL.h |
---|---|
Namespace: | avl |
Computes a gradient image with a Sobel or Prewitt operator.
Syntax
void avl::GradientImage_Mask ( const avl::Image& inImage, atl::Optional<const avl::Region&> inRoi, avl::GradientMaskOperator::Type inOperator, const int inScale, avl::Image& outGradientImage, avl::Image& diagGradientDirections )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
inImage | const Image& | Input image | |||
inRoi | Optional<const Region&> | NIL | Range of outGradientImage pixels to be computed | ||
inOperator | GradientMaskOperator::Type | Defines how the gradient is computed | |||
inScale | const int | 1 - 16 | 1 | Scales the resulting gradients | |
outGradientImage | Image& | Gradients of the image | |||
diagGradientDirections | Image& | Gradient directions presented in a human readable format |
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
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.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Region exceeds an input image in GradientImage_Mask. |
See Also
- GradientImage – Computes a gradient image with smoothing operator of any size. The output pixels are signed.
- GradientMagnitudeImage – Measures the strength of gradient at each pixel location.