Template Function nvcv::cuda::CreateInterpolationWrapNHW

Function Documentation

template<typename T, NVCVBorderType B, NVCVInterpolationType I, class = Require<HasTypeTraits<T>>>
__host__ auto nvcv::cuda::CreateInterpolationWrapNHW(const TensorDataStridedCuda &tensor, T borderValue = {}, float scaleX = {}, float scaleY = {})

Factory function to create an NHW interpolation wrap given a tensor data.

The output InterpolationWrap wraps an NHW 3D tensor allowing to access data per batch (N), per row (H) and per column (W) of the input tensor interpolation-border aware in rows (or height H) and columns (or width W). The input tensor data must have either NHWC or HWC layout, where the channel C is inside the given template type T, e.g. T=uchar4 for RGBA8. The active dimensions are H (second) and W (third).

Template Parameters:
  • T – Type of the values to be accessed in the interpolation wrap.

  • B – Border extension to be used when accessing H and W, one of NVCVBorderType

  • I – Interpolation to be used when accessing H and W, one of NVCVInterpolationType

Parameters:
  • tensor[in] Reference to the tensor that will be wrapped.

  • borderValue[in] Border value to be used when accessing outside elements in constant border type

  • scaleX[in] Scale X value to be used when interpolation elements with area type

  • scaleY[in] Scale Y value to be used when interpolation elements with area type

Returns:

Interpolation wrap useful to access tensor data interpolation-border aware in H and W in CUDA kernels.