calcGradients

Calculate gradient magnitude and orientation of an image slice.

void
calcGradients
(
InputTensor
V = DeepElementType!InputTensor
)
(
InputTensor input
,
ref Slice!(Contiguous, [2], V*) mag
,
ref Slice!(Contiguous, [2], V*) orient
,,
TaskPool pool = taskPool
)
if (
isFloatingPoint!V
)

Parameters

input InputTensor

Input slice of an image.

mag Slice!(Contiguous, [2], V*)

Output magnitude value of gradients. If shape does not correspond to input, is allocated anew.

orient Slice!(Contiguous, [2], V*)

Orientation value of gradients in radians. If shape does not correspond to input, is allocated anew.

edgeKernelType EdgeKernel

Optional convolution kernel type to calculate partial derivatives. Default value is EdgeKernel.SIMPLE, which calls calcPartialDerivatives function to calculate derivatives. Other options will perform convolution with requested kernel type.

pool TaskPool

TaskPool instance used parallelise the algorithm.

Note: Input slice's memory has to be contiguous. Magnitude and orientation slices' strides have to be the identical.

Meta