nvidia.dali.fn.laplacian — NVIDIA DALI (original) (raw)

nvidia.dali.fn.laplacian(__input, /, *, bytes_per_sample_hint=[0], dtype=None, normalized_kernel=False, preserve=False, scale=[1.0], smoothing_size=None, window_size=[3], device=None, name=None)#

Computes the Laplacian of an input.

The Laplacian is calculated as the sum of second order partial derivatives with respect to each spatial dimension. Each partial derivative is approximated with a separable convolution, that uses a derivative window in the direction of the partial derivative and smoothing windows in the remaining axes.

By default, each partial derivative is approximated by convolving along all spatial axes: the axis in partial derivative direction uses derivative window of window_size and the remaining axes are convolved with smoothing windows of the same size. If smoothing_size is specified, the smoothing windows applied to a given axis can have different size than the derivative window. Specifying smoothing_size = 1 implies no smoothing in axes perpendicular to the derivative direction.

Both window_size and smoothing_size can be specified as a single value or per axis. For example, for volumetric input, if window_size=[dz, dy, dx]and smoothing_size=[sz, sy, sx] are specified, the following windows will be used:

Window sizes and smoothing sizes must be odd. The size of a derivative window must be at least 3. Smoothing window can be of size 1, which implies no smoothing along corresponding axis.

To normalize partial derivatives, normalized_kernel=True can be used. Each partial derivative is scaled by 2^(-s + n + 2), where s is the sum of the window sizes used to calculate a given partial derivative (including the smoothing windows) and n is the number of data dimensions/axes. Alternatively, you can specify scale argument to customize scaling factors. Scale can be either a single value or n values, one for every partial derivative.

Operator uses 32-bit floats as an intermediate type.

Note

The channel C and frame F dimensions are not considered data axes. If channels are present, only channel-first or channel-last inputs are supported.

This operator allows sequence inputs and supports volumetric data.

Supported backends

Parameters:

__input (TensorList) – Input to the operator.

Keyword Arguments: