Back to FabImage Library website

You are here: Start » Function Reference » Image » Image Local Transforms » GradientImage

GradientImage


Header: FIL.h
Namespace: fil
Module: FoundationLite

Computes a gradient image with smoothing operator of any size. The output pixels are signed.

Syntax

C++
C#
 
void fil::GradientImage
(
	const fil::Image& inImage,
	ftl::Optional<const fil::Region&> inRoi,
	fil::GradientOperator::Type inOperator,
	const float inStdDevX,
	ftl::Optional<float> inStdDevY,
	fil::Image& outGradientImage,
	fil::Image& diagGradientDirections
)

Parameters

Name Type Range Default Description
Input value
inImage const Image& Input image
Input value
inRoi Optional<const Region&> NIL Range of outGradientImage pixels to be computed
Input value
inOperator GradientOperator::Type Defines how the gradient is computed
Input value
inStdDevX const float 0.0 - 2.0f Horizontal smoothing standard deviation
Input value
inStdDevY Optional<float> 0.0 - NIL Vertical smoothing standard deviation
Output value
outGradientImage Image& Gradients of the image
Diagnostic input
diagGradientDirections Image& Gradient directions presented in a human readable format

Remarks

Please note that about a half of the pixels will be negative and in the preview windows they will be displayed as black.

Hardware Acceleration

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.