Operators

cvcuda.adaptivethreshold(src: cvcuda.Tensor, max_value: typing.SupportsFloat | typing.SupportsIndex, adaptive_method: cvcuda.AdaptiveThresholdType = <AdaptiveThresholdType.MEAN_C: 0>, threshold_type: cvcuda.ThresholdType = <ThresholdType.BINARY: 1>, block_size: typing.SupportsInt | typing.SupportsIndex, c: typing.SupportsFloat | typing.SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the adaptive threshold operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • max_value (float) – Non-zero value assigned to the pixels for which the condition is satisfied.

  • adaptive_method (cvcuda.AdaptiveThresholdType) – Adaptive threshold algorithm to use.

  • threshold_type (cvcuda.ThresholdType) – Threshold type that must be either cvcuda.ThresholdType.BINARY or cvcuda.ThresholdType.BINARY_INV.

  • block_size (int) – Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on.

  • c (float) – Constant subtracted from the mean or weighted mean. Normally, it is positive but may be zero or negative as well.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.adaptivethreshold(src: cvcuda.ImageBatchVarShape, max_value: cvcuda.Tensor, adaptive_method: cvcuda.AdaptiveThresholdType = <AdaptiveThresholdType.MEAN_C: 0>, threshold_type: cvcuda.ThresholdType = <ThresholdType.BINARY: 1>, max_block_size: typing.SupportsInt | typing.SupportsIndex, block_size: cvcuda.Tensor, c: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the adaptive threshold operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing the result of the operation.

  • max_value (cvcuda.Tensor) – Non-zero value assigned to the pixels for which the condition is satisfied, specified per image.

  • adaptive_method (cvcuda.AdaptiveThresholdType) – Adaptive threshold algorithm to use.

  • threshold_type (cvcuda.ThresholdType) – Threshold type that must be either cvcuda.ThresholdType.BINARY or cvcuda.ThresholdType.BINARY_INV.

  • max_block_size (int) – The maximum block size that will be used by the operator.

  • block_size (cvcuda.Tensor) – Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on, specified per image.

  • c (cvcuda.Tensor) – Constant subtracted from the mean or weighted mean. Normally, it is positive but may be zero or negative as well, specified per image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.adaptivethreshold_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, max_value: typing.SupportsFloat | typing.SupportsIndex, adaptive_method: cvcuda.AdaptiveThresholdType = <AdaptiveThresholdType.MEAN_C: 0>, threshold_type: cvcuda.ThresholdType = <ThresholdType.BINARY: 1>, block_size: typing.SupportsInt | typing.SupportsIndex, c: typing.SupportsFloat | typing.SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the adaptive threshold operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • max_value (float) – Non-zero value assigned to the pixels for which the condition is satisfied.

  • adaptive_method (cvcuda.AdaptiveThresholdType) – Adaptive threshold algorithm to use.

  • threshold_type (cvcuda.ThresholdType) – Threshold type that must be either cvcuda.ThresholdType.BINARY or cvcuda.ThresholdType.BINARY_INV.

  • block_size (int) – Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on.

  • c (float) – Constant subtracted from the mean or weighted mean. Normally, it is positive but may be zero or negative as well.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.adaptivethreshold_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, max_value: cvcuda.Tensor, adaptive_method: cvcuda.AdaptiveThresholdType = <AdaptiveThresholdType.MEAN_C: 0>, threshold_type: cvcuda.ThresholdType = <ThresholdType.BINARY: 1>, max_block_size: typing.SupportsInt | typing.SupportsIndex, block_size: cvcuda.Tensor, c: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the adaptive threshold operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing the result of the operation.

  • max_value (cvcuda.Tensor) – Non-zero value assigned to the pixels for which the condition is satisfied, specified per image.

  • adaptive_method (cvcuda.AdaptiveThresholdType) – Adaptive threshold algorithm to use.

  • threshold_type (cvcuda.ThresholdType) – Threshold type that must be either cvcuda.ThresholdType.BINARY or cvcuda.ThresholdType.BINARY_INV.

  • max_block_size (int) – The maximum block size that will be used by the operator.

  • block_size (cvcuda.Tensor) – Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on, specified per image.

  • c (cvcuda.Tensor) – Constant subtracted from the mean or weighted mean. Normally, it is positive but may be zero or negative as well, specified per image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.adjust_hue(src: cvcuda.Tensor, hue: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Adjust Hue operation on the given cuda stream.

Rotates the hue of each RGB image in HSV space: the image is converted to HSV, the hue channel is shifted by hue (H normalized to [0, 1)), and converted back to RGB. hue = 0 leaves the image unchanged; +/-0.5 is a full 180-degree hue rotation. Single-channel images are returned unchanged. Mirrors torchvision.transforms.v2.functional.adjust_hue.

See also

Refer to the CV-CUDA C API reference for the Adjust Hue operator for more details and usage examples.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • hue (float) – Hue-rotation factor in [-0.5, 0.5], applied to all images.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same shape, dtype, and layout as src).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_hue(src: cvcuda.ImageBatchVarShape, hue: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Adjust Hue operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • hue (float) – Hue-rotation factor in [-0.5, 0.5], applied to all images.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same formats and sizes as src).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_hue_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, hue: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Adjust Hue operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Adjust Hue operator for more details and usage examples.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • hue (float) – Hue-rotation factor in [-0.5, 0.5], applied to all images.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_hue_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, hue: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Adjust Hue operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • hue (float) – Hue-rotation factor in [-0.5, 0.5], applied to all images.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_saturation(src: cvcuda.Tensor, saturation: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Adjust Saturation operation on the given cuda stream.

Blends each RGB image toward its grayscale by a scalar factor: out = saturation * image + (1 - saturation) * grayscale, where grayscale = 0.2989*R + 0.587*G + 0.114*B. saturation = 1 leaves the image unchanged, 0 yields grayscale, and values > 1 over-saturate. Single-channel images are returned unchanged. Mirrors torchvision.transforms.v2.functional.adjust_saturation.

See also

Refer to the CV-CUDA C API reference for the Adjust Saturation operator for more details and usage examples.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • saturation (float) – Saturation factor applied to all images (must be >= 0).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same shape, dtype, and layout as src).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_saturation(src: cvcuda.ImageBatchVarShape, saturation: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Adjust Saturation operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • saturation (float) – Saturation factor applied to all images (must be >= 0).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same formats and sizes as src).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_saturation_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, saturation: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Adjust Saturation operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Adjust Saturation operator for more details and usage examples.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • saturation (float) – Saturation factor applied to all images (must be >= 0).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_saturation_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, saturation: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Adjust Saturation operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • saturation (float) – Saturation factor applied to all images (must be >= 0).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_sharpness(src: cvcuda.Tensor, sharpness_factor: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Adjust Sharpness operation on the given cuda stream.

Blends each image with a 3x3-smoothed copy of itself over the image interior: out = sharpness_factor * in + (1 - sharpness_factor) * blur. sharpness_factor of 1.0 leaves the image unchanged, 0.0 yields the fully-smoothed image, and values above 1.0 sharpen. The 1-pixel border is copied unchanged, and images with height or width below 3 are returned unchanged. Mirrors torchvision.transforms.v2.functional.adjust_sharpness.

See also

Refer to the CV-CUDA C API reference for the Adjust Sharpness operator for more details and usage examples.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • sharpness_factor (float) – Non-negative blend weight applied to the original image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same shape, dtype, and layout as src).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_sharpness(src: cvcuda.ImageBatchVarShape, sharpness_factor: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Adjust Sharpness operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • sharpness_factor (float) – Non-negative blend weight applied to the original image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same formats and sizes as src).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_sharpness_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, sharpness_factor: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Adjust Sharpness operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Adjust Sharpness operator for more details and usage examples.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • sharpness_factor (float) – Non-negative blend weight applied to the original image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_sharpness_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, sharpness_factor: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Adjust Sharpness operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • sharpness_factor (float) – Non-negative blend weight applied to the original image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_contrast(src: cvcuda.Tensor, contrast_factor: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the AdjustContrast operation on the given cuda stream.

Blends each image toward its grayscale mean by a scalar factor: out = clamp(contrast_factor * in + (1 - contrast_factor) * mean, 0, bound), where mean is the per-image grayscale mean (BT.601 luma 0.2989 R + 0.587 G + 0.114 B) and bound is 1.0 for float32 and 255 for uint8. Mirrors torchvision.transforms.v2.functional.adjust_contrast.

See also

Refer to the CV-CUDA C API reference for the AdjustContrast operator for more details and usage examples.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images (1 or 3 channels).

  • contrast_factor (float) – Non-negative contrast multiplier (0 = flat gray, 1 = unchanged).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same shape, dtype, and layout as src).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_contrast(src: cvcuda.ImageBatchVarShape, contrast_factor: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the AdjustContrast operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one- or three-component images. Three-component inputs are interpreted as RGB, with RGB and BGR storage swizzles honored.

  • contrast_factor (float) – Non-negative contrast multiplier (0 = flat gray, 1 = unchanged).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same formats and sizes as src).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_contrast_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, contrast_factor: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the AdjustContrast operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the AdjustContrast operator for more details and usage examples.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images (1 or 3 channels).

  • contrast_factor (float) – Non-negative contrast multiplier (0 = flat gray, 1 = unchanged).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.adjust_contrast_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, contrast_factor: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the AdjustContrast operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one- or three-component images. Three-component inputs are interpreted as RGB, with RGB and BGR storage swizzles honored.

  • contrast_factor (float) – Non-negative contrast multiplier (0 = flat gray, 1 = unchanged).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.advcvtcolor(src: cvcuda.Tensor, code: cvcuda.ColorConversion, spec: cvcuda.ColorSpec, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Adv Cvt Color operation on the given cuda stream.

Parameters:
Returns:

The output color converted image.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] kNHWC/kHWC/kNCHW/kCHW semi planar 420 tensors are allowed (2-channel tensors are not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] kNHWC/kHWC/kNCHW/kCHW semi planar 420 tensors are allowed (2-channel tensors are not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes (No for semi planar 420 tensors conversion)
 Width         | Yes
 Height        | Yes (No for semi planar 420 tensors conversion)
cvcuda.advcvtcolor_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, code: cvcuda.ColorConversion, spec: cvcuda.ColorSpec, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Adv Cvt Color operation on the given cuda stream.

Parameters:
Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] kNHWC/kHWC/kNCHW/kCHW semi planar 420 tensors are allowed (2-channel tensors are not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] kNHWC/kHWC/kNCHW/kCHW semi planar 420 tensors are allowed (2-channel tensors are not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes (No for semi planar 420 tensors conversion)
 Width         | Yes
 Height        | Yes (No for semi planar 420 tensors conversion)
cvcuda.autocontrast(src: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Auto Contrast operation on the given cuda stream.

Maximizes (normalizes) image contrast by remapping each channel independently so its spatial minimum maps to 0 and its spatial maximum maps to the data-type maximum (255 for 8-bit, 65535 for 16-bit, 1.0 for float). A channel that is flat (all pixels equal) is left unchanged. This mimics torchvision.transforms.v2.functional.autocontrast / PIL.ImageOps.autocontrast with cutoff = 0 for finite inputs. For floating-point inputs, only finite pixels define the channel range; NaN and infinity pixels are copied unchanged.

See also

Refer to the CV-CUDA C API reference for the Auto Contrast operator for more details and usage examples.

Parameters:
  • src (cvcuda.Tensor) – Input tensor.

  • stream (Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same shape, layout, and dtype as the input).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.autocontrast(src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Auto Contrast operation on a batch of variable-shaped images.

For floating-point inputs, only finite pixels define each channel range; NaN and infinity pixels are copied unchanged.

Parameters:
Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.autocontrast_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Auto Contrast operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Auto Contrast operator for more details and usage examples.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor (same shape, layout, and dtype as the input).

  • src (cvcuda.Tensor) – Input tensor.

  • stream (Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.autocontrast_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Auto Contrast operation on a batch of variable-shaped images.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.averageblur(src: cvcuda.Tensor, kernel_size: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], kernel_anchor: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex] = (-1, -1), border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the AverageBlur operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • kernel_size (Tuple[int, int]) – Specifies the size of the blur kernel.

  • kernel_anchor (Tuple[int, int]) – Kernel anchor, use (-1,-1) to indicate kernel center.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535; planar var-shape batches require numImages <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535; planar var-shape batches require numImages <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.averageblur(src: cvcuda.ImageBatchVarShape, max_kernel_size: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], kernel_size: cvcuda.Tensor, kernel_anchor: cvcuda.Tensor, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the AverageBlur operation with a variable shape tensors on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • max_kernel_size (Tuple[int, int]) – Specifies the maximum size of the blur kernel.

  • kernel_size (Tuple[int, int]) – Specifies the size of the blur kernel within the maximum kernel size.

  • kernel_anchor (Tuple[int, int]) – Kernel anchor, use (-1,-1) to indicate kernel center.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535; planar var-shape batches require numImages <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535; planar var-shape batches require numImages <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.averageblur_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, kernel_size: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], kernel_anchor: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex] = (-1, -1), border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the AverageBlur operation on the given cuda stream and writes the result into the ‘dst’ tensor.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • kernel_size (Tuple[int, int]) – Specifies the size of the blur kernel.

  • kernel_anchor (Tuple[int, int]) – Kernel anchor, use (-1,-1) to indicate kernel center.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535; planar var-shape batches require numImages <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535; planar var-shape batches require numImages <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.averageblur_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, max_kernel_size: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], kernel_size: cvcuda.Tensor, kernel_anchor: cvcuda.Tensor, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the AverageBlur operation with a variable shape tensors on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output containing one or more images.

  • src (cvcuda.ImageBatchVarShape) – Input containing one or more images.

  • max_kernel_size (Tuple[int, int]) – Specifies the maximum size of the blur kernel.

  • kernel_size (Tuple[int, int]) – Specifies the size of the blur kernel within the maximum kernel size.

  • kernel_anchor (Tuple[int, int]) – Kernel anchor, use (-1,-1) to indicate kernel center.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535; planar var-shape batches require numImages <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535; planar var-shape batches require numImages <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.bilateral_filter(src: cvcuda.Tensor, diameter: typing.SupportsInt | typing.SupportsIndex, sigma_color: typing.SupportsFloat | typing.SupportsIndex, sigma_space: typing.SupportsFloat | typing.SupportsIndex, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Bilateral Filter operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • diameter (int) – Bilateral filter diameter.

  • sigma_color (float) – Gaussian exponent for color difference.

  • sigma_space (float) – Gaussian exponent for position difference.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Destination must be same format and size as source

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.bilateral_filter(src: cvcuda.ImageBatchVarShape, diameter: cvcuda.Tensor, sigma_color: cvcuda.Tensor, sigma_space: cvcuda.Tensor, *, border: cvcuda.Border = <Border.CONSTANT: 0>, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Bilateral Filter operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input tensor containing one or more images.

  • diameter (cvcuda.Tensor) – Bilateral filter diameters in each image.

  • sigma_color (cvcuda.Tensor) – Gaussian exponents for color difference in each image.

  • sigma_space (cvcuda.Tensor) – Gaussian exponents for position difference in each image.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Destination must be same format and size as source

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.bilateral_filter_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, diameter: typing.SupportsInt | typing.SupportsIndex, sigma_color: typing.SupportsFloat | typing.SupportsIndex, sigma_space: typing.SupportsFloat | typing.SupportsIndex, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Bilateral Filter operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • diameter (int) – Bilateral filter diameter.

  • sigma_color (float) – Gaussian exponent for color difference.

  • sigma_space (float) – Gaussian exponent for position difference.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Destination must be same format and size as source

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.bilateral_filter_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, diameter: cvcuda.Tensor, sigma_color: cvcuda.Tensor, sigma_space: cvcuda.Tensor, *, border: cvcuda.Border = <Border.CONSTANT: 0>, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Bilateral Filter operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • diameter (cvcuda.Tensor) – Bilateral filter diameters in each image.

  • sigma_color (cvcuda.Tensor) – Gaussian exponents for color difference in each image.

  • sigma_space (cvcuda.Tensor) – Gaussian exponents for position difference in each image.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Destination must be same format and size as source

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.bndbox(src: cvcuda.Tensor, bboxes: cvcuda.BndBoxesI, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the BndBox operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • bboxes (cvcuda.BndBoxesI) – Bounding boxes in reference to the input tensor.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.bndbox_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, bboxes: cvcuda.BndBoxesI, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the BndBox operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • bboxes (cvcuda.BndBoxesI) – Bounding boxes in reference to the input tensor.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.boxblur(src: cvcuda.Tensor, bboxes: cvcuda.BlurBoxesI, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the BoxBlur operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • bboxes (cvcuda.BlurBoxesI) – Blur boxes in reference to the input tensor.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.boxblur_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, bboxes: cvcuda.BlurBoxesI, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the BoxBlur operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • bboxes (cvcuda.BlurBoxesI) – Blur boxes in reference to the input tensor.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.brightness_contrast(src: cvcuda.Tensor, brightness: cvcuda.Tensor | None = None, contrast: cvcuda.Tensor | None = None, brightness_shift: cvcuda.Tensor | None = None, contrast_center: cvcuda.Tensor | None = None, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Adjusts the brightness and contrast of the images according to the formula: out = brightness_shift + brightness * (contrast_center + contrast * (in - contrast_center)).

Parameters:
  • src (cvcuda.Tensor) – Input tensor.

  • brightness (cvcuda.Tensor, optional) – Optional tensor describing brightness multiplier. If specified, it must contain only 1 element. If not specified, the neutral 1. is used.

  • contrast (cvcuda.Tensor, optional) – Optional tensor describing contrast multiplier. If specified, it must contain only 1 element. If not specified, the neutral 1. is used.

  • brightness_shift (cvcuda.Tensor, optional) – Optional tensor describing brightness shift. If specified, it must contain only 1 element. If not specified, the neutral 0. is used.

  • contrast_center (cvcuda.Tensor, optional) – Optional tensor describing contrast center. If specified, it must contain only 1 element. If not specified, the middle of the assumed input type range is used. For floats it is 0.5, for unsigned integer types it is 2 ** (number_of_bits - 1), for signed integer types it is 2 ** (number_of_bits - 2).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

cvcuda.brightness_contrast(src: cvcuda.ImageBatchVarShape, brightness: cvcuda.Tensor | None = None, contrast: cvcuda.Tensor | None = None, brightness_shift: cvcuda.Tensor | None = None, contrast_center: cvcuda.Tensor | None = None, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Adjusts the brightness and contrast of the images according to the formula: out = brightness_shift + brightness * (contrast_center + contrast * (in - contrast_center)).

The brightness/brightness_shift/contrast/contrast_center tensors’ length must match the number of samples in the batch.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input tensor.

  • brightness (cvcuda.Tensor, optional) – Optional tensor describing brightness multiplier. If specified, it must contain 1 or N elements where N is the number of input images. If it contains a single element, the same value is used for all input images. If not specified, the neutral 1. is used.

  • contrast (cvcuda.Tensor, optional) – Optional tensor describing contrast multiplier. If specified, it must contain either 1 or N elements where N is the number of input images. If it contains a single element, the same value is used for all input images. If not specified, the neutral 1. is used.

  • brightness_shift (cvcuda.Tensor, optional) – Optional tensor describing brightness shift. If specified, it must contain either 1 or N elements where N is the number of input images. If it contains a single element, the same value is used for all input images. If not specified, the neutral 0. is used.

  • contrast_center (cvcuda.Tensor, optional) – Optional tensor describing contrast center. If specified, it must contain either 1 or N elements where N is the number of input images. If it contains a single element, the same value is used for all input images. If not specified, the middle of the assumed input type range is used. For floats it is 0.5, for unsigned integer types it is 2 ** (number_of_bits - 1), for signed integer types it is 2 ** (number_of_bits - 2).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

cvcuda.brightness_contrast(src: cvcuda.Tensor, brightness: SupportsFloat | SupportsIndex, contrast: SupportsFloat | SupportsIndex, brightness_shift: SupportsFloat | SupportsIndex, contrast_center: SupportsFloat | SupportsIndex, *, clamp: bool = False, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Adjusts brightness and contrast using one set of scalar parameters for every input image.

Parameters:
  • src (cvcuda.Tensor) – Input tensor.

  • brightness (float) – Brightness multiplier.

  • contrast (float) – Contrast multiplier.

  • brightness_shift (float) – Brightness shift.

  • contrast_center (float) – Contrast center.

  • clamp (bool, optional) – Clamp to the nominal image range: [0, 1] for floating-point output and [0, max] for integer output. Defaults to False.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

cvcuda.brightness_contrast(src: cvcuda.ImageBatchVarShape, brightness: SupportsFloat | SupportsIndex, contrast: SupportsFloat | SupportsIndex, brightness_shift: SupportsFloat | SupportsIndex, contrast_center: SupportsFloat | SupportsIndex, *, clamp: bool = False, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Adjusts brightness and contrast using one set of scalar parameters for every image in a batch.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch.

  • brightness (float) – Brightness multiplier.

  • contrast (float) – Contrast multiplier.

  • brightness_shift (float) – Brightness shift.

  • contrast_center (float) – Contrast center.

  • clamp (bool, optional) – Clamp to the nominal image range. Defaults to False.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

cvcuda.brightness_contrast_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, brightness: cvcuda.Tensor | None = None, contrast: cvcuda.Tensor | None = None, brightness_shift: cvcuda.Tensor | None = None, contrast_center: cvcuda.Tensor | None = None, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Adjusts the brightness and contrast of the images according to the formula: out = brightness_shift + brightness * (contrast_center + contrast * (in - contrast_center)).

Parameters:
  • src (cvcuda.Tensor) – Input tensor.

  • dst (cvcuda.Tensor) – Output tensor containing the result of the operation.

  • brightness (cvcuda.Tensor, optional) – Optional tensor describing brightness multiplier. If specified, it must contain only 1 element. If not specified, the neutral 1. is used.

  • contrast (cvcuda.Tensor, optional) – Optional tensor describing contrast multiplier. If specified, it must contain only 1 element. If not specified, the neutral 1. is used.

  • brightness_shift (cvcuda.Tensor, optional) – Optional tensor describing brightness shift. If specified, it must contain only 1 element. If not specified, the neutral 0. is used.

  • contrast_center (cvcuda.Tensor, optional) – Optional tensor describing contrast center. If specified, it must contain only 1 element. If not specified, the middle of the assumed input type range is used. For floats it is 0.5, for unsigned integer types it is 2 ** (number_of_bits - 1), for signed integer types it is 2 ** (number_of_bits - 2).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

cvcuda.brightness_contrast_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, brightness: cvcuda.Tensor | None = None, contrast: cvcuda.Tensor | None = None, brightness_shift: cvcuda.Tensor | None = None, contrast_center: cvcuda.Tensor | None = None, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Adjusts the brightness and contrast of the images according to the formula: out = brightness_shift + brightness * (contrast_center + contrast * (in - contrast_center)).

The brightness/brightness_shift/contrast/contrast_center tensors’ length must match the number of samples in the batch.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • brightness (cvcuda.ImageBatchVarShape, optional) – Optional tensor describing brightness multiplier. If specified, it must contain 1 or N elements where N is the number of input images. If it contains a single element, the same value is used for all input images. If not specified, the neutral 1. is used.

  • contrast (cvcuda.Tensor, optional) – Optional tensor describing contrast multiplier. If specified, it must contain either 1 or N elements where N is the number of input images. If it contains a single element, the same value is used for all input images. If not specified, the neutral 1. is used.

  • brightness_shift (cvcuda.Tensor, optional) – Optional tensor describing brightness shift. If specified, it must contain either 1 or N elements where N is the number of input images. If it contains a single element, the same value is used for all input images. If not specified, the neutral 0. is used.

  • contrast_center (cvcuda.Tensor, optional) – Optional tensor describing contrast center. If specified, it must contain either 1 or N elements where N is the number of input images. If it contains a single element, the same value is used for all input images. If not specified, the middle of the assumed input type range is used. For floats it is 0.5, for unsigned integer types it is 2 ** (number_of_bits - 1), for signed integer types it is 2 ** (number_of_bits - 2).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

cvcuda.brightness_contrast_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, brightness: SupportsFloat | SupportsIndex, contrast: SupportsFloat | SupportsIndex, brightness_shift: SupportsFloat | SupportsIndex, contrast_center: SupportsFloat | SupportsIndex, *, clamp: bool = False, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Adjusts brightness and contrast into dst using scalar parameters.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor.

  • src (cvcuda.Tensor) – Input tensor.

  • brightness (float) – Brightness multiplier.

  • contrast (float) – Contrast multiplier.

  • brightness_shift (float) – Brightness shift.

  • contrast_center (float) – Contrast center.

  • clamp (bool, optional) – Clamp to the nominal image range. Defaults to False.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

cvcuda.brightness_contrast_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, brightness: SupportsFloat | SupportsIndex, contrast: SupportsFloat | SupportsIndex, brightness_shift: SupportsFloat | SupportsIndex, contrast_center: SupportsFloat | SupportsIndex, *, clamp: bool = False, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Adjusts brightness and contrast into dst using scalar parameters.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch.

  • src (cvcuda.ImageBatchVarShape) – Input image batch.

  • brightness (float) – Brightness multiplier.

  • contrast (float) – Contrast multiplier.

  • brightness_shift (float) – Brightness shift.

  • contrast_center (float) – Contrast center.

  • clamp (bool, optional) – Clamp to the nominal image range. Defaults to False.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

cvcuda.center_crop(src: cvcuda.Tensor, crop_size: tuple[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex], *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Center Crop operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • crop_size (Tuple[int, int]) – Crop size in width and height.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

ROI must be smaller than output tensor.

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.center_crop_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, crop_size: tuple[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex], *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Center Crop operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • crop_size (Tuple[int, int]) – Crop size in width and height.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

ROI must be smaller than output tensor.

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.channelreorder(src: cvcuda.Tensor, order: collections.abc.Sequence[SupportsInt | SupportsIndex], *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Reorders the channels of a tensor using a host sequence.

Each output channel c receives input channel order[c]. Negative entries write zero; repeated non-negative entries are allowed. The output has the same shape, layout, and data type as the input.

Parameters:
  • src (cvcuda.Tensor) – Input tensor in HWC, NHWC, CHW, or NCHW layout.

  • order (Sequence[int]) – One source-channel index per output channel.

  • stream (cvcuda.Stream, optional) – CUDA stream on which to submit the operation.

Returns:

Reordered output tensor.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaChannelReorderSubmit``:

Input/Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input and output must have identical shape, layout, data type, and channel count.

Applies to ``cvcudaChannelReorderVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Layout family
 Data Type     | Yes
 Number        | Yes
 Channels      | No

Input and output image formats must have the same layout family: interleaved formats have one plane, and planar formats have one plane per channel. Channels can be swizzled (i.e. RGBA8, BGRA8, RGBA8p, BGRA8p, etc).The number of samples in the input and output ImageBatch must be the sameThe orders_in tensor must have 2 dimensions. First dimension correspond to the number of images being, and the second the number of channels.

cvcuda.channelreorder(src: cvcuda.ImageBatchVarShape, order: cvcuda.Tensor, *, format: cvcuda.Format | None = None, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Channel Reorder operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input tensor containing one or more images.

  • order (cvcuda.Tensor) – 2D tensor with layout “NC” which specifies, for each output image sample in the batch, the index of the input channel to copy to the output channel.

  • format (cvcuda.Format) – Format of the destination image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaChannelReorderSubmit``:

Input/Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input and output must have identical shape, layout, data type, and channel count.

Applies to ``cvcudaChannelReorderVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Layout family
 Data Type     | Yes
 Number        | Yes
 Channels      | No

Input and output image formats must have the same layout family: interleaved formats have one plane, and planar formats have one plane per channel. Channels can be swizzled (i.e. RGBA8, BGRA8, RGBA8p, BGRA8p, etc).The number of samples in the input and output ImageBatch must be the sameThe orders_in tensor must have 2 dimensions. First dimension correspond to the number of images being, and the second the number of channels.

cvcuda.channelreorder_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, order: collections.abc.Sequence[SupportsInt | SupportsIndex], *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Reorders tensor channels into a caller-provided output tensor.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor with metadata identical to src.

  • src (cvcuda.Tensor) – Input tensor.

  • order (Sequence[int]) – One source-channel index per output channel; negatives write zero.

  • stream (cvcuda.Stream, optional) – CUDA stream on which to submit the operation.

Returns:

dst.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaChannelReorderSubmit``:

Input/Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input and output must have identical shape, layout, data type, and channel count.

Applies to ``cvcudaChannelReorderVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Layout family
 Data Type     | Yes
 Number        | Yes
 Channels      | No

Input and output image formats must have the same layout family: interleaved formats have one plane, and planar formats have one plane per channel. Channels can be swizzled (i.e. RGBA8, BGRA8, RGBA8p, BGRA8p, etc).The number of samples in the input and output ImageBatch must be the sameThe orders_in tensor must have 2 dimensions. First dimension correspond to the number of images being, and the second the number of channels.

cvcuda.channelreorder_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, orders: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Channel Reorder operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output tensor to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input tensor containing one or more images.

  • order (cvcuda.Tensor) – 2D tensor with layout “NC” which specifies, for each output image sample in the batch, the index of the input channel to copy to the output channel.

  • format (cvcuda.Format) – Format of the destination image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaChannelReorderSubmit``:

Input/Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input and output must have identical shape, layout, data type, and channel count.

Applies to ``cvcudaChannelReorderVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Layout family
 Data Type     | Yes
 Number        | Yes
 Channels      | No

Input and output image formats must have the same layout family: interleaved formats have one plane, and planar formats have one plane per channel. Channels can be swizzled (i.e. RGBA8, BGRA8, RGBA8p, BGRA8p, etc).The number of samples in the input and output ImageBatch must be the sameThe orders_in tensor must have 2 dimensions. First dimension correspond to the number of images being, and the second the number of channels.

cvcuda.clahe(src: cvcuda.Tensor, clip_limit: SupportsFloat | SupportsIndex = 40.0, tile_grid_size: tuple[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex] = (8, 8), *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Contrast Limited Adaptive Histogram Equalization (CLAHE) operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • clip_limit (float, optional) – The clip limit for the CLAHE operation (default: 40.0).

  • tile_grid_size (Tuple[int, int], optional) – The tile grid size for the CLAHE operation (default: (8, 8)).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor containing the result of the CLAHE operation.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.clahe(src: cvcuda.ImageBatchVarShape, clip_limit: SupportsFloat | SupportsIndex = 40.0, tile_grid_size: tuple[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex] = (8, 8), *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Contrast Limited Adaptive Histogram Equalization (CLAHE) operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • clip_limit (float, optional) – The clip limit for the CLAHE operation (default: 40.0).

  • tile_grid_size (Tuple[int, int], optional) – The tile grid size for the CLAHE operation (default: (8, 8)).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch containing the result of the CLAHE operation.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.clahe_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, clip_limit: SupportsFloat | SupportsIndex = 40.0, tile_grid_size: tuple[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex] = (8, 8), *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Contrast Limited Adaptive Histogram Equalization (CLAHE) operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor containing the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • clip_limit (float, optional) – The clip limit for the CLAHE operation (default: 40.0).

  • tile_grid_size (Tuple[int, int], optional) – The tile grid size for the CLAHE operation (default: (8, 8)).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor dst.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.clahe_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, clip_limit: SupportsFloat | SupportsIndex = 40.0, tile_grid_size: tuple[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex] = (8, 8), *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Contrast Limited Adaptive Histogram Equalization (CLAHE) operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • clip_limit (float, optional) – The clip limit for the CLAHE operation (default: 40.0).

  • tile_grid_size (Tuple[int, int], optional) – The tile grid size for the CLAHE operation (default: (8, 8)).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch dst.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.color_twist(src: cvcuda.Tensor, twist: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Transforms an image by applying affine transformation to the channels extent.

Parameters:
  • src (cvcuda.Tensor) – Tensor corresponding to the input image. It must have either 3 or 4 channels. In the case of 4 channels, the alpha channel is unmodified.

  • twist (cvcuda.Tensor) – A 2D tensor describing a 3x4 affine transformation matrix.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Twist matrix: Data Layout: [NVCV_TENSOR_NHW, NVCV_TENSOR_HW]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

Yes

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

Input/Twist matrix type dependency

Input type

Accepted twi

uint8

float32

int16, uint16

float32

int32, uint32

float64

float32

float32

cvcuda.color_twist(src: cvcuda.ImageBatchVarShape, twist: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Transforms a batch of images by applying affine transformation to the channels extent.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch. Each image must have either 3 or 4 channels. In the case of 4 channels the alpha channel is unmodified.

  • twist (cvcuda.Tensor) – A 3x4 2D tensor describing an affine transformation matrix or a Nx3x4 3D tensor specifying separate transformations for each sample in the input image batch.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Twist matrix: Data Layout: [NVCV_TENSOR_NHW, NVCV_TENSOR_HW]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

Yes

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

Input/Twist matrix type dependency

Input type

Accepted twi

uint8

float32

int16, uint16

float32

int32, uint32

float64

float32

float32

cvcuda.color_twist_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, twist: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Transforms an image by applying affine transformation to the channels extent.

Parameters:
  • dst (cvcuda.Tensor) – Tensor corresponding to the output image. Must match the shape of the input image.

  • src (cvcuda.Tensor) – Tensor corresponding to the input image. It must have either 3 or 4 channels. In the case of 4 channels, the alpha channel is unmodified.

  • twist (cvcuda.Tensor) – A 2D tensor describing a 3x4 affine transformation matrix.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Twist matrix: Data Layout: [NVCV_TENSOR_NHW, NVCV_TENSOR_HW]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

Yes

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

Input/Twist matrix type dependency

Input type

Accepted twi

uint8

float32

int16, uint16

float32

int32, uint32

float64

float32

float32

cvcuda.color_twist_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, twist: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Transforms a batch of images by applying affine transformation to the channels extent.

The twist should be a 2D tensor describing 3x4 affine transformation matrix or a 3D tensor specifying separate transformations for each sample in the input image batch.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch. The shapes of the output images must match the input image batch.

  • src (cvcuda.ImageBatchVarShape) – Input image batch. Each image must have either 3 or 4 channels. In the case of 4 channels the alpha channel is unmodified.

  • twist (cvcuda.Tensor) – A 3x4 2D tensor describing an affine transformation matrix or an Nx3x4 3D tensor specifying separate transformations for each sample in the input image batch.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Twist matrix: Data Layout: [NVCV_TENSOR_NHW, NVCV_TENSOR_HW]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

Yes

Channels

Yes

Width

Yes

Height

Yes

Samples

Yes

Input/Twist matrix type dependency

Input type

Accepted twi

uint8

float32

int16, uint16

float32

int32, uint32

float64

float32

float32

cvcuda.composite(foreground: cvcuda.Tensor, background: cvcuda.Tensor, fgmask: cvcuda.Tensor, outchannels: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Composite operation on the given cuda stream.

Parameters:
  • foreground (cvcuda.Tensor) – Input tensor containing one or more foreground images. Each image is BGR (3-channel) 8-bit.

  • background (cvcuda.Tensor) – Input tensor containing one or more background images. Each image is BGR (3-channel) 8-bit.

  • fgmask (cvcuda.Tensor) – Input foreground mask tensor. Each mask image is grayscale 8-bit

  • outchannels (int) – Specifies 3 channels for RGB/BGR and 4 channels for RGBA/BGRA.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3] Note: Foreground and background are 3-channel images; fgMask is a single-channel 8-bit mask.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | No
 Width         | Yes
 Height        | Yes
cvcuda.composite(foreground: cvcuda.ImageBatchVarShape, background: cvcuda.ImageBatchVarShape, fgmask: cvcuda.ImageBatchVarShape, outchannels: SupportsInt | SupportsIndex = 3, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Composite operation on the given cuda stream.

Parameters:
  • foreground (cvcuda.ImageBatchVarShape) – Input tensor containing one or more foreground images. Each image is BGR (3-channel) 8-bit.

  • background (cvcuda.ImageBatchVarShape) – Input tensor containing one or more background images. Each image is BGR (3-channel) 8-bit.

  • fgmask (cvcuda.ImageBatchVarShape) – Input foreground mask image batch. Each mask image is grayscale 8-bit.

  • outchannels (int) – Specifies 3 channels for RGB/BGR and 4 channels for RGBA/BGRA.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3] Note: Foreground and background are 3-channel images; fgMask is a single-channel 8-bit mask.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | No
 Width         | Yes
 Height        | Yes
cvcuda.composite_into(dst: cvcuda.Tensor, foreground: cvcuda.Tensor, background: cvcuda.Tensor, fgmask: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Composite operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • foreground (cvcuda.Tensor) – Input tensor containing one or more foreground images. Each image is BGR (3-channel) 8-bit.

  • background (cvcuda.Tensor) – Input tensor containing one or more background images. Each image is BGR (3-channel) 8-bit.

  • fgmask (cvcuda.Tensor) – Input foreground mask tensor. Each mask image is grayscale 8-bit.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3] Note: Foreground and background are 3-channel images; fgMask is a single-channel 8-bit mask.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | No
 Width         | Yes
 Height        | Yes
cvcuda.composite_into(dst: cvcuda.ImageBatchVarShape, foreground: cvcuda.ImageBatchVarShape, background: cvcuda.ImageBatchVarShape, fgmask: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Composite operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3] Note: Foreground and background are 3-channel images; fgMask is a single-channel 8-bit mask.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | No
 Width         | Yes
 Height        | Yes
cvcuda.conv2d(src: cvcuda.ImageBatchVarShape, kernel: cvcuda.ImageBatchVarShape, kernel_anchor: cvcuda.Tensor, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Convolve 2D operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • kernel (cvcuda.Tensor) – Convolution kernels (one for each batch image) to be used. Each image width and height correspond to the kernel width and height. (must be float)

  • kernel_anchor (cvcuda.Tensor) – 1D Tensor with the anchor of each kernel (one for each batch image). The anchor (x, y) indicates the relative position of a filtered point within the kernel. (-1, -1) means that the anchor is at the kernel center.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.conv2d_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, kernel: cvcuda.ImageBatchVarShape, kernel_anchor: cvcuda.Tensor, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Convolve 2D operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • kernel (cvcuda.Tensor) – Convolution kernels (one for each batch image) to be used. Each image width and height correspond to the kernel width and height. (must be float)

  • kernel_anchor (cvcuda.Tensor) – 1D Tensor with the anchor of each kernel (one for each batch image). The anchor (x, y) indicates the relative position of a filtered point within the kernel. (-1, -1) means that the anchor is at the kernel center.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.convertto(src: cvcuda.Tensor, dtype: cvcuda.Type, scale: typing.SupportsFloat | typing.SupportsIndex = 1, offset: typing.SupportsFloat | typing.SupportsIndex = 0, *, round: cvcuda.Round = <Round.NEAREST: 0>, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Convert To operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • scale (float, optional) – Scalar for output data.

  • offset (float, optional) – Offset for the data.

  • round (cvcuda.Round, optional) – Rounding mode used for integer outputs. Defaults to cvcuda.Round.NEAREST (round to nearest); use cvcuda.Round.TRUNCATE to truncate toward zero. Has no effect for floating-point outputs.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1-4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1-4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | No
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.convertto_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, scale: typing.SupportsFloat | typing.SupportsIndex = 1, offset: typing.SupportsFloat | typing.SupportsIndex = 0, *, round: cvcuda.Round = <Round.NEAREST: 0>, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Convert To operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • scale (float, optional) – Scalar for output data.

  • offset (float, optional) – Offset for the data.

  • round (cvcuda.Round, optional) – Rounding mode used for integer outputs. Defaults to cvcuda.Round.NEAREST (round to nearest); use cvcuda.Round.TRUNCATE to truncate toward zero. Has no effect for floating-point outputs.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1-4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1-4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | No
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.copymakeborder(src: cvcuda.Tensor, border_mode: cvcuda.Border = <Border.CONSTANT: 0>, border_value: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = [], *, top: typing.SupportsInt | typing.SupportsIndex, bottom: typing.SupportsInt | typing.SupportsIndex, left: typing.SupportsInt | typing.SupportsIndex, right: typing.SupportsInt | typing.SupportsIndex, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Copy Make Border operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • border_mode (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • border_value (List[float], optional) – Border value to be used for constant border mode, each element of the array corresponds to the image color channel must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • top (int) – The top pixel position.

  • left (int) – The left pixel position.

  • bottom (int) – The bottom pixel position.

  • right (int) – The right pixel position.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Note: 2 channels can only support 8bit Unsigned data type and interleaved layout.

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No

Top/left Tensors

Must be kNHWC where N=H=C=1 with W = N (N in reference to input and output tensors).
Data Type must be 32bit Signed.
cvcuda.copymakeborder(src: cvcuda.ImageBatchVarShape, border_mode: cvcuda.Border = <Border.CONSTANT: 0>, border_value: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = [], *, top: cvcuda.Tensor, left: cvcuda.Tensor, out_heights: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], out_widths: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Copy Make Border operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • border_mode (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • border_value (List[float], optional) – Border value to be used for constant border mode, each element of the array corresponds to the image color channel must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • top (cvcuda.Tensor) – The top pixel position for each image.

  • left (cvcuda.Tensor) – The left pixel position for each image.

  • out_heights (cvcuda.Tensor) – The heights of each output image.

  • out_widths (cvcuda.Tensor) – The widths of each output image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Note: 2 channels can only support 8bit Unsigned data type and interleaved layout.

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No

Top/left Tensors

Must be kNHWC where N=H=C=1 with W = N (N in reference to input and output tensors).
Data Type must be 32bit Signed.
cvcuda.copymakeborder_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, border_mode: cvcuda.Border = <Border.CONSTANT: 0>, border_value: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = [], *, top: typing.SupportsInt | typing.SupportsIndex, left: typing.SupportsInt | typing.SupportsIndex, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Copy Make Border operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • border_mode (cvcuda.Border) – Border mode to be used when accessing elements outside input image.

  • border_value (List[float], optional) – Border value to be used for constant border mode, each element of the array corresponds to the image color channel must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • top (int) – The top pixel position.

  • left (int) – The left pixel position.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Note: 2 channels can only support 8bit Unsigned data type and interleaved layout.

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No

Top/left Tensors

Must be kNHWC where N=H=C=1 with W = N (N in reference to input and output tensors).
Data Type must be 32bit Signed.
cvcuda.copymakeborder_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, border_mode: cvcuda.Border = <Border.CONSTANT: 0>, border_value: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = [], *, top: cvcuda.Tensor, left: cvcuda.Tensor, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Copy Make Border operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • border_mode (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • border_value (List[float], optional) – Border value to be used for constant border mode, each element of the array corresponds to the image color channel must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • top (cvcuda.Tensor) – The top pixel position for each image.

  • left (cvcuda.Tensor) – The left pixel position for each image.

  • out_heights (cvcuda.Tensor) – The heights of each output image.

  • out_widths (cvcuda.Tensor) – The widths of each output image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Note: 2 channels can only support 8bit Unsigned data type and interleaved layout.

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No

Top/left Tensors

Must be kNHWC where N=H=C=1 with W = N (N in reference to input and output tensors).
Data Type must be 32bit Signed.
cvcuda.copymakeborderstack(src: cvcuda.ImageBatchVarShape, border_mode: cvcuda.Border = <Border.CONSTANT: 0>, border_value: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = [], *, top: cvcuda.Tensor, left: cvcuda.Tensor, out_height: typing.SupportsInt | typing.SupportsIndex, out_width: typing.SupportsInt | typing.SupportsIndex, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Copy Make Border Stack operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • border_mode (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • border_value (List[float], optional) – Border value to be used for constant border mode, each element of the array corresponds to the image color channel must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • top (cvcuda.Tensor) – The top pixel position for each image.

  • left (cvcuda.Tensor) – The left pixel position for each image.

  • out_height (int) – The height of the output.

  • out_width (int) – The width of the output.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output images.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Note: 2 channels can only support 8bit Unsigned data type and interleaved layout.

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No

Top/left Tensors

Must be kNHWC where N=H=C=1 with W = N (N in reference to input and output tensors).
Data Type must be 32bit Signed.
cvcuda.copymakeborderstack_into(dst: cvcuda.Tensor, src: cvcuda.ImageBatchVarShape, border_mode: cvcuda.Border = <Border.CONSTANT: 0>, border_value: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = [], *, top: cvcuda.Tensor, left: cvcuda.Tensor, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Copy Make Border Stack operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • border_mode (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • border_value (List[float], optional) – Border value to be used for constant border mode, each element of the array corresponds to the image color channel must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • top (cvcuda.Tensor) – The top pixel position for each image.

  • left (cvcuda.Tensor) – The left pixel position for each image.

  • out_height (int) – The height of the output.

  • out_width (int) – The width of the output.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Note: 2 channels can only support 8bit Unsigned data type and interleaved layout.

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No

Top/left Tensors

Must be kNHWC where N=H=C=1 with W = N (N in reference to input and output tensors).
Data Type must be 32bit Signed.
cvcuda.crop_flip_normalize_reformat(src: cvcuda.ImageBatchVarShape, out_shape: tuple, out_dtype: cvcuda.Type, out_layout: cvcuda.TensorLayout, rect: cvcuda.Tensor, flip_code: cvcuda.Tensor, base: cvcuda.Tensor, scale: cvcuda.Tensor, globalscale: typing.SupportsFloat | typing.SupportsIndex = 1.0, globalshift: typing.SupportsFloat | typing.SupportsIndex = 0.0, epsilon: typing.SupportsFloat | typing.SupportsIndex = 0.0, flags: typing.SupportsInt | typing.SupportsIndex | None = None, border: cvcuda.Border = <Border.CONSTANT: 0>, bvalue: typing.SupportsFloat | typing.SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the CropFlipNormalizeReformat operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • out_shape (tuple) – The shape of the output.

  • out_dtype (numpy.dtype) – The data type of the output.

  • out_layout (cvcuda.TensorLayout) – The layout of the output.

  • rect (cvcuda.Tensor) – The crop rectangle tensor which has shape of [batch_size, 1, 1, 4] in reference to the input tensor. The crop value of [crop_x, crop_y, crop_width, crop_height] stored in the final dimension of the crop tensor, provided per image.

  • flip_code (cvcuda.Tensor) – A tensor flag to specify how to flip the array; 0 means flipping around the x-axis, 1 means flipping around the y-axis, -1 means flipping around both axes, and any other value will result in no flip, provided per image.

  • base (cvcuda.Tensor) – Tensor providing base values for normalization.

  • scale (cvcuda.Tensor) – Tensor providing scale values for normalization.

  • globalscale (float, optional) – Additional scale value to be used in addition to scale

  • globalshift (float, optional) – Additional bias value to be used in addition to base.

  • epsilon (float, optional) – Epsilon to use when CVCUDA_NORMALIZE_SCALE_IS_STDDEV flag is set as a regularizing term to be added to variance.

  • flags (int, optional) – Algorithm flags, use CVCUDA_NORMALIZE_SCALE_IS_STDDEV if scale passed as argument is standard deviation instead or 0 if it is scaling.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • bvalue (float, optional) – Border value to be used for constant border mode cvcuda.Border.CONSTANT.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, KCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kNCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes/No
 Data Type     | Yes/No
 Number        | Yes
 Channels      | Yes
 Width         | Yes/No
 Height        | Yes/No
cvcuda.crop_flip_normalize_reformat_into(dst: cvcuda.Tensor, src: cvcuda.ImageBatchVarShape, rect: cvcuda.Tensor, flip_code: cvcuda.Tensor, base: cvcuda.Tensor, scale: cvcuda.Tensor, globalscale: typing.SupportsFloat | typing.SupportsIndex = 1.0, globalshift: typing.SupportsFloat | typing.SupportsIndex = 0.0, epsilon: typing.SupportsFloat | typing.SupportsIndex = 0.0, flags: typing.SupportsInt | typing.SupportsIndex | None = None, border: cvcuda.Border = <Border.CONSTANT: 0>, bvalue: typing.SupportsFloat | typing.SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the CropFlipNormalizeReformat operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • rect (cvcuda.Tensor) – The crop rectangle tensor which has shape of [batch_size, 1, 1, 4] in reference to the input tensor. The crop value of [crop_x, crop_y, crop_width, crop_height] stored in the final dimension of the crop tensor, provided per image.

  • flip_code (cvcuda.Tensor) – A tensor flag to specify how to flip the array; 0 means flipping around the x-axis, 1 means flipping around the y-axis, -1 means flipping around both axes, and any other value will result in no flip, provided per image.

  • base (cvcuda.Tensor) – Tensor providing base values for normalization.

  • scale (cvcuda.Tensor) – Tensor providing scale values for normalization.

  • globalscale (float, optional) – Additional scale value to be used in addition to scale

  • globalshift (float, optional) – Additional bias value to be used in addition to base.

  • epsilon (float, optional) – Epsilon to use when CVCUDA_NORMALIZE_SCALE_IS_STDDEV flag is set as a regularizing term to be added to variance.

  • flags (int, optional) – Algorithm flags, use CVCUDA_NORMALIZE_SCALE_IS_STDDEV if scale passed as argument is standard deviation instead or 0 if it is scaling.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • bvalue (float, optional) – Border value to be used for constant border mode cvcuda.Border.CONSTANT.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, KCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kNCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes/No
 Data Type     | Yes/No
 Number        | Yes
 Channels      | Yes
 Width         | Yes/No
 Height        | Yes/No
cvcuda.customcrop(src: cvcuda.Tensor, rect: cvcuda.RectI, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Custom Crop operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • rect (cvcuda.RectI) – Crop rectangle in reference to the input tensor.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

ROI must be smaller than output tensor.

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.customcrop_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, rect: cvcuda.RectI, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Custom Crop operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • rect (cvcuda.RectI) – Crop rectangle in reference to the input tensor.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

ROI must be smaller than output tensor.

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.cvtcolor(src: cvcuda.Tensor, code: cvcuda.ColorConversion, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the CVT Color operation on the given cuda stream.

Parameters:
Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for kNCHW/kCHW planar tensors; var-shape planar images require RGB8p or RGBA8p compatible conversion codes. Data Type: [U8, S8, U16, S16, S32, F16, F32, F64] depending on conversion code.

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for kNCHW/kCHW planar tensors; var-shape planar images require RGB8p or RGBA8p compatible conversion codes. Data Type: Same base type as input, depending on conversion code.

Notes: Planar kNCHW/kCHW support excludes subsampled YUV420 and packed YUV422 conversion codes.

Supported backends:

Backend       | Supported
------------- | ---------
CUDA          | Yes
CPU           | No

Performance characteristics:

Input         | Supported
------------- | ---------
Data Layout   | Yes
Data Type     | Yes
Channels      | Yes
cvcuda.cvtcolor(src: cvcuda.ImageBatchVarShape, code: cvcuda.ColorConversion, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the CVT Color operation on the given cuda stream.

Parameters:
Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for kNCHW/kCHW planar tensors; var-shape planar images require RGB8p or RGBA8p compatible conversion codes. Data Type: [U8, S8, U16, S16, S32, F16, F32, F64] depending on conversion code.

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for kNCHW/kCHW planar tensors; var-shape planar images require RGB8p or RGBA8p compatible conversion codes. Data Type: Same base type as input, depending on conversion code.

Notes: Planar kNCHW/kCHW support excludes subsampled YUV420 and packed YUV422 conversion codes.

Supported backends:

Backend       | Supported
------------- | ---------
CUDA          | Yes
CPU           | No

Performance characteristics:

Input         | Supported
------------- | ---------
Data Layout   | Yes
Data Type     | Yes
Channels      | Yes
cvcuda.cvtcolor_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, code: cvcuda.ColorConversion, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the CVT Color operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • code (cvcuda.ColorConversion) – Code describing the desired color conversion.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for kNCHW/kCHW planar tensors; var-shape planar images require RGB8p or RGBA8p compatible conversion codes. Data Type: [U8, S8, U16, S16, S32, F16, F32, F64] depending on conversion code.

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for kNCHW/kCHW planar tensors; var-shape planar images require RGB8p or RGBA8p compatible conversion codes. Data Type: Same base type as input, depending on conversion code.

Notes: Planar kNCHW/kCHW support excludes subsampled YUV420 and packed YUV422 conversion codes.

Supported backends:

Backend       | Supported
------------- | ---------
CUDA          | Yes
CPU           | No

Performance characteristics:

Input         | Supported
------------- | ---------
Data Layout   | Yes
Data Type     | Yes
Channels      | Yes
cvcuda.cvtcolor_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, code: cvcuda.ColorConversion, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the CVT Color operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for kNCHW/kCHW planar tensors; var-shape planar images require RGB8p or RGBA8p compatible conversion codes. Data Type: [U8, S8, U16, S16, S32, F16, F32, F64] depending on conversion code.

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for kNCHW/kCHW planar tensors; var-shape planar images require RGB8p or RGBA8p compatible conversion codes. Data Type: Same base type as input, depending on conversion code.

Notes: Planar kNCHW/kCHW support excludes subsampled YUV420 and packed YUV422 conversion codes.

Supported backends:

Backend       | Supported
------------- | ---------
CUDA          | Yes
CPU           | No

Performance characteristics:

Input         | Supported
------------- | ---------
Data Layout   | Yes
Data Type     | Yes
Channels      | Yes
cvcuda.erase(src: cvcuda.Tensor, i: SupportsInt | SupportsIndex, j: SupportsInt | SupportsIndex, h: SupportsInt | SupportsIndex, w: SupportsInt | SupportsIndex, v: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Erases one rectangular region with torchvision-compatible slice and broadcast semantics.

The logical operation is out = src.clone(); out[..., i:i+h, j:j+w] = v. For HWC/NHWC inputs, v is still interpreted in logical planar order. The value dtype must match src or be float32.

Parameters:
  • src (cvcuda.Tensor) – Input image tensor.

  • i (int) – Vertical slice start.

  • j (int) – Horizontal slice start.

  • h (int) – Vertical slice extent.

  • w (int) – Horizontal slice extent.

  • v (cvcuda.Tensor) – Broadcastable value tensor.

  • stream (cvcuda.Stream, optional) – CUDA stream on which to submit the operation.

Returns:

A new erased tensor with the same metadata as src.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaEraseSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

In-place execution is selected by passing the same handle for in and out. There is no separate in-place parameter. When in and out are different handles, the operation copies in to out before applying the erase areas. Passing different handles that partially alias the same storage is not a supported aliasing mode.

anchor Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_2S32.

erasing Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_3S32.

imgIdx Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_S32.

values Tensor

Must be 'N' (dim = 1) with W = number of erasing area * 4.
Data Type must be 32bit Float.
DataType must be TYPE_F32.

Applies to ``cvcudaEraseRegionSubmit``:

Input / Output: Container: Tensor only Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

64bit Unsigned

Yes

64bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Values: Rank must not exceed four. Dimensions are right-aligned against the logical (N, C, H, W) shape, with N = 1 for unbatched inputs, and each must equal the corresponding selected-region dimension or be one for broadcasting. The dtype must match the input dtype or be 32-bit float. Float-to-integer conversion matches CUDA PyTorch assignment semantics, including for non-finite and out-of-range values.

cvcuda.erase(src: cvcuda.Tensor, anchor: cvcuda.Tensor, erasing: cvcuda.Tensor, values: cvcuda.Tensor, imgIdx: cvcuda.Tensor, *, random: bool = False, seed: SupportsInt | SupportsIndex = 0, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Erase operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • anchor (cvcuda.Tensor) – anchor an array of size num_erasing_area that gives the x coordinate and y coordinate of the top left point in the eraseing areas.

  • erasing (cvcuda.Tensor) – Eraisng an array of size num_erasing_area that gives the widths of the eraseing areas, the heights of the eraseing areas and integers in range 0-15, each of whose bits indicates whether or not the corresponding channel need to be erased.

  • values (cvcuda.Tensor) – An array of size num_erasing_area*4 that gives the filling value for each erase area.

  • imgIdx (cvcuda.Tensor) – An array of size num_erasing_area that maps a erase area idx to img idx in the batch.

  • random (int, optional) – 8-bit integer value for random op.

  • seed (int, optional) – seed random seed for random filling erase area.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaEraseSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

In-place execution is selected by passing the same handle for in and out. There is no separate in-place parameter. When in and out are different handles, the operation copies in to out before applying the erase areas. Passing different handles that partially alias the same storage is not a supported aliasing mode.

anchor Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_2S32.

erasing Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_3S32.

imgIdx Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_S32.

values Tensor

Must be 'N' (dim = 1) with W = number of erasing area * 4.
Data Type must be 32bit Float.
DataType must be TYPE_F32.

Applies to ``cvcudaEraseRegionSubmit``:

Input / Output: Container: Tensor only Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

64bit Unsigned

Yes

64bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Values: Rank must not exceed four. Dimensions are right-aligned against the logical (N, C, H, W) shape, with N = 1 for unbatched inputs, and each must equal the corresponding selected-region dimension or be one for broadcasting. The dtype must match the input dtype or be 32-bit float. Float-to-integer conversion matches CUDA PyTorch assignment semantics, including for non-finite and out-of-range values.

cvcuda.erase(src: cvcuda.ImageBatchVarShape, anchor: cvcuda.Tensor, erasing: cvcuda.Tensor, values: cvcuda.Tensor, imgIdx: cvcuda.Tensor, *, random: bool = False, seed: SupportsInt | SupportsIndex = 0, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Erase operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • anchor (cvcuda.Tensor) – anchor an array of size num_erasing_area that gives the x coordinate and y coordinate of the top left point in the eraseing areas.

  • erasing (cvcuda.Tensor) – Eraisng an array of size num_erasing_area that gives the widths of the eraseing areas, the heights of the eraseing areas and integers in range 0-15, each of whose bits indicates whether or not the corresponding channel need to be erased.

  • values (cvcuda.Tensor) – An array of size num_erasing_area*4 that gives the filling value for each erase area.

  • imgIdx (cvcuda.Tensor) – An array of size num_erasing_area that maps a erase area idx to img idx in the batch.

  • random (int, optional) – 8-bit integer value for random op.

  • seed (int, optional) – seed random seed for random filling erase area.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaEraseSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

In-place execution is selected by passing the same handle for in and out. There is no separate in-place parameter. When in and out are different handles, the operation copies in to out before applying the erase areas. Passing different handles that partially alias the same storage is not a supported aliasing mode.

anchor Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_2S32.

erasing Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_3S32.

imgIdx Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_S32.

values Tensor

Must be 'N' (dim = 1) with W = number of erasing area * 4.
Data Type must be 32bit Float.
DataType must be TYPE_F32.

Applies to ``cvcudaEraseRegionSubmit``:

Input / Output: Container: Tensor only Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

64bit Unsigned

Yes

64bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Values: Rank must not exceed four. Dimensions are right-aligned against the logical (N, C, H, W) shape, with N = 1 for unbatched inputs, and each must equal the corresponding selected-region dimension or be one for broadcasting. The dtype must match the input dtype or be 32-bit float. Float-to-integer conversion matches CUDA PyTorch assignment semantics, including for non-finite and out-of-range values.

cvcuda.erase_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, i: SupportsInt | SupportsIndex, j: SupportsInt | SupportsIndex, h: SupportsInt | SupportsIndex, w: SupportsInt | SupportsIndex, v: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Writes the torchvision-compatible single-region erase result into dst.

Passing the same tensor as src and dst performs the operation in place.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor with the same shape, layout, and dtype as src.

  • src (cvcuda.Tensor) – Input image tensor.

  • i (int) – Vertical slice start.

  • j (int) – Horizontal slice start.

  • h (int) – Vertical slice extent.

  • w (int) – Horizontal slice extent.

  • v (cvcuda.Tensor) – Broadcastable value tensor.

  • stream (cvcuda.Stream, optional) – CUDA stream on which to submit the operation.

Returns:

dst.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaEraseSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

In-place execution is selected by passing the same handle for in and out. There is no separate in-place parameter. When in and out are different handles, the operation copies in to out before applying the erase areas. Passing different handles that partially alias the same storage is not a supported aliasing mode.

anchor Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_2S32.

erasing Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_3S32.

imgIdx Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_S32.

values Tensor

Must be 'N' (dim = 1) with W = number of erasing area * 4.
Data Type must be 32bit Float.
DataType must be TYPE_F32.

Applies to ``cvcudaEraseRegionSubmit``:

Input / Output: Container: Tensor only Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

64bit Unsigned

Yes

64bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Values: Rank must not exceed four. Dimensions are right-aligned against the logical (N, C, H, W) shape, with N = 1 for unbatched inputs, and each must equal the corresponding selected-region dimension or be one for broadcasting. The dtype must match the input dtype or be 32-bit float. Float-to-integer conversion matches CUDA PyTorch assignment semantics, including for non-finite and out-of-range values.

cvcuda.erase_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, anchor: cvcuda.Tensor, erasing: cvcuda.Tensor, values: cvcuda.Tensor, imgIdx: cvcuda.Tensor, *, random: bool = False, seed: SupportsInt | SupportsIndex = 0, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Erase operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • anchor (cvcuda.Tensor) – anchor an array of size num_erasing_area that gives the x coordinate and y coordinate of the top left point in the eraseing areas.

  • erasing (cvcuda.Tensor) – Eraisng an array of size num_erasing_area that gives the widths of the eraseing areas, the heights of the eraseing areas and integers in range 0-15, each of whose bits indicates whether or not the corresponding channel need to be erased.

  • values (cvcuda.Tensor) – An array of size num_erasing_area*4 that gives the filling value for each erase area.

  • imgIdx (cvcuda.Tensor) – An array of size num_erasing_area that maps a erase area idx to img idx in the batch.

  • random (int, optional) – 8-bit integer value for random op.

  • seed (int, optional) – seed random seed for random filling erase area.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaEraseSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

In-place execution is selected by passing the same handle for in and out. There is no separate in-place parameter. When in and out are different handles, the operation copies in to out before applying the erase areas. Passing different handles that partially alias the same storage is not a supported aliasing mode.

anchor Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_2S32.

erasing Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_3S32.

imgIdx Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_S32.

values Tensor

Must be 'N' (dim = 1) with W = number of erasing area * 4.
Data Type must be 32bit Float.
DataType must be TYPE_F32.

Applies to ``cvcudaEraseRegionSubmit``:

Input / Output: Container: Tensor only Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

64bit Unsigned

Yes

64bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Values: Rank must not exceed four. Dimensions are right-aligned against the logical (N, C, H, W) shape, with N = 1 for unbatched inputs, and each must equal the corresponding selected-region dimension or be one for broadcasting. The dtype must match the input dtype or be 32-bit float. Float-to-integer conversion matches CUDA PyTorch assignment semantics, including for non-finite and out-of-range values.

cvcuda.erase_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, anchor: cvcuda.Tensor, erasing: cvcuda.Tensor, values: cvcuda.Tensor, imgIdx: cvcuda.Tensor, *, random: bool = False, seed: SupportsInt | SupportsIndex = 0, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Erase operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • anchor (cvcuda.Tensor) – anchor an array of size num_erasing_area that gives the x coordinate and y coordinate of the top left point in the eraseing areas.

  • erasing (cvcuda.Tensor) – Eraisng an array of size num_erasing_area that gives the widths of the eraseing areas, the heights of the eraseing areas and integers in range 0-15, each of whose bits indicates whether or not the corresponding channel need to be erased.

  • values (cvcuda.Tensor) – An array of size num_erasing_area*4 that gives the filling value for each erase area.

  • imgIdx (cvcuda.Tensor) – An array of size num_erasing_area that maps a erase area idx to img idx in the batch.

  • random (int, optional) – 8-bit integer value for random op.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaEraseSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

In-place execution is selected by passing the same handle for in and out. There is no separate in-place parameter. When in and out are different handles, the operation copies in to out before applying the erase areas. Passing different handles that partially alias the same storage is not a supported aliasing mode.

anchor Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_2S32.

erasing Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_3S32.

imgIdx Tensor

Must be 'N' (dim = 1) with N = number of erasing area.
Data Type must be 32bit Signed.
DataType must be TYPE_S32.

values Tensor

Must be 'N' (dim = 1) with W = number of erasing area * 4.
Data Type must be 32bit Float.
DataType must be TYPE_F32.

Applies to ``cvcudaEraseRegionSubmit``:

Input / Output: Container: Tensor only Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

64bit Unsigned

Yes

64bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Values: Rank must not exceed four. Dimensions are right-aligned against the logical (N, C, H, W) shape, with N = 1 for unbatched inputs, and each must equal the corresponding selected-region dimension or be one for broadcasting. The dtype must match the input dtype or be 32-bit float. Float-to-integer conversion matches CUDA PyTorch assignment semantics, including for non-finite and out-of-range values.

cvcuda.findhomography(srcPts: cvcuda.Tensor, dstPts: cvcuda.Tensor, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Estimates the homography matrix between srcPts and dstPts coordinates on the given cuda stream.

Parameters:
  • srcPts (cvcuda.Tensor) – Input source coordinates tensor containing 2D coordinates in the source image.

  • dstPts (cvcuda.Tensor) – Input destination coordinates tensor containing 2D coordinates in the target image.

  • stream (Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The model homography matrix tensor.

Return type:

cvcuda.Tensor

Limitations

Planar image layouts: Not applicable Reason: Inputs are point-coordinate tensors and outputs are transformation matrices, not images.

Input (srcPts, dstPts): Data Layout: [NW] with dtype 2F32, or [NWC] with dtype F32 and C=2 Channels: [2] (packed as 2F32 or explicit dimension)

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (F32 or 2F32)

64bit Float

No

Output (models): Data Layout: [NHW] Shape: [N, 3, 3]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | Yes (base type F32)
 Batches (N)   | Yes
 Channels      | No
cvcuda.findhomography(srcPts: cvcuda.TensorBatch, dstPts: cvcuda.TensorBatch, stream: cvcuda.Stream | None = None) cvcuda.TensorBatch

Executes the Find Homography operation on the given cuda stream.

Parameters:
  • srcPts (cvcuda.TensorBatch) – Input source coordinates tensor containing 2D coordinates in the source image.

  • dstPts (cvcuda.TensorBatch) – Input destination coordinates tensor containing 2D coordinates in the target image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The model homography matrix tensor batch.

Return type:

cvcuda.TensorBatch

Limitations

Planar image layouts: Not applicable Reason: Inputs are point-coordinate tensors and outputs are transformation matrices, not images.

Input (srcPts, dstPts): Data Layout: [NW] with dtype 2F32, or [NWC] with dtype F32 and C=2 Channels: [2] (packed as 2F32 or explicit dimension)

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (F32 or 2F32)

64bit Float

No

Output (models): Data Layout: [NHW] Shape: [N, 3, 3]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | Yes (base type F32)
 Batches (N)   | Yes
 Channels      | No
cvcuda.findhomography_into(models: cvcuda.Tensor, srcPts: cvcuda.Tensor, dstPts: cvcuda.Tensor, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Find Homography operation on the given cuda stream.

Parameters:
  • models (cvcuda.Tensor) – Output model tensor containing 3x3 homography matrices.

  • srcPts (cvcuda.Tensor) – Input source coordinates tensor containing 2D coordinates in the source image.

  • dstPts (cvcuda.Tensor) – Input destination coordinates tensor containing 2D coordinates in the target image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The model homography matrix tensor.

Return type:

cvcuda.Tensor

Limitations

Planar image layouts: Not applicable Reason: Inputs are point-coordinate tensors and outputs are transformation matrices, not images.

Input (srcPts, dstPts): Data Layout: [NW] with dtype 2F32, or [NWC] with dtype F32 and C=2 Channels: [2] (packed as 2F32 or explicit dimension)

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (F32 or 2F32)

64bit Float

No

Output (models): Data Layout: [NHW] Shape: [N, 3, 3]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | Yes (base type F32)
 Batches (N)   | Yes
 Channels      | No
cvcuda.findhomography_into(models: cvcuda.TensorBatch, srcPts: cvcuda.TensorBatch, dstPts: cvcuda.TensorBatch, stream: cvcuda.Stream | None = None) cvcuda.TensorBatch

Executes the Find Homography operation on the given cuda stream.

Parameters:
  • models (cvcuda.TensorBatch) – Output model tensor containing 3x3 homography matrices.

  • srcPts (cvcuda.TensorBatch) – Input source coordinates tensor containing 2D coordinates in the source image.

  • dstPts (cvcuda.TensorBatch) – Input destination coordinates tensor containing 2D coordinates in the target image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The model homography matrix tensor batch.

Return type:

cvcuda.TensorBatch

Limitations

Planar image layouts: Not applicable Reason: Inputs are point-coordinate tensors and outputs are transformation matrices, not images.

Input (srcPts, dstPts): Data Layout: [NW] with dtype 2F32, or [NWC] with dtype F32 and C=2 Channels: [2] (packed as 2F32 or explicit dimension)

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (F32 or 2F32)

64bit Float

No

Output (models): Data Layout: [NHW] Shape: [N, 3, 3]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | Yes (base type F32)
 Batches (N)   | Yes
 Channels      | No
cvcuda.findhomography_into_with_op(models: cvcuda.Tensor, srcPts: cvcuda.Tensor, dstPts: cvcuda.Tensor, operator: typing_extensions.CapsuleType, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Find Homography operation using a pre-fetched operator.

This version accepts an operator obtained from get_findhomography_operator(), which avoids cache lookup overhead and prevents bimodal timing patterns.

Parameters:
  • models (cvcuda.Tensor) – Output model tensor containing 3x3 homography matrices.

  • srcPts (cvcuda.Tensor) – Input source coordinates tensor containing 2D coordinates in the source image.

  • dstPts (cvcuda.Tensor) – Input destination coordinates tensor containing 2D coordinates in the target image.

  • operator (object) – Pre-fetched operator from get_findhomography_operator().

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The model homography matrix tensor.

Return type:

cvcuda.Tensor

Limitations

Planar image layouts: Not applicable Reason: Inputs are point-coordinate tensors and outputs are transformation matrices, not images.

Input (srcPts, dstPts): Data Layout: [NW] with dtype 2F32, or [NWC] with dtype F32 and C=2 Channels: [2] (packed as 2F32 or explicit dimension)

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (F32 or 2F32)

64bit Float

No

Output (models): Data Layout: [NHW] Shape: [N, 3, 3]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | Yes (base type F32)
 Batches (N)   | Yes
 Channels      | No
cvcuda.get_findhomography_operator(batch_size: SupportsInt | SupportsIndex, num_points: SupportsInt | SupportsIndex) object

Get a reusable FindHomography operator for the given dimensions.

This allows holding a persistent reference to the operator to avoid the cache eviction overhead that can cause bimodal timing patterns when calling findhomography_into repeatedly.

Parameters:
  • batch_size (int) – Number of samples in the batch.

  • num_points (int) – Number of points per sample.

Returns:

A FindHomography operator that can be passed to findhomography_into_with_op.

Return type:

object

Example

>>> op = cvcuda.get_findhomography_operator(1024, 2048)
>>> for _ in range(iterations):
...     cvcuda.findhomography_into_with_op(models, src, dst, op, stream=stream)
cvcuda.flip(src: cvcuda.Tensor, flipCode: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Flip operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • flipCode (int) – Flag to specify how to flip the array; 0 means flipping around the x-axis and positive value (for example, 1) means flipping around y-axis. Negative value (for example, -1) means flipping around both axes.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaFlipSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Applies to ``cvcudaFlipVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.flip(src: cvcuda.ImageBatchVarShape, flipCode: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Flip operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • flipCode (cvcuda.Tensor) – Flag to specify how to flip the array; 0 means flipping around the x-axis and positive value (for example, 1) means flipping around y-axis. Negative value (for example, -1) means flipping around both axes. Specified for all images in batch.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaFlipSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Applies to ``cvcudaFlipVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.flip_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, flipCode: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Flip operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • flipCode (int) – Flag to specify how to flip the array; 0 means flipping around the x-axis and positive value (for example, 1) means flipping around y-axis. Negative value (for example, -1) means flipping around both axes.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaFlipSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Applies to ``cvcudaFlipVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.flip_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, flipCode: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Flip operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • flipCode (cvcuda.Tensor) – Flag to specify how to flip the array; 0 means flipping around the x-axis and positive value (for example, 1) means flipping around y-axis. Negative value (for example, -1) means flipping around both axes. Specified for all images in batch.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaFlipSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Applies to ``cvcudaFlipVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gamma_contrast(src: cvcuda.Tensor, gamma: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Gamma Contrast operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor (interleaved (N)HWC or planar (N)CHW layout).

  • gamma (cvcuda.Tensor) – 1D Tensor with the gamma value for each sample / sample channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gamma_contrast(src: cvcuda.Tensor, gamma: typing.SupportsFloat | typing.SupportsIndex, gain: typing.SupportsFloat | typing.SupportsIndex = 1.0, *, round: cvcuda.Round = <Round.NEAREST: 0>, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Gamma Contrast operation with host-scalar gamma and gain on the given cuda stream.

Applies out = gain * in**gamma (the torchvision adjust_gamma formula) with a single gamma/gain for every sample and channel. The scalars are passed by value into the kernel launch – no gamma tensor is allocated and no host-to-device copy is performed. With gain == 1.0 and round == cvcuda.Round.NEAREST, the result is bit-exact with the device-tensor gamma overload fed a gamma tensor filled with the same value. gamma is not range-validated: a negative value follows powf semantics (NaN for fractional powers of negative inputs).

Parameters:
  • src (cvcuda.Tensor) – Input tensor (interleaved (N)HWC or planar (N)CHW layout).

  • gamma (float) – Gamma exponent applied to every sample / channel.

  • gain (float, optional) – Output gain applied to every sample / channel. Defaults to 1.0.

  • round (cvcuda.Round, optional) – Rounding mode used for integer outputs. Defaults to cvcuda.Round.NEAREST; use cvcuda.Round.TRUNCATE to truncate toward zero. Has no effect for floating-point outputs.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gamma_contrast(src: cvcuda.ImageBatchVarShape, gamma: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Gamma Contrast operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input tensor containing one or more images.

  • gamma (cvcuda.Tensor) – 1D Tensor with the the gamma value for each image / image channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gamma_contrast_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, gamma: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Gamma Contrast operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor (interleaved (N)HWC or planar (N)CHW layout).

  • gamma (cvcuda.Tensor) – 1D Tensor with the gamma value for each sample / sample channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gamma_contrast_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, gamma: typing.SupportsFloat | typing.SupportsIndex, gain: typing.SupportsFloat | typing.SupportsIndex = 1.0, *, round: cvcuda.Round = <Round.NEAREST: 0>, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Gamma Contrast operation with host-scalar gamma and gain on the given cuda stream.

Applies out = gain * in**gamma (the torchvision adjust_gamma formula) with a single gamma/gain for every sample and channel. The scalars are passed by value into the kernel launch – no gamma tensor is allocated and no host-to-device copy is performed. gamma is not range-validated: a negative value follows powf semantics (NaN for fractional powers of negative inputs).

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor (interleaved (N)HWC or planar (N)CHW layout).

  • gamma (float) – Gamma exponent applied to every sample / channel.

  • gain (float, optional) – Output gain applied to every sample / channel. Defaults to 1.0.

  • round (cvcuda.Round, optional) – Rounding mode used for integer outputs. Defaults to cvcuda.Round.NEAREST; use cvcuda.Round.TRUNCATE to truncate toward zero. Has no effect for floating-point outputs.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gamma_contrast_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, gamma: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Gamma Contrast operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output image batch: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gaussian(src: cvcuda.Tensor, kernel_size: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], sigma: tuple[typing.SupportsFloat | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex], border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Gaussian operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • kernel_size (Tuple[int, int]) – Kernel width, height.

  • sigma (Tuple[double, double]) – Gaussian kernel standard deviation in X,Y directions.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gaussian(src: cvcuda.ImageBatchVarShape, max_kernel_size: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], kernel_size: cvcuda.Tensor, sigma: cvcuda.Tensor, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Gaussian operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • kernel_size (cvcuda.Tensor) – Kernel width, height.

  • sigma (cvcuda.Tensor) – Gaussian kernel standard deviation in X,Y directions.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gaussian_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, kernel_size: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], sigma: tuple[typing.SupportsFloat | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex], border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Gaussian operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • kernel_size (Tuple[int, int]) – Kernel width, height.

  • sigma (Tuple[double, double]) – Gaussian kernel standard deviation in X,Y directions.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gaussian_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, max_kernel_size: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], kernel_size: cvcuda.Tensor, sigma: cvcuda.Tensor, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Gaussian operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.gaussiannoise(src: cvcuda.Tensor, mu: cvcuda.Tensor, sigma: cvcuda.Tensor, per_channel: bool, seed: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the GaussianNoise operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input image batch containing one or more images.

  • mu (cvcuda.Tensor) – An array of size batch that gives the mu value of each image.

  • sigma (cvcuda.Tensor) – An array of size batch that gives the sigma value of each image.

  • per_channel (bool) – Whether to add the same noise for all channels.

  • seed (int) – Seed for random numbers.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.Tensor

Limitations

Input and output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4 Data Type: [TYPE_U8, TYPE_F32]

Input and output must have identical shape, layout, and data type. mu and sigma use input-value units. For uint8 torchvision-compatible normalized parameters, callers multiply both values by 255 before submission.

cvcuda.gaussiannoise(src: cvcuda.Tensor, mu: SupportsFloat | SupportsIndex, sigma: SupportsFloat | SupportsIndex, per_channel: bool, *, seed: SupportsInt | SupportsIndex | None = None, clip: bool = True, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Adds Gaussian noise using scalar mean and standard-deviation values.

This overload passes mu and sigma by value, so it does not allocate or upload parameter tensors. When seed is None, a cached CV-CUDA random-number stream advances between calls. Supplying a seed forcibly reseeds the call, so repeating the same explicit seed reproduces the same result.

Parameters:
  • src (cvcuda.Tensor) – Input image tensor.

  • mu (float) – Gaussian mean in input-value units.

  • sigma (float) – Non-negative Gaussian standard deviation in input-value units.

  • per_channel (bool) – Whether to generate independent noise for every channel.

  • seed (int, optional) – Non-negative 64-bit seed. None advances the cached random-number stream.

  • clip (bool, optional) – Clamp uint8 to [0, 255] and float32 to [0, 1]. With False, float32 remains unbounded and uint8 wraps modulo 256.

  • stream (cvcuda.Stream, optional) – CUDA stream on which to perform the operation.

Returns:

The output image tensor.

Return type:

cvcuda.Tensor

Limitations

Input and output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4 Data Type: [TYPE_U8, TYPE_F32]

Input and output must have identical shape, layout, and data type. mu and sigma use input-value units. For uint8 torchvision-compatible normalized parameters, callers multiply both values by 255 before submission.

cvcuda.gaussiannoise(src: cvcuda.ImageBatchVarShape, mu: cvcuda.Tensor, sigma: cvcuda.Tensor, per_channel: bool, seed: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the GaussianNoise operation on the given cuda stream.

Parameters:
  • src (ImageBatchVarShape) – Input image batch containing one or more images.

  • mu (cvcuda.Tensor) – An array of size batch that gives the mu value of each image.

  • sigma (cvcuda.Tensor) – An array of size batch that gives the sigma value of each image.

  • per_channel (bool) – Whether to add the same noise for all channels.

  • seed (int) – Seed for random numbers.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input and output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4 Data Type: [TYPE_U8, TYPE_F32]

Input and output must have identical shape, layout, and data type. mu and sigma use input-value units. For uint8 torchvision-compatible normalized parameters, callers multiply both values by 255 before submission.

cvcuda.gaussiannoise_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, mu: cvcuda.Tensor, sigma: cvcuda.Tensor, per_channel: bool, seed: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the GaussianNoise operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output image batch containing the result of the operation.

  • src (cvcuda.Tensor) – Input image batch containing one or more images.

  • mu (cvcuda.Tensor) – An array of size batch that gives the mu value of each image.

  • sigma (cvcuda.Tensor) – An array of size batch that gives the sigma value of each image.

  • per_channel (bool) – Whether to add the same noise for all channels.

  • seed (int) – Seed for random numbers.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input and output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4 Data Type: [TYPE_U8, TYPE_F32]

Input and output must have identical shape, layout, and data type. mu and sigma use input-value units. For uint8 torchvision-compatible normalized parameters, callers multiply both values by 255 before submission.

cvcuda.gaussiannoise_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, mu: SupportsFloat | SupportsIndex, sigma: SupportsFloat | SupportsIndex, per_channel: bool, *, seed: SupportsInt | SupportsIndex | None = None, clip: bool = True, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Adds Gaussian noise using scalar mean and standard-deviation values into a supplied tensor.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor.

  • src (cvcuda.Tensor) – Input image tensor.

  • mu (float) – Gaussian mean in input-value units.

  • sigma (float) – Non-negative Gaussian standard deviation in input-value units.

  • per_channel (bool) – Whether to generate independent noise for every channel.

  • seed (int, optional) – Non-negative 64-bit seed. None advances the cached random-number stream.

  • clip (bool, optional) – Whether to clamp output to the image dtype’s expected range.

  • stream (cvcuda.Stream, optional) – CUDA stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input and output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4 Data Type: [TYPE_U8, TYPE_F32]

Input and output must have identical shape, layout, and data type. mu and sigma use input-value units. For uint8 torchvision-compatible normalized parameters, callers multiply both values by 255 before submission.

cvcuda.gaussiannoise_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, mu: cvcuda.Tensor, sigma: cvcuda.Tensor, per_channel: bool, seed: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the GaussianNoise operation on the given cuda stream.

Parameters:
  • dst (ImageBatchVarShape) – Output image batch containing the result of the operation.

  • src (ImageBatchVarShape) – Input image batch containing one or more images.

  • mu (cvcuda.Tensor) – An array of size batch that gives the mu value of each image.

  • sigma (cvcuda.Tensor) – An array of size batch that gives the sigma value of each image.

  • per_channel (bool) – Whether to add the same noise for all channels.

  • seed (int) – Seed for random numbers.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input and output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4 Data Type: [TYPE_U8, TYPE_F32]

Input and output must have identical shape, layout, and data type. mu and sigma use input-value units. For uint8 torchvision-compatible normalized parameters, callers multiply both values by 255 before submission.

cvcuda.histogram(src: cvcuda.Tensor, mask: cvcuda.Tensor | None = None, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes an histogram operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images, input tensor must be (N)HWC or (N)CHW, currently only grayscale uint8 is supported.

  • mask (cvcuda.Tensor, optional) – Input tensor containing the mask of the pixels to be considered for the histogram, must be the same shape as src.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor containing the histogram. The tensor is formatted as HWC with W = 256 and H = number of input tensors, and C = 1.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC] Channels: [1]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | N/A
 Data Type     | N/A
 Number        | N/A
 Channels      | N/A
 Width         | N/A
 Height        | N/A
cvcuda.histogram_into(histogram: cvcuda.Tensor, src: cvcuda.Tensor, mask: cvcuda.Tensor | None = None, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes an histogram operation on the given cuda stream.

Parameters:
  • histogram (cvcuda.Tensor) – Output tensor containing the histogram. The tensor is formatted as HWC with W = 256 and H = number of input tensors, and C = 1.

  • src (cvcuda.Tensor) – Input tensor containing one or more images, input tensor must be (N)HWC or (N)CHW, currently only grayscale uint8 is supported.

  • mask (cvcuda.Tensor, optional) – Input tensor containing the bit mask of the pixels to be considered for the histogram, must be the same shape as src.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as histogram).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC] Channels: [1]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | N/A
 Data Type     | N/A
 Number        | N/A
 Channels      | N/A
 Width         | N/A
 Height        | N/A
cvcuda.histogrameq(src: cvcuda.Tensor, dtype: cvcuda.Type, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the histogram equalization operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input image batch containing one or more images.

  • dtype (numpy.dtype) – The data type of the output.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.histogrameq(src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the histogram equalization operation on the given cuda stream.

Parameters:
Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.histogrameq_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the histogram equalization operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output image batch containing the result of the operation.

  • src (cvcuda.Tensor) – Input image batch containing one or more images.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.histogrameq_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the histogram equalization operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.hq_resize(src: cvcuda.Tensor, out_size: tuple, *, antialias: bool | None = False, roi: tuple | None = None, interpolation: cvcuda.Interp | None = None, min_interpolation: cvcuda.Interp | None = None, mag_interpolation: cvcuda.Interp | None = None, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the HQ Resize operation on the given cuda stream. The operator supports resampling for 2D (images) and 3D volumetric samples.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images. The tensor layout must match: (N)(D)HW(C).

  • out_size (tuple) – Tuple of 2 or 3 ints describing the output shape in (D)HW layout.

  • antialias (bool) – If set to true, an antialiasing is enabled for scaling down.

  • roi (Tuple) – Optional bounding box describing the input’s region of interest. For 2D resampling it should be (lowH, lowW, highH, highW), for 3D: (lowD, lowH, lowW, highD, highH, highW). If, for some axis, the low bound is bigger than the high bound, the image is flipped across the axis.

  • interpolation (cvcuda.Interp) – Interpolation type used. Used both for scaling down and up, cannot be specified together with (min_interpolation or mag_interpolation).

  • min_interpolation (cvcuda.Interp) – Interpolation type used for scaling down.

  • mag_interpolation (cvcuda.Interp) – Interpolation type used for scaling up.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaHQResizeSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[N][D]HW[C] (interleaved); NVCV_TENSOR_[N]CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeImageBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_HWC (interleaved); planar multi-plane formats (e.g. RGB8p) are also supported

Number of channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeTensorBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[D]HW[C] (interleaved); NVCV_TENSOR_CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

cvcuda.hq_resize(src: cvcuda.ImageBatchVarShape, out_size: collections.abc.Sequence[tuple[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex]], *, antialias: bool | None = False, roi: collections.abc.Sequence[tuple] | None = None, interpolation: cvcuda.Interp | None = None, min_interpolation: cvcuda.Interp | None = None, mag_interpolation: cvcuda.Interp | None = None, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the HQ Resize operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input batch of images.

  • out_size (tuple) – Tuple of 2 ints describing the output shape in HW layout.

  • antialias (bool) – If set to true, an antialiasing is enabled for scaling down.

  • roi (List[Tuple[int]]) – Optional bounding boxes describing the input’s region of interest. It should be a list of tuples. The list length must match the number of input tensors or be 1 (so that the same ROI is used for all samples). Each tuple must be of the form (lowH, lowW, highH, highW). If, for some axis, the low bound is bigger than the high bound, the image is flipped across the axis.

  • interpolation (cvcuda.Interp) – Interpolation type used. Used both for scaling down and up, cannot be specified together with (min_interpolation or mag_interpolation).

  • min_interpolation (cvcuda.Interp) – Interpolation type used for scaling down.

  • mag_interpolation (cvcuda.Interp) – Interpolation type used for scaling up.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The batch of resized images.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaHQResizeSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[N][D]HW[C] (interleaved); NVCV_TENSOR_[N]CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeImageBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_HWC (interleaved); planar multi-plane formats (e.g. RGB8p) are also supported

Number of channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeTensorBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[D]HW[C] (interleaved); NVCV_TENSOR_CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

cvcuda.hq_resize(src: cvcuda.TensorBatch, out_size: collections.abc.Sequence[tuple], *, antialias: bool | None = False, roi: collections.abc.Sequence[tuple] | None = None, interpolation: cvcuda.Interp | None = None, min_interpolation: cvcuda.Interp | None = None, mag_interpolation: cvcuda.Interp | None = None, stream: cvcuda.Stream | None = None) cvcuda.TensorBatch

Executes the HQ Resize operation on the given cuda stream. The operator supports resampling for 2D (images) and 3D volumetric samples.

Parameters:
  • src (cvcuda.TensorBatch) – Input batch containing one or more tensors of (D)HW(C) layout.

  • out_size (tuple) – Tuple of 2 or 3 ints describing the output shape in (D)HW layout.

  • antialias (bool) – If set to true, an antialiasing is enabled for scaling down.

  • roi (List[Tuple[int]]) – Optional bounding boxes describing the input’s region of interest. It should be a list of tuples. The list length must match the number of input tensors or be 1 (so that the same ROI is used for all samples). Each tuple must be of the form: * for 2D resampling: (lowH, lowW, highH, highW), * for 3D: (lowD, lowH, lowW, highD, highH, highW). If, for some axis, the low bound is bigger than the high bound, the tensor is flipped across the axis.

  • interpolation (cvcuda.Interp) – Interpolation type used. Used both for scaling down and up, cannot be specified together with (min_interpolation or mag_interpolation).

  • min_interpolation (cvcuda.Interp) – Interpolation type used for scaling down.

  • mag_interpolation (cvcuda.Interp) – Interpolation type used for scaling up.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The batch of resized tensors.

Return type:

cvcuda.TensorBatch

Limitations

Applies to ``cvcudaHQResizeSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[N][D]HW[C] (interleaved); NVCV_TENSOR_[N]CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeImageBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_HWC (interleaved); planar multi-plane formats (e.g. RGB8p) are also supported

Number of channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeTensorBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[D]HW[C] (interleaved); NVCV_TENSOR_CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

cvcuda.hq_resize_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, *, antialias: bool | None = False, roi: tuple | None = None, interpolation: cvcuda.Interp | None = None, min_interpolation: cvcuda.Interp | None = None, mag_interpolation: cvcuda.Interp | None = None, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the HQ Resize operation on the given cuda stream. The operator supports resampling for 2D (images) and 3D volumetric samples.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor. It’s layout must match the src tensor. The size of D, H, and W extents may be different. The dst type must match the src’s type or be float32.

  • src (cvcuda.Tensor) – Input tensor containing one or more images. The tensor layout must match: (N)(D)HW(C).

  • antialias (bool) – If set to true, an antialiasing is enabled for scaling down.

  • roi (Tuple[int]) – Optional bounding box describing the input’s region of interest. For 2D resampling it should be (lowH, lowW, highH, highW), for 3D: (lowD, lowH, lowW, highD, highH, highW). If, for some axis, the low bound is bigger than the high bound, the image is flipped across the axis.

  • interpolation (cvcuda.Interp) – Interpolation type used. Used both for scaling down and up, cannot be specified together with (min_interpolation or mag_interpolation).

  • min_interpolation (cvcuda.Interp) – Interpolation type used for scaling down.

  • mag_interpolation (cvcuda.Interp) – Interpolation type used for scaling up.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaHQResizeSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[N][D]HW[C] (interleaved); NVCV_TENSOR_[N]CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeImageBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_HWC (interleaved); planar multi-plane formats (e.g. RGB8p) are also supported

Number of channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeTensorBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[D]HW[C] (interleaved); NVCV_TENSOR_CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

cvcuda.hq_resize_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, *, antialias: bool | None = False, roi: collections.abc.Sequence[tuple] | None = None, interpolation: cvcuda.Interp | None = None, min_interpolation: cvcuda.Interp | None = None, mag_interpolation: cvcuda.Interp | None = None, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the HQ Resize operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output batch. The layout must match the input batch. The size of D, H, and W extents may be different. The dst type must match the src’s type or be float32.

  • src (cvcuda.ImageBatchVarShape) – Input batch of images.

  • antialias (bool) – If set to true, an antialiasing is enabled for scaling down.

  • roi (List[Tuple[int]]) – Optional bounding boxes describing the input’s region of interest. It should be a list of tuples. The list length must match the number of input tensors or be 1 (so that the same ROI is used for all samples). Each tuple must be of the form (lowH, lowW, highH, highW). If, for some axis, the low bound is bigger than the high bound, the image is flipped across the axis.

  • interpolation (cvcuda.Interp) – Interpolation type used. Used both for scaling down and up, cannot be specified together with (min_interpolation or mag_interpolation).

  • min_interpolation (cvcuda.Interp) – Interpolation type used for scaling down.

  • mag_interpolation (cvcuda.Interp) – Interpolation type used for scaling up.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The batch of resized images.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaHQResizeSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[N][D]HW[C] (interleaved); NVCV_TENSOR_[N]CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeImageBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_HWC (interleaved); planar multi-plane formats (e.g. RGB8p) are also supported

Number of channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeTensorBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[D]HW[C] (interleaved); NVCV_TENSOR_CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

cvcuda.hq_resize_into(dst: cvcuda.TensorBatch, src: cvcuda.TensorBatch, *, antialias: bool | None = False, roi: collections.abc.Sequence[tuple] | None = None, interpolation: cvcuda.Interp | None = None, min_interpolation: cvcuda.Interp | None = None, mag_interpolation: cvcuda.Interp | None = None, stream: cvcuda.Stream | None = None) cvcuda.TensorBatch

Executes the HQ Resize operation on the given cuda stream. The operator supports resampling for 2D (images) and 3D volumetric samples.

Parameters:
  • dst (cvcuda.TensorBatch) – Output batch. The layout must match the input batch. The size of D, H, and W extents may be different. The dst type must match the src’s type or be float32.

  • src (cvcuda.TensorBatch) – Input batch containing one or more tensors of (D)HW(C) layout.

  • antialias (bool) – If set to true, an antialiasing is enabled for scaling down.

  • roi (List[Tuple[int]]) – Optional bounding boxes describing the input’s region of interest. It should be a list of tuples. The list length must match the number of input tensors or be 1 (so that the same ROI is used for all samples). Each tuple must be of the form: * for 2D resampling: (lowH, lowW, highH, highW), * for 3D: (lowD, lowH, lowW, highD, highH, highW). If, for some axis, the low bound is bigger than the high bound, the tensor is flipped across the axis.

  • interpolation (cvcuda.Interp) – Interpolation type used. Used both for scaling down and up, cannot be specified together with (min_interpolation or mag_interpolation).

  • min_interpolation (cvcuda.Interp) – Interpolation type used for scaling down.

  • mag_interpolation (cvcuda.Interp) – Interpolation type used for scaling up.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The batch of resized tensors.

Return type:

cvcuda.TensorBatch

Limitations

Applies to ``cvcudaHQResizeSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[N][D]HW[C] (interleaved); NVCV_TENSOR_[N]CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeImageBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_HWC (interleaved); planar multi-plane formats (e.g. RGB8p) are also supported

Number of channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

Applies to ``cvcudaHQResizeTensorBatchSubmit``:

Input, Output: Data Layout: NVCV_TENSOR_[D]HW[C] (interleaved); NVCV_TENSOR_CHW (planar, 2D only)

Number of channels: Positive integer

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No (output can be the same or float32).

Channels

Yes

Width

No

Height

No

Samples

Yes

cvcuda.inpaint(src: cvcuda.Tensor, masks: cvcuda.Tensor, inpaintRadius: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Inpaint operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • masks (cvcuda.Tensor) – Mask tensor, 8-bit 1-channel images. Non-zero pixels indicate the area that needs to be inpainted.

  • inpaintRadius (float) – Radius of a circular neighborhood of each point inpainted that is considered by the algorithm.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

cvcuda.inpaint(src: cvcuda.ImageBatchVarShape, masks: cvcuda.ImageBatchVarShape, inpaintRadius: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Inpaint operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • masks (cvcuda.ImageBatchVarShape) – Mask image batch, 8-bit 1-channel images. Non-zero pixels indicate the area that needs to be inpainted.

  • inpaintRadius (float) – Radius of a circular neighborhood of each point inpainted that is considered by the algorithm.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

cvcuda.inpaint_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, masks: cvcuda.Tensor, inpaintRadius: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Inpaint operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • masks (cvcuda.Tensor) – Mask tensor, 8-bit 1-channel images. Non-zero pixels indicate the area that needs to be inpainted.

  • inpaintRadius (float) – Radius of a circular neighborhood of each point inpainted that is considered by the algorithm.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

cvcuda.inpaint_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, masks: cvcuda.ImageBatchVarShape, inpaintRadius: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Inpaint operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • masks (cvcuda.ImageBatchVarShape) – Mask image batch, 8-bit 1-channel images. Non-zero pixels indicate the area that needs to be inpainted.

  • inpaintRadius (float) – Radius of a circular neighborhood of each point inpainted that is considered by the algorithm.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

cvcuda.invert(src: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Invert operation on the given cuda stream.

Computes the per-element photometric negative out = bound - in, where bound is the maximum value of the data type (255 for uint8, 65535 for uint16, 1.0 for float32). Mirrors torchvision.transforms.v2.functional.invert / OpenCV cv::bitwise_not (unsigned).

See also

Refer to the CV-CUDA C API reference for the Invert operator for more details and usage examples.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same shape, dtype, and layout as src).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.invert(src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Invert operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same formats and sizes as src).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.invert_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Invert operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Invert operator for more details and usage examples.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.invert_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Invert operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.joint_bilateral_filter(src: cvcuda.Tensor, srcColor: cvcuda.Tensor, diameter: typing.SupportsInt | typing.SupportsIndex, sigma_color: typing.SupportsFloat | typing.SupportsIndex, sigma_space: typing.SupportsFloat | typing.SupportsIndex, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Joint Bilateral Filter operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • srcColor (cvcuda.Tensor) – Input tensor for color distance.

  • diameter (int) – Bilateral filter diameter.

  • sigma_color (float) – Gaussian exponent for color difference.

  • sigma_space (float) – Gaussian exponent for position difference.

  • border (cvcuda.Border, optional) – Border mode for input tensor.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Destination must be same format and size as source

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

InputColor: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.joint_bilateral_filter(src: cvcuda.ImageBatchVarShape, srcColor: cvcuda.ImageBatchVarShape, diameter: cvcuda.Tensor, sigma_color: cvcuda.Tensor, sigma_space: cvcuda.Tensor, *, border: cvcuda.Border = <Border.CONSTANT: 0>, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Joint Bilateral operation on the given cuda stream.

Parameters:
Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Destination must be same format and size as source

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

InputColor: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.joint_bilateral_filter_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, srcColor: cvcuda.Tensor, diameter: typing.SupportsInt | typing.SupportsIndex, sigma_color: typing.SupportsFloat | typing.SupportsIndex, sigma_space: typing.SupportsFloat | typing.SupportsIndex, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Joint Bilateral Filter operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • srcColor (cvcuda.Tensor) – Input tensor for color distance.

  • diameter (int) – Bilateral filter diameter.

  • sigma_color (float) – Gaussian exponent for color difference.

  • sigma_space (float) – Gaussian exponent for position difference.

  • border (cvcuda.Border, optional) – Border mode for input tensor.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Destination must be same format and size as source

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

InputColor: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.joint_bilateral_filter_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, srcColor: cvcuda.ImageBatchVarShape, diameter: cvcuda.Tensor, sigma_color: cvcuda.Tensor, sigma_space: cvcuda.Tensor, *, border: cvcuda.Border = <Border.CONSTANT: 0>, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Joint Bilateral operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Destination must be same format and size as source

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

InputColor: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 2, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.jpeg_compression_distortion(src: cvcuda.Tensor, quality: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the JpegCompressionDistortion operation on the given cuda stream.

Simulates the artifacts of a JPEG compression/decompression round trip (full-range JFIF YCbCr conversion, 4:2:0 chroma subsampling, per-8x8-block DCT and Annex-K quantization with the libjpeg quality scaling). Entropy coding is not simulated, so results approximate — but do not bit-match — a real JPEG codec. 1-channel images take a luma-only path.

See also

Refer to the CV-CUDA C API reference for the JpegCompressionDistortion operator for more details and usage examples.

Parameters:
  • src (nvcv.Tensor) – Input tensor containing one or more uint8 images with (N)HWC or (N)CHW layout and 1 or 3 channels.

  • quality (nvcv.Tensor) – Per-image JPEG quality, from 1 (strongest distortion) to 100 (weakest); rank-1 int32 tensor with one value per image. Values are clamped to [1, 100] on the device.

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor, with the same shape, layout and data type as the input.

Return type:

nvcv.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.jpeg_compression_distortion(src: cvcuda.Tensor, quality: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the JpegCompressionDistortion operation on the given cuda stream.

Overload applying one JPEG quality to the whole batch.

Parameters:
  • src (nvcv.Tensor) – Input tensor containing one or more uint8 images with (N)HWC or (N)CHW layout and 1 or 3 channels.

  • quality (int) – JPEG quality applied to all images, from 1 (strongest distortion) to 100 (weakest). Must be in [1, 100].

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor, with the same shape, layout and data type as the input.

Return type:

nvcv.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.jpeg_compression_distortion(src: cvcuda.ImageBatchVarShape, quality: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the JpegCompressionDistortion operation on the given cuda stream.

Variable-shape overload: all images in the batch must share one uint8 image format with 1 or 3 (RGB) channels.

Parameters:
  • src (nvcv.ImageBatchVarShape) – Input image batch of uint8 images with 1 or 3 (RGB) channels.

  • quality (nvcv.Tensor) – Per-image JPEG quality, from 1 (strongest distortion) to 100 (weakest); rank-1 int32 tensor with one value per image. Values are clamped to [1, 100] on the device.

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch, matching the input formats and sizes.

Return type:

nvcv.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.jpeg_compression_distortion(src: cvcuda.ImageBatchVarShape, quality: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the JpegCompressionDistortion operation on the given cuda stream.

Variable-shape overload applying one JPEG quality to the whole batch.

Parameters:
  • src (nvcv.ImageBatchVarShape) – Input image batch of uint8 images with 1 or 3 (RGB) channels.

  • quality (int) – JPEG quality applied to all images, from 1 (strongest distortion) to 100 (weakest). Must be in [1, 100].

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch, matching the input formats and sizes.

Return type:

nvcv.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.jpeg_compression_distortion_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, quality: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the JpegCompressionDistortion operation on the given cuda stream, writing into a caller-provided output tensor.

Parameters:
  • dst (nvcv.Tensor) – Output tensor; must match the input’s shape, layout and data type.

  • src (nvcv.Tensor) – Input tensor containing one or more uint8 images with (N)HWC or (N)CHW layout and 1 or 3 channels.

  • quality (nvcv.Tensor) – Per-image JPEG quality, from 1 (strongest distortion) to 100 (weakest); rank-1 int32 tensor with one value per image. Values are clamped to [1, 100] on the device.

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

nvcv.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.jpeg_compression_distortion_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, quality: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the JpegCompressionDistortion operation on the given cuda stream, writing into a caller-provided output tensor.

Overload applying one JPEG quality to the whole batch.

Parameters:
  • dst (nvcv.Tensor) – Output tensor; must match the input’s shape, layout and data type.

  • src (nvcv.Tensor) – Input tensor containing one or more uint8 images with (N)HWC or (N)CHW layout and 1 or 3 channels.

  • quality (int) – JPEG quality applied to all images, from 1 (strongest distortion) to 100 (weakest). Must be in [1, 100].

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

nvcv.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.jpeg_compression_distortion_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, quality: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the JpegCompressionDistortion operation on the given cuda stream, writing into a caller-provided output image batch.

Parameters:
  • dst (nvcv.ImageBatchVarShape) – Output image batch; must match the input formats and sizes.

  • src (nvcv.ImageBatchVarShape) – Input image batch of uint8 images with 1 or 3 (RGB) channels.

  • quality (nvcv.Tensor) – Per-image JPEG quality, from 1 (strongest distortion) to 100 (weakest); rank-1 int32 tensor with one value per image. Values are clamped to [1, 100] on the device.

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

nvcv.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.jpeg_compression_distortion_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, quality: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the JpegCompressionDistortion operation on the given cuda stream, writing into a caller-provided output image batch.

Variable-shape overload applying one JPEG quality to the whole batch.

Parameters:
  • dst (nvcv.ImageBatchVarShape) – Output image batch; must match the input formats and sizes.

  • src (nvcv.ImageBatchVarShape) – Input image batch of uint8 images with 1 or 3 (RGB) channels.

  • quality (int) – JPEG quality applied to all images, from 1 (strongest distortion) to 100 (weakest). Must be in [1, 100].

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

nvcv.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.label(src: cvcuda.Tensor, connectivity: cvcuda.ConnectivityType = <ConnectivityType.CONNECTIVITY_4_2D: 0>, assign_labels: cvcuda.LABEL = <LABEL.FAST: 0>, mask_type: cvcuda.LabelMaskType = <LabelMaskType.REMOVE_ISLANDS_OUTSIDE_MASK_ONLY: 0>, *, count: bool = False, stats: bool = False, max_labels: typing.SupportsInt | typing.SupportsIndex = 10000, bg_label: cvcuda.Tensor | None = None, min_thresh: cvcuda.Tensor | None = None, max_thresh: cvcuda.Tensor | None = None, min_size: cvcuda.Tensor | None = None, mask: cvcuda.Tensor | None = None, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor | None, cvcuda.Tensor | None]

Executes the Label operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor to label connected-component regions.

  • connectivity (cvcuda.ConnectivityType, optional) – Choice to control connectivity of input elements, default is cvcuda.CONNECTIVITY_4_2D.

  • assign_labels (cvcuda.LABEL, optional) – Choice on how labels are assigned, default is cvcuda.LABEL.FAST.

  • mask_type (cvcuda.LabelMaskType, optional) – Choice on how the mask is used, default is cvcuda.REMOVE_ISLANDS_OUTSIDE_MASK_ONLY.

  • count (bool, optional) – Use True to return the count of valid labeled regions.

  • stats (bool, optional) – Use True to return the statistics of valid labeled regions.

  • max_labels (Number, optional) – Maximum number of labels to compute statistics for, default is 10000.

  • bg_label (cvcuda.Tensor, optional) – Background tensor to define input values to be considered background labels and thus ignored.

  • min_thresh (cvcuda.Tensor, optional) – Minimum threshold tensor to mask input values below it to be 0, and others 1.

  • max_thresh (cvcuda.Tensor, optional) – Maximum threshold tensor to mask input values above it to be 0, and others 1.

  • min_size (cvcuda.Tensor, optional) – Minimum size tensor to remove islands, i.e. labeled regions with number of elements less than the minimum size.

  • mask (cvcuda.Tensor, optional) – Mask tensor, its behavior is controlled by ref mask_type. One choice is to control island removal in addition to ref min_size, i.e. regions with at least one element inside the mask (non-zero values) are not removed in case mask_type is cvcuda.REMOVE_ISLANDS_OUTSIDE_MASK_ONLY.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with output labels, count of regions and their statistics.

The count or stats tensors may be None if theirs arguments are False.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Limitations

Input: Data Layout: [kHWC, kNHWC, kCHW, kNCHW, kDHWC, kNDHWC] and C-less HW/NHW/DHW/NDHW Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kHWC, kNHWC, kCHW, kNCHW, kDHWC, kNDHWC] and C-less HW/NHW/DHW/NDHW Channels: [1]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No

Number

Yes

Channels

Yes

Width

Yes

Height

Yes

Depth

Yes

cvcuda.label_into(dst: cvcuda.Tensor, count: cvcuda.Tensor | None = None, stats: cvcuda.Tensor | None = None, src: cvcuda.Tensor, connectivity: cvcuda.ConnectivityType = <ConnectivityType.CONNECTIVITY_4_2D: 0>, assign_labels: cvcuda.LABEL = <LABEL.FAST: 0>, mask_type: cvcuda.LabelMaskType = <LabelMaskType.REMOVE_ISLANDS_OUTSIDE_MASK_ONLY: 0>, *, bg_label: cvcuda.Tensor | None = None, min_thresh: cvcuda.Tensor | None = None, max_thresh: cvcuda.Tensor | None = None, min_size: cvcuda.Tensor | None = None, mask: cvcuda.Tensor | None = None, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor | None, cvcuda.Tensor | None]

Executes the Label operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor with labels.

  • count (cvcuda.Tensor, optional) – Output tensor with count number of labeled regions.

  • stats (cvcuda.Tensor, optional) – Output tensor with statistics for each labeled region.

  • src (cvcuda.Tensor) – Input tensor to label connected-component regions.

  • connectivity (cvcuda.ConnectivityType, optional) – Choice to control connectivity of input elements, default is cvcuda.CONNECTIVITY_4_2D.

  • assign_labels (cvcuda.LABEL, optional) – Choice on how labels are assigned, default is cvcuda.LABEL.FAST.

  • mask_type (cvcuda.LabelMaskType, optional) – Choice on how the mask is used, default is cvcuda.REMOVE_ISLANDS_OUTSIDE_MASK_ONLY.

  • bg_label (cvcuda.Tensor, optional) – Background tensor to define input values to be considered background labels and thus ignored.

  • min_thresh (cvcuda.Tensor, optional) – Minimum threshold tensor to mask input values below it to be 0, and others 1.

  • max_thresh (cvcuda.Tensor, optional) – Maximum threshold tensor to mask input values above it to be 0, and others 1.

  • min_size (cvcuda.Tensor, optional) – Minimum size tensor to remove islands, i.e. labeled regions with number of elements less than the minimum size.

  • mask (cvcuda.Tensor, optional) – Mask tensor, its behavior is controlled by ref mask_type. One choice is to control island removal in addition to ref min_size, i.e. regions with at least one element inside the mask (non-zero values) are not removed in case mask_type is cvcuda.REMOVE_ISLANDS_OUTSIDE_MASK_ONLY.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with output labels, count of regions and their statistics.

The count or stats tensors may be None if theirs arguments are None.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Limitations

Input: Data Layout: [kHWC, kNHWC, kCHW, kNCHW, kDHWC, kNDHWC] and C-less HW/NHW/DHW/NDHW Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kHWC, kNHWC, kCHW, kNCHW, kDHWC, kNDHWC] and C-less HW/NHW/DHW/NDHW Channels: [1]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

Property

Input == Out

Data Layout

Yes

Data Type

No

Number

Yes

Channels

Yes

Width

Yes

Height

Yes

Depth

Yes

cvcuda.laplacian(src: cvcuda.Tensor, ksize: typing.SupportsInt | typing.SupportsIndex, scale: typing.SupportsFloat | typing.SupportsIndex = 1.0, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Laplacian operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • ksize (int) – Aperture size used to compute the second-derivative filters, it can be 1 or 3.

  • scale (float) – Scale factor for the Laplacian values (use 1 for no scale).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.laplacian(src: cvcuda.ImageBatchVarShape, ksize: cvcuda.Tensor, scale: cvcuda.Tensor, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Laplacian operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • ksize (cvcuda.Tensor) – Aperture size used to compute the second-derivative filters, it can be 1 or 3 for each image.

  • scale (cvcuda.Tensor) – Scale factor for the Laplacian values (use 1 for no scale) for each image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.laplacian_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, ksize: typing.SupportsInt | typing.SupportsIndex, scale: typing.SupportsFloat | typing.SupportsIndex = 1.0, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Laplacian operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • ksize (int) – Aperture size used to compute the second-derivative filters, it can be 1 or 3.

  • scale (float) – Scale factor for the Laplacian values (use 1 for no scale).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.laplacian_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, ksize: cvcuda.Tensor, scale: cvcuda.Tensor, border: cvcuda.Border = <Border.CONSTANT: 0>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Laplacian operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • ksize (cvcuda.Tensor) – Aperture size used to compute the second-derivative filters, it can be 1 or 3 for each image.

  • scale (cvcuda.Tensor) – Scale factor for the Laplacian values (use 1 for no scale) for each image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4 Planar tensors must be tightly packed with N*C <= 65535.

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.match(set1: cvcuda.Tensor, set2: cvcuda.Tensor, num_set1: cvcuda.Tensor | None = None, num_set2: cvcuda.Tensor | None = None, num_matches: bool | None = None, distances: bool = False, cross_check: bool = False, matches_per_point: typing.SupportsInt | typing.SupportsIndex = 1, norm_type: cvcuda.Norm | None = None, algo_choice: cvcuda.Matcher = <Matcher.BRUTE_FORCE: 0>, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor | None, cvcuda.Tensor | None]

Executes the Pairwise matcher operation on the given CUDA stream.

Parameters:
  • set1 (cvcuda.Tensor) – Input tensor with 1st set of points.

  • set2 (cvcuda.Tensor) – Input tensor with 2nd set of points.

  • num_set1 (cvcuda.Tensor, optional) – Input tensor with number of valid points in the 1st set. If not provided, consider the entire set1 containing valid points.

  • num_set2 (cvcuda.Tensor, optional) – Input tensor with number of valid points in the 2nd set. If not provided, consider the entire set2 containing valid points.

  • num_matches (bool, optional) – Use True to return the number of matches. If not provided, it is set to True if crossCheck=True and False otherwise.

  • distances (bool, optional) – Use True to return the match distances.

  • cross_check (bool, optional) – Use True to cross check best matches, a best match is only returned if it is the best match (minimum distance) from 1st set to 2nd set and vice versa.

  • matches_per_point (Number, optional) – Number of best matches to return per point.

  • norm_type (cvcuda.Norm, optional) – Choice on how distances are normalized. Defaults to cvcuda.Norm.L2.

  • algo_choice (cvcuda.Matcher, optional) – Choice of the algorithm to perform the match.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with output matches, number of matches and their distances.

The number of matches tensor may be None if its argument is False. The distances tensor may be None if its argument is False.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.match_into(matches: cvcuda.Tensor, num_matches: cvcuda.Tensor | None = None, distances: cvcuda.Tensor | None = None, set1: cvcuda.Tensor, set2: cvcuda.Tensor, num_set1: cvcuda.Tensor | None = None, num_set2: cvcuda.Tensor | None = None, cross_check: bool = False, matches_per_point: typing.SupportsInt | typing.SupportsIndex = 1, norm_type: cvcuda.Norm | None = None, algo_choice: cvcuda.Matcher = <Matcher.BRUTE_FORCE: 0>, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor | None, cvcuda.Tensor | None]

Executes the Pairwise matcher operation on the given CUDA stream.

Parameters:
  • matches (cvcuda.Tensor) – Output tensor with matches.

  • num_matches (cvcuda.Tensor, optional) – Output tensor with number of matches.

  • distances (cvcuda.Tensor, optional) – Output tensor with match distances.

  • set1 (cvcuda.Tensor) – Input tensor with 1st set of points.

  • set2 (cvcuda.Tensor) – Input tensor with 2nd set of points.

  • num_set1 (cvcuda.Tensor, optional) – Input tensor with number of valid points in the 1st set. If not provided, consider the entire set1 containing valid points.

  • num_set2 (cvcuda.Tensor, optional) – Input tensor with number of valid points in the 2nd set. If not provided, consider the entire set2 containing valid points.

  • cross_check (bool, optional) – Use True to cross check best matches, a best match is only returned if it is the best match (minimum distance) from 1st set to 2nd set and vice versa.

  • matches_per_point (Number, optional) – Number of best matches to return per point.

  • norm_type (cvcuda.Norm, optional) – Choice on how distances are normalized. Defaults to cvcuda.Norm.L2.

  • algo_choice (cvcuda.Matcher, optional) – Choice of the algorithm to perform the match.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with output matches, number of matches and their distances.

The number of matches tensor may be None if its argument is None. The distances tensor may be None if its argument is None.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.max_loc(src: cvcuda.Tensor, max_locations: SupportsInt | SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds maximum values and locations on the input tensor.

Parameters:
  • src (cvcuda.Tensor) – Input tensor to get minimum/maximum values/locations.

  • max_locations (Number, optional) – Number of maximum locations to find, default is 1% of total pixels at a minimum of 1.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with

maximum value, locations and number of maxima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.max_loc(src: cvcuda.ImageBatchVarShape, max_locations: SupportsInt | SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds maximum values and locations on the input image batch.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch to get minimum/maximum values/locations.

  • max_locations (Number, optional) – Number of maximum locations to find, default is 1% of total pixels at a minimum of 1.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with

maximum value, locations and number of maxima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.max_loc_into(max_val: cvcuda.Tensor, max_loc: cvcuda.Tensor, num_max: cvcuda.Tensor, src: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds maximum values and locations on the input tensor.

Parameters:
  • max_val (cvcuda.Tensor) – Output tensor with maximum value.

  • max_loc (cvcuda.Tensor) – Output tensor with maximum locations.

  • num_max (cvcuda.Tensor) – Output tensor with number of maximum locations found.

  • src (cvcuda.Tensor) – Input tensor to get minimum/maximum values/locations.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with

maximum value, locations and number of maxima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.max_loc_into(max_val: cvcuda.Tensor, max_loc: cvcuda.Tensor, num_max: cvcuda.Tensor, src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds maximum values and locations on the input image batch.

Parameters:
  • max_val (cvcuda.Tensor) – Output tensor with maximum value.

  • max_loc (cvcuda.Tensor) – Output tensor with maximum locations.

  • num_max (cvcuda.Tensor) – Output tensor with number of maximum locations found.

  • src (cvcuda.ImageBatchVarShape) – Input image batch to get minimum/maximum values/locations.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with

maximum value, locations and number of maxima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.median_blur(src: cvcuda.Tensor, ksize: tuple[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex], *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Median Blur operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • ksize (Tuple[int, int]) – Width and Height of the kernel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.median_blur(src: cvcuda.ImageBatchVarShape, ksize: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Median Blur operation on the given cuda stream.

Parameters:
Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.median_blur_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, ksize: tuple[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex], *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Median Blur operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • ksize (Tuple[int, int]) – Width and Height of the kernel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.median_blur_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, ksize: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Median Blur operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.minarearect(src: cvcuda.Tensor, numPointsInContour: cvcuda.Tensor, totalContours: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Min Area Rect operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more contours.src[i,j,k] is the set of contours where i ranges from 0 to batch-1, j ranges from 0 to max number of points in cotours k is the coordinate of each points which is in [0,1]

  • numPointsInContour (cvcuda.Tensor) – Input tensor containing the number of points in each input contours.

  • totalContours (int) – Number of input contours

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor of rotated bounding boxes.The output will give 4 points’ cooridinate(x,y) of each contour’s minimum rotated bounding boxes

Return type:

cvcuda.Tensor

Limitations

Planar image layouts: Not applicable Reason: Inputs are contour-coordinate tensors and outputs are rectangle parameters, not images.

Input: Data Layout: [NWC] Channels: [2]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [NW] Channels: [1]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | No
 Number        | No
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.minarearect_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, numPointsInContour: cvcuda.Tensor, totalContours: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Min Area Rect operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor will give 4 points’ cooridinate(x,y) of each contour’s minimum rotated bounding boxes

  • src (cvcuda.Tensor) – Input tensor containing one or more contours. src[i,j,k] is the set of contours where i ranges from 0 to batch-1, j ranges from 0 to max number of points in cotours k is the coordinate of each points which is in [0,1]

  • numPointsInContour (cvcuda.Tensor) – Input tensor containing the number of points in each input contours.

  • totalContours (int) – Number of input contours

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

  • stream – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Planar image layouts: Not applicable Reason: Inputs are contour-coordinate tensors and outputs are rectangle parameters, not images.

Input: Data Layout: [NWC] Channels: [2]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [NW] Channels: [1]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | No
 Number        | No
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.min_loc(src: cvcuda.Tensor, max_locations: SupportsInt | SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds minimum values and locations on the input tensor.

Parameters:
  • src (cvcuda.Tensor) – Input tensor to get minimum/maximum values/locations.

  • max_locations (Number, optional) – Number of maximum locations to find, default is 1% of total pixels at a minimum of 1.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with

minimum value, locations and number of minima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.min_loc(src: cvcuda.ImageBatchVarShape, max_locations: SupportsInt | SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds minimum values and locations on the input image batch.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch to get minimum/maximum values/locations.

  • max_locations (Number, optional) – Number of maximum locations to find, default is 1% of total pixels at a minimum of 1.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with

minimum value, locations and number of minima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.min_loc_into(min_val: cvcuda.Tensor, min_loc: cvcuda.Tensor, num_min: cvcuda.Tensor, src: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds minimum values and locations on the input tensor.

Parameters:
  • min_val (cvcuda.Tensor) – Output tensor with minimum value.

  • min_loc (cvcuda.Tensor) – Output tensor with minimum locations.

  • num_min (cvcuda.Tensor) – Output tensor with number of minimum locations found.

  • src (cvcuda.Tensor) – Input tensor to get minimum/maximum values/locations.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with

minimum value, locations and number of minima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.min_loc_into(min_val: cvcuda.Tensor, min_loc: cvcuda.Tensor, num_min: cvcuda.Tensor, src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds minimum values and locations on the input image batch.

Parameters:
  • min_val (cvcuda.Tensor) – Output tensor with minimum value.

  • min_loc (cvcuda.Tensor) – Output tensor with minimum locations.

  • num_min (cvcuda.Tensor) – Output tensor with number of minimum locations found.

  • src (cvcuda.ImageBatchVarShape) – Input image batch to get minimum/maximum values/locations.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with

minimum value, locations and number of minima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.min_max_loc(src: cvcuda.Tensor, max_locations: SupportsInt | SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds minimum/maximum values and locations on the input tensor.

Parameters:
  • src (cvcuda.Tensor) – Input tensor to get minimum/maximum values/locations.

  • max_locations (Number, optional) – Number of maximum locations to find, default is 1% of total pixels at a minimum of 1.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with minimum

value, locations and number of minima, and also maximum value, locations and number of maxima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.min_max_loc(src: cvcuda.ImageBatchVarShape, max_locations: SupportsInt | SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds minimum/maximum values and locations on the input image batch.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch to get minimum/maximum values/locations.

  • max_locations (Number, optional) – Number of maximum locations to find, default is 1% of total pixels at a minimum of 1.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with minimum

value, locations and number of minima, and also maximum value, locations and number of maxima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.min_max_loc_into(min_val: cvcuda.Tensor, min_loc: cvcuda.Tensor, num_min: cvcuda.Tensor, max_val: cvcuda.Tensor, max_loc: cvcuda.Tensor, num_max: cvcuda.Tensor, src: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds minimum/maximum values and locations on the input tensor.

Parameters:
  • min_val (cvcuda.Tensor) – Output tensor with minimum value.

  • min_loc (cvcuda.Tensor) – Output tensor with minimum locations.

  • num_min (cvcuda.Tensor) – Output tensor with number of minimum locations found.

  • max_val (cvcuda.Tensor) – Output tensor with maximum value.

  • max_loc (cvcuda.Tensor) – Output tensor with maximum locations.

  • num_max (cvcuda.Tensor) – Output tensor with number of maximum locations found.

  • src (cvcuda.Tensor) – Input tensor to get minimum/maximum values/locations.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with minimum

value, locations and number of minima, and also maximum value, locations and number of maxima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.min_max_loc_into(min_val: cvcuda.Tensor, min_loc: cvcuda.Tensor, num_min: cvcuda.Tensor, max_val: cvcuda.Tensor, max_loc: cvcuda.Tensor, num_max: cvcuda.Tensor, src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Finds minimum/maximum values and locations on the input image batch.

Parameters:
  • min_val (cvcuda.Tensor) – Output tensor with minimum value.

  • min_loc (cvcuda.Tensor) – Output tensor with minimum locations.

  • num_min (cvcuda.Tensor) – Output tensor with number of minimum locations found.

  • max_val (cvcuda.Tensor) – Output tensor with maximum value.

  • max_loc (cvcuda.Tensor) – Output tensor with maximum locations.

  • num_max (cvcuda.Tensor) – Output tensor with number of maximum locations found.

  • src (cvcuda.ImageBatchVarShape) – Input image batch to get minimum/maximum values/locations.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with minimum

value, locations and number of minima, and also maximum value, locations and number of maxima.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.morphology(src: cvcuda.Tensor, morphologyType: cvcuda.MorphologyType, maskSize: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], anchor: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], *, workspace: cvcuda.Tensor | None = None, iteration: typing.SupportsInt | typing.SupportsIndex = 1, border: cvcuda.Border = <Border.CONSTANT: 0>, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Morphology operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • morphologyType (cvcuda.MorphologyType) – Type of operation to perform (e.g. cvcuda.MorphologyType.ERODE or cvcuda.MorphologyType.DILATE).

  • maskSize (Tuple[int, int]) – Mask width and height for morphology operation.

  • anchor (Tuple[int, int]) – X,Y offset of kernel, use -1,-1 for center.

  • workspace (cvcuda.Tensor, optional) – Workspace tensor for intermediate results, must be the same size as src. Can be omitted if operation is Dilate/Erode with iteration = 1.

  • iteration (int, optional) – Number of times to run the kernel.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaMorphologySubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Applies to ``cvcudaMorphologyVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes (per image in/out pair)
 Height        | Yes (per image in/out pair)
cvcuda.morphology(src: cvcuda.ImageBatchVarShape, morphologyType: cvcuda.MorphologyType, masks: cvcuda.Tensor, anchors: cvcuda.Tensor, *, workspace: cvcuda.ImageBatchVarShape | None = None, iteration: typing.SupportsInt | typing.SupportsIndex = 1, border: cvcuda.Border = <Border.CONSTANT: 0>, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Morphology operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • morphologyType (cvcuda.MorphologyType) – Type of operation to perform (e.g. cvcuda.MorphologyType.ERODE or cvcuda.MorphologyType.DILATE).

  • maskSize (cvcuda.Tensor) – Mask width and height for morphology operation for every image.

  • anchor (cvcuda.Tensor) – X,Y offset of kernel for every image, use -1,-1 for center.

  • workspace (cvcuda.ImageBatchVarShape, optional) – Workspace tensor for intermediate results, must be the same size as src. Can be omitted if operation is Dilate/Erode with iteration = 1.

  • iteration (int, optional) – Number of times to run the kernel.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaMorphologySubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Applies to ``cvcudaMorphologyVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes (per image in/out pair)
 Height        | Yes (per image in/out pair)
cvcuda.morphology_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, morphologyType: cvcuda.MorphologyType, maskSize: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], anchor: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], *, workspace: cvcuda.Tensor | None = None, iteration: typing.SupportsInt | typing.SupportsIndex = 1, border: cvcuda.Border = <Border.CONSTANT: 0>, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Morphology operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • morphologyType (cvcuda.MorphologyType) – Type of operation to perform (e.g. cvcuda.MorphologyType.ERODE or cvcuda.MorphologyType.DILATE).

  • maskSize (Tuple[int, int]) – Mask width and height for morphology operation.

  • anchor (Tuple[int, int]) – X,Y offset of kernel, use -1,-1 for center.

  • workspace (cvcuda.Tensor, optional) – Workspace tensor for intermediate results, must be the same size as src. Can be omitted if operation is Dilate/Erode with iteration = 1.

  • iteration (int, optional) – Number of times to run the kernel.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaMorphologySubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Applies to ``cvcudaMorphologyVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes (per image in/out pair)
 Height        | Yes (per image in/out pair)
cvcuda.morphology_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, morphologyType: cvcuda.MorphologyType, masks: cvcuda.Tensor, anchors: cvcuda.Tensor, *, workspace: cvcuda.ImageBatchVarShape | None = None, iteration: typing.SupportsInt | typing.SupportsIndex = 1, border: cvcuda.Border = <Border.CONSTANT: 0>, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Morphology operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • morphologyType (cvcuda.MorphologyType) – Type of operation to perform (e.g. cvcuda.MorphologyType.ERODE or cvcuda.MorphologyType.DILATE).

  • maskSize (cvcuda.Tensor) – Mask width and height for morphology operation for every image.

  • anchor (cvcuda.Tensor) – X,Y offset of kernel for every image, use -1,-1 for center.

  • workspace (cvcuda.ImageBatchVarShape, optional) – Workspace tensor for intermediate results, must be the same size as src. Can be omitted if operation is Dilate/Erode with iteration = 1.

  • iteration (int, optional) – Number of times to run the kernel.

  • border (cvcuda.Border, optional) – Border mode to be used when accessing elements outside input image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaMorphologySubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Applies to ``cvcudaMorphologyVarShapeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: 1, 3, 4

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes (per image in/out pair)
 Height        | Yes (per image in/out pair)
cvcuda.nms(src: cvcuda.Tensor, scores: cvcuda.Tensor, score_threshold: SupportsFloat | SupportsIndex = 1.1920928955078125e-07, iou_threshold: SupportsFloat | SupportsIndex = 1.0, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes NMS.

The Non-Maximum Suppression (NMS) operation reads a set of input bounding boxes (bboxes) proposals and their scores and writes an output boolean mask with suppressed bboxes as zeros and selected bboxes as ones.

Parameters:
  • src (cvcuda.Tensor) – src[i, j] is the set of input bounding box proposals for an image where i ranges from 0 to batch-1, j ranges from 0 to number of bounding box proposals anchored at the top-left of the bounding box area

  • scores (cvcuda.Tensor) – scores[i, j] are the associated scores for each bounding box proposal in src considered during the reduce operation of NMS

  • score_threshold (float) – Minimum score of a bounding box proposals

  • iou_threshold (float) – Maximum overlap between bounding box proposals covering the same effective image region as calculated by Intersection-over-Union (IoU)

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor of selected bounding boxes.

Return type:

cvcuda.Tensor

Limitations

Planar image layouts: Not applicable Reason: Inputs are bounding-box and score tensors and outputs are selection masks, not images.

Input: Data Layout: [NW] Channel count: [4]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [NW] Channel count: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | No
 Batches (N)   | Yes
 Bboxes (W)    | Yes
 Channels      | No
cvcuda.nms_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, scores: cvcuda.Tensor, score_threshold: SupportsFloat | SupportsIndex = 1.1920928955078125e-07, iou_threshold: SupportsFloat | SupportsIndex = 1.0, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes NMS.

The Non-Maximum Suppression (NMS) operation reads a set of input bounding boxes (bboxes) proposals and their scores and writes an output boolean mask with suppressed bboxes as zeros and selected bboxes as ones.

Parameters:
  • dst (cvcuda.Tensor) – dst[i, j] is the output boolean mask marking selected bounding boxes, where i ranges from 0 to batch-1, j ranges from 0 to the number of bounding box proposals anchored at the top-left of the bounding box area

  • src (cvcuda.Tensor) – src[i, j] is the set of input bounding box proposals for an image where i ranges from 0 to batch-1, j ranges from 0 to number of bounding box proposals anchored at the top-left of the bounding box area

  • scores (cvcuda.Tensor) – scores[i, j] are the associated scores for each bounding box proposal in src considered during the reduce operation of NMS

  • score_threshold (float) – Minimum score of a bounding box proposals

  • iou_threshold (float) – Maximum overlap between bounding box proposals covering the same effective image region as calculated by Intersection-over-Union (IoU)

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Planar image layouts: Not applicable Reason: Inputs are bounding-box and score tensors and outputs are selection masks, not images.

Input: Data Layout: [NW] Channel count: [4]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [NW] Channel count: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | No
 Batches (N)   | Yes
 Bboxes (W)    | Yes
 Channels      | No
cvcuda.normalize(src: cvcuda.Tensor, base: cvcuda.Tensor, scale: cvcuda.Tensor, flags: SupportsInt | SupportsIndex | None = None, *, globalscale: SupportsFloat | SupportsIndex = 1.0, globalshift: SupportsFloat | SupportsIndex = 0.0, epsilon: SupportsFloat | SupportsIndex = 0.0, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Normalize operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • base (cvcuda.Tensor) – Tensor providing base values for normalization.

  • scale (cvcuda.Tensor) – Tensor providing scale values for normalization.

  • flags (int, optional) – Algorithm flags, use cvcuda.NormalizeFlags.SCALE_IS_STDDEV if scale passed as argument is standard deviation instead or 0 if it is scaling.

  • globalscale (float, optional) – Additional scale value to be used in addition to scale.

  • globalshift (float, optional) – Additional bias value to be used in addition to base.

  • epsilon (float, optional) – Epsilon to use when cvcuda.NormalizeFlags.SCALE_IS_STDDEV flag is set as a regularizing term to be added to variance.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaNormalizeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Scale/Base Tensor:

Scale and Base may be a tensor the same shape as the input/output tensors, or it can be a scalar each dimension.
Dimensions with extent 1 are broadcast over the corresponding input axis.

For varshape variant with interleaved input, scale and base may represent either a scalar with shape [1,1,1,1],
or a tensor with shape [1,1,1,C], where C is the number of channels in the input format. Varshape scale and
base are always broadcast over the image batch.

For planar (kNCHW / kCHW) tensor input, scale and base must use a planar layout that matches the input
for non-scalar parameters (e.g. [1,C,1,1] for per-channel parameters). Tensor input supports the same
per-axis broadcasting rule above. For planar varshape input, scale and base must be batch and spatial
broadcasted, so use [1,1,1,1] for scalar parameters or [1,C,1,1] for per-channel parameters. A truly
scalar parameter tensor (numChannels == 1) is also accepted in either layout because both encode the same
bytes.

Applies to ``cvcudaNormalizeScalarSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Base/Scale:

Base and scale are supplied by value (up to four channels packed in a float4). Each may represent
a scalar broadcast over every channel (baseChannels / scaleChannels == 1) or a per-channel value
(count equal to the number of channels in the input). Interleaved (kNHWC / kHWC) and planar
(kNCHW / kCHW) tensor input are both supported. Unlike #cvcudaNormalizeSubmit, per-axis spatial
(width/height) parameters are not available; use #cvcudaNormalizeSubmit with parameter tensors
for spatial parameters. CUDA launch limits require N <= 65535 for interleaved input and
N*C <= 65535 for planar input.
cvcuda.normalize(src: cvcuda.ImageBatchVarShape, base: cvcuda.Tensor, scale: cvcuda.Tensor, flags: SupportsInt | SupportsIndex | None = None, *, globalscale: SupportsFloat | SupportsIndex = 1.0, globalshift: SupportsFloat | SupportsIndex = 0.0, epsilon: SupportsFloat | SupportsIndex = 0.0, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Normalize operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • base (cvcuda.Tensor) – Tensor providing base values for normalization.

  • scale (cvcuda.Tensor) – Tensor providing scale values for normalization.

  • flags (int, optional) – Algorithm flags, use cvcuda.NormalizeFlags.SCALE_IS_STDDEV if scale passed as argument is standard deviation instead or 0 if it is scaling.

  • globalscale (float, optional) – Additional scale value to be used in addition to scale.

  • globalshift (float, optional) – Additional bias value to be used in addition to base.

  • epsilon (float, optional) – Epsilon to use when cvcuda.NormalizeFlags.SCALE_IS_STDDEV flag is set as a regularizing term to be added to variance.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaNormalizeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Scale/Base Tensor:

Scale and Base may be a tensor the same shape as the input/output tensors, or it can be a scalar each dimension.
Dimensions with extent 1 are broadcast over the corresponding input axis.

For varshape variant with interleaved input, scale and base may represent either a scalar with shape [1,1,1,1],
or a tensor with shape [1,1,1,C], where C is the number of channels in the input format. Varshape scale and
base are always broadcast over the image batch.

For planar (kNCHW / kCHW) tensor input, scale and base must use a planar layout that matches the input
for non-scalar parameters (e.g. [1,C,1,1] for per-channel parameters). Tensor input supports the same
per-axis broadcasting rule above. For planar varshape input, scale and base must be batch and spatial
broadcasted, so use [1,1,1,1] for scalar parameters or [1,C,1,1] for per-channel parameters. A truly
scalar parameter tensor (numChannels == 1) is also accepted in either layout because both encode the same
bytes.

Applies to ``cvcudaNormalizeScalarSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Base/Scale:

Base and scale are supplied by value (up to four channels packed in a float4). Each may represent
a scalar broadcast over every channel (baseChannels / scaleChannels == 1) or a per-channel value
(count equal to the number of channels in the input). Interleaved (kNHWC / kHWC) and planar
(kNCHW / kCHW) tensor input are both supported. Unlike #cvcudaNormalizeSubmit, per-axis spatial
(width/height) parameters are not available; use #cvcudaNormalizeSubmit with parameter tensors
for spatial parameters. CUDA launch limits require N <= 65535 for interleaved input and
N*C <= 65535 for planar input.
cvcuda.normalize(src: cvcuda.Tensor, base: collections.abc.Sequence[SupportsFloat | SupportsIndex], scale: collections.abc.Sequence[SupportsFloat | SupportsIndex], flags: SupportsInt | SupportsIndex | None = None, *, globalscale: SupportsFloat | SupportsIndex = 1.0, globalshift: SupportsFloat | SupportsIndex = 0.0, epsilon: SupportsFloat | SupportsIndex = 0.0, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Normalize operation on the given cuda stream.

base and scale are given by value as Python lists/tuples of floats (not tensors), so no parameter tensor is allocated or uploaded; interleaved (NHWC/HWC) and planar (NCHW/CHW) input are both supported.

Parameters:
  • src (cvcuda.Tensor) – Tensor of input images.

  • base (List[float]) – One broadcast base or one base per channel.

  • scale (List[float]) – One broadcast scale or one scale per channel.

  • flags (int, optional) – Set cvcuda.NormalizeFlags.SCALE_IS_STDDEV when scale represents standard deviation; otherwise use 0.

  • globalscale (float, optional) – Scale applied in addition to the per-channel scale.

  • globalshift (float, optional) – Bias applied in addition to the per-channel base.

  • epsilon (float, optional) – Variance regularizer used with cvcuda.NormalizeFlags.SCALE_IS_STDDEV.

  • stream (cvcuda.Stream, optional) – CUDA stream used to run the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaNormalizeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Scale/Base Tensor:

Scale and Base may be a tensor the same shape as the input/output tensors, or it can be a scalar each dimension.
Dimensions with extent 1 are broadcast over the corresponding input axis.

For varshape variant with interleaved input, scale and base may represent either a scalar with shape [1,1,1,1],
or a tensor with shape [1,1,1,C], where C is the number of channels in the input format. Varshape scale and
base are always broadcast over the image batch.

For planar (kNCHW / kCHW) tensor input, scale and base must use a planar layout that matches the input
for non-scalar parameters (e.g. [1,C,1,1] for per-channel parameters). Tensor input supports the same
per-axis broadcasting rule above. For planar varshape input, scale and base must be batch and spatial
broadcasted, so use [1,1,1,1] for scalar parameters or [1,C,1,1] for per-channel parameters. A truly
scalar parameter tensor (numChannels == 1) is also accepted in either layout because both encode the same
bytes.

Applies to ``cvcudaNormalizeScalarSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Base/Scale:

Base and scale are supplied by value (up to four channels packed in a float4). Each may represent
a scalar broadcast over every channel (baseChannels / scaleChannels == 1) or a per-channel value
(count equal to the number of channels in the input). Interleaved (kNHWC / kHWC) and planar
(kNCHW / kCHW) tensor input are both supported. Unlike #cvcudaNormalizeSubmit, per-axis spatial
(width/height) parameters are not available; use #cvcudaNormalizeSubmit with parameter tensors
for spatial parameters. CUDA launch limits require N <= 65535 for interleaved input and
N*C <= 65535 for planar input.
cvcuda.normalize_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, base: cvcuda.Tensor, scale: cvcuda.Tensor, flags: SupportsInt | SupportsIndex | None = None, *, globalscale: SupportsFloat | SupportsIndex = 1.0, globalshift: SupportsFloat | SupportsIndex = 0.0, epsilon: SupportsFloat | SupportsIndex = 0.0, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Normalize operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • base (cvcuda.Tensor) – Tensor providing base values for normalization.

  • scale (cvcuda.Tensor) – Tensor providing scale values for normalization.

  • flags (int, optional) – Algorithm flags, use cvcuda.NormalizeFlags.SCALE_IS_STDDEV if scale passed as argument is standard deviation instead or 0 if it is scaling.

  • globalscale (float, optional) – Additional scale value to be used in addition to scale.

  • globalshift (float, optional) – Additional bias value to be used in addition to base.

  • epsilon (float, optional) – Epsilon to use when cvcuda.NormalizeFlags.SCALE_IS_STDDEV flag is set as a regularizing term to be added to variance.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaNormalizeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Scale/Base Tensor:

Scale and Base may be a tensor the same shape as the input/output tensors, or it can be a scalar each dimension.
Dimensions with extent 1 are broadcast over the corresponding input axis.

For varshape variant with interleaved input, scale and base may represent either a scalar with shape [1,1,1,1],
or a tensor with shape [1,1,1,C], where C is the number of channels in the input format. Varshape scale and
base are always broadcast over the image batch.

For planar (kNCHW / kCHW) tensor input, scale and base must use a planar layout that matches the input
for non-scalar parameters (e.g. [1,C,1,1] for per-channel parameters). Tensor input supports the same
per-axis broadcasting rule above. For planar varshape input, scale and base must be batch and spatial
broadcasted, so use [1,1,1,1] for scalar parameters or [1,C,1,1] for per-channel parameters. A truly
scalar parameter tensor (numChannels == 1) is also accepted in either layout because both encode the same
bytes.

Applies to ``cvcudaNormalizeScalarSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Base/Scale:

Base and scale are supplied by value (up to four channels packed in a float4). Each may represent
a scalar broadcast over every channel (baseChannels / scaleChannels == 1) or a per-channel value
(count equal to the number of channels in the input). Interleaved (kNHWC / kHWC) and planar
(kNCHW / kCHW) tensor input are both supported. Unlike #cvcudaNormalizeSubmit, per-axis spatial
(width/height) parameters are not available; use #cvcudaNormalizeSubmit with parameter tensors
for spatial parameters. CUDA launch limits require N <= 65535 for interleaved input and
N*C <= 65535 for planar input.
cvcuda.normalize_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, base: cvcuda.Tensor, scale: cvcuda.Tensor, flags: SupportsInt | SupportsIndex | None = None, *, globalscale: SupportsFloat | SupportsIndex = 1.0, globalshift: SupportsFloat | SupportsIndex = 0.0, epsilon: SupportsFloat | SupportsIndex = 0.0, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Normalize operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • base (cvcuda.Tensor) – Tensor providing base values for normalization.

  • scale (cvcuda.Tensor) – Tensor providing scale values for normalization.

  • flags (int, optional) – Algorithm flags, use cvcuda.NormalizeFlags.SCALE_IS_STDDEV if scale passed as argument is standard deviation instead or 0 if it is scaling.

  • globalscale (float, optional) – Additional scale value to be used in addition to scale.

  • globalshift (float, optional) – Additional bias value to be used in addition to base.

  • epsilon (float, optional) – Epsilon to use when cvcuda.NormalizeFlags.SCALE_IS_STDDEV flag is set as a regularizing term to be added to variance.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Applies to ``cvcudaNormalizeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Scale/Base Tensor:

Scale and Base may be a tensor the same shape as the input/output tensors, or it can be a scalar each dimension.
Dimensions with extent 1 are broadcast over the corresponding input axis.

For varshape variant with interleaved input, scale and base may represent either a scalar with shape [1,1,1,1],
or a tensor with shape [1,1,1,C], where C is the number of channels in the input format. Varshape scale and
base are always broadcast over the image batch.

For planar (kNCHW / kCHW) tensor input, scale and base must use a planar layout that matches the input
for non-scalar parameters (e.g. [1,C,1,1] for per-channel parameters). Tensor input supports the same
per-axis broadcasting rule above. For planar varshape input, scale and base must be batch and spatial
broadcasted, so use [1,1,1,1] for scalar parameters or [1,C,1,1] for per-channel parameters. A truly
scalar parameter tensor (numChannels == 1) is also accepted in either layout because both encode the same
bytes.

Applies to ``cvcudaNormalizeScalarSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Base/Scale:

Base and scale are supplied by value (up to four channels packed in a float4). Each may represent
a scalar broadcast over every channel (baseChannels / scaleChannels == 1) or a per-channel value
(count equal to the number of channels in the input). Interleaved (kNHWC / kHWC) and planar
(kNCHW / kCHW) tensor input are both supported. Unlike #cvcudaNormalizeSubmit, per-axis spatial
(width/height) parameters are not available; use #cvcudaNormalizeSubmit with parameter tensors
for spatial parameters. CUDA launch limits require N <= 65535 for interleaved input and
N*C <= 65535 for planar input.
cvcuda.normalize_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, base: collections.abc.Sequence[SupportsFloat | SupportsIndex], scale: collections.abc.Sequence[SupportsFloat | SupportsIndex], flags: SupportsInt | SupportsIndex | None = None, *, globalscale: SupportsFloat | SupportsIndex = 1.0, globalshift: SupportsFloat | SupportsIndex = 0.0, epsilon: SupportsFloat | SupportsIndex = 0.0, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Normalize operation on the given cuda stream.

base and scale are given by value as Python lists/tuples of floats (not tensors), so no parameter tensor is allocated or uploaded; interleaved (NHWC/HWC) and planar (NCHW/CHW) input are both supported.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • base (List[float]) – Base values for normalization: length 1 (broadcast) or the channel count.

  • scale (List[float]) – Scale values for normalization: length 1 (broadcast) or the channel count.

  • flags (int, optional) – Algorithm flags, use cvcuda.NormalizeFlags.SCALE_IS_STDDEV if scale passed as argument is standard deviation instead or 0 if it is scaling.

  • globalscale (float, optional) – Additional scale value to be used in addition to scale.

  • globalshift (float, optional) – Additional bias value to be used in addition to base.

  • epsilon (float, optional) – Epsilon to use when cvcuda.NormalizeFlags.SCALE_IS_STDDEV flag is set as a regularizing term to be added to variance.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Applies to ``cvcudaNormalizeSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Scale/Base Tensor:

Scale and Base may be a tensor the same shape as the input/output tensors, or it can be a scalar each dimension.
Dimensions with extent 1 are broadcast over the corresponding input axis.

For varshape variant with interleaved input, scale and base may represent either a scalar with shape [1,1,1,1],
or a tensor with shape [1,1,1,C], where C is the number of channels in the input format. Varshape scale and
base are always broadcast over the image batch.

For planar (kNCHW / kCHW) tensor input, scale and base must use a planar layout that matches the input
for non-scalar parameters (e.g. [1,C,1,1] for per-channel parameters). Tensor input supports the same
per-axis broadcasting rule above. For planar varshape input, scale and base must be batch and spatial
broadcasted, so use [1,1,1,1] for scalar parameters or [1,C,1,1] for per-channel parameters. A truly
scalar parameter tensor (numChannels == 1) is also accepted in either layout because both encode the same
bytes.

Applies to ``cvcudaNormalizeScalarSubmit``:

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Base/Scale:

Base and scale are supplied by value (up to four channels packed in a float4). Each may represent
a scalar broadcast over every channel (baseChannels / scaleChannels == 1) or a per-channel value
(count equal to the number of channels in the input). Interleaved (kNHWC / kHWC) and planar
(kNCHW / kCHW) tensor input are both supported. Unlike #cvcudaNormalizeSubmit, per-axis spatial
(width/height) parameters are not available; use #cvcudaNormalizeSubmit with parameter tensors
for spatial parameters. CUDA launch limits require N <= 65535 for interleaved input and
N*C <= 65535 for planar input.
cvcuda.osd(src: cvcuda.Tensor, elements: cvcuda.Elements, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the OSD operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • elements (cvcuda.Elements) – OSD elements in reference to the input tensor.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.osd_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, elements: cvcuda.Elements, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the OSD operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • elements (cvcuda.Elements) – OSD elements in reference to the input tensor.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.padandstack(src: cvcuda.ImageBatchVarShape, top: cvcuda.Tensor, left: cvcuda.Tensor, border: cvcuda.Border = <Border.CONSTANT: 0>, bvalue: typing.SupportsFloat | typing.SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Pad and Stack operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – input image batch containing one or more images.

  • top (cvcuda.Tensor) – Top tensor to store amount of top padding per batch input image.

  • left (cvcuda.Tensor) – Left tensor to store amount of left padding per batch input image.

  • border (cvcuda.Border) – Border mode to be used when accessing elements outside input image.

  • bvalue (float) – Border value to be used for constant border mode.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for all types, [2] for 8bit Unsigned interleaved only

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for all types, [2] for 8bit Unsigned interleaved only

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No

Top/left Tensors

Must be kNHWC where N=H=C=1 with W = N (N in reference to input and output tensors).
Data Type must be 32bit Signed.
cvcuda.padandstack_into(dst: cvcuda.Tensor, src: cvcuda.ImageBatchVarShape, top: cvcuda.Tensor, left: cvcuda.Tensor, border: cvcuda.Border = <Border.CONSTANT: 0>, bvalue: typing.SupportsFloat | typing.SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Pad and Stack operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – input image batch containing one or more images.

  • top (cvcuda.Tensor) – Top tensor to store amount of top padding per batch input image.

  • left (cvcuda.Tensor) – Left tensor to store amount of left padding per batch input image.

  • border (cvcuda.Border) – Border mode to be used when accessing elements outside input image.

  • bvalue (float) – Border value to be used for constant border mode.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for all types, [2] for 8bit Unsigned interleaved only

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4] for all types, [2] for 8bit Unsigned interleaved only

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No

Top/left Tensors

Must be kNHWC where N=H=C=1 with W = N (N in reference to input and output tensors).
Data Type must be 32bit Signed.
cvcuda.pillowresize(src: cvcuda.Tensor, shape: tuple, format: cvcuda.Format, interp: cvcuda.Interp = <Interp.LINEAR: 1>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Pillow Resize operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • shape (tuple) – Shape of the output image.

  • format (cvcuda.Format) – Format of the input and output images.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4] for interleaved (kNHWC, kHWC); [1, 3, 4] for planar (kNCHW, kCHW) (2-channel planar is not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4] for interleaved (kNHWC, kHWC); [1, 3, 4] for planar (kNCHW, kCHW) (2-channel planar is not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.pillowresize(src: cvcuda.ImageBatchVarShape, sizes: collections.abc.Sequence[tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex]], interp: cvcuda.Interp = <Interp.LINEAR: 1>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Pillow Resize operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • sizes (Tuple[int]) – Shapes of output images.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4] for interleaved (kNHWC, kHWC); [1, 3, 4] for planar (kNCHW, kCHW) (2-channel planar is not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4] for interleaved (kNHWC, kHWC); [1, 3, 4] for planar (kNCHW, kCHW) (2-channel planar is not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.pillowresize_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, format: cvcuda.Format, interp: cvcuda.Interp = <Interp.LINEAR: 1>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Pillow Resize operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • shape (tuple) – Shape of the output image.

  • format (cvcuda.Format) – Format of the input and output images.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4] for interleaved (kNHWC, kHWC); [1, 3, 4] for planar (kNCHW, kCHW) (2-channel planar is not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4] for interleaved (kNHWC, kHWC); [1, 3, 4] for planar (kNCHW, kCHW) (2-channel planar is not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.pillowresize_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, interp: cvcuda.Interp = <Interp.LINEAR: 1>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Pillow Resize operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4] for interleaved (kNHWC, kHWC); [1, 3, 4] for planar (kNCHW, kCHW) (2-channel planar is not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4] for interleaved (kNHWC, kHWC); [1, 3, 4] for planar (kNCHW, kCHW) (2-channel planar is not supported)

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.posterize(src: cvcuda.Tensor, bits: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Posterize operation on the given cuda stream.

Keeps the bits most-significant bits of every channel value and zeros the rest: out = in & ~((1 << (W - bits)) - 1), where W is the data type bit width (8 for uint8, 16 for uint16). Mirrors torchvision.transforms.v2.functional.posterize / PIL ImageOps.posterize.

See also

Refer to the CV-CUDA C API reference for the Posterize operator for more details and usage examples.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • bits (int) – Number of most-significant bits to keep per channel; must be in [0, W] where W is the data type bit width (8 for uint8, 16 for uint16). bits == W leaves the image unchanged; bits == 0 zeros the image.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same shape, dtype, and layout as src).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.posterize(src: cvcuda.ImageBatchVarShape, bits: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Posterize operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • bits (int) – Number of most-significant bits to keep per channel (see posterize).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same formats and sizes as src).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.posterize_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, bits: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Posterize operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Posterize operator for more details and usage examples.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • bits (int) – Number of most-significant bits to keep per channel (see posterize).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.posterize_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, bits: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Posterize operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • bits (int) – Number of most-significant bits to keep per channel (see posterize).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.random_resized_crop(src: cvcuda.Tensor, shape: tuple, min_scale: typing.SupportsFloat | typing.SupportsIndex = 0.08, max_scale: typing.SupportsFloat | typing.SupportsIndex = 1.0, min_ratio: typing.SupportsFloat | typing.SupportsIndex = 0.75, max_ratio: typing.SupportsFloat | typing.SupportsIndex = 1.3333333333333333, interp: cvcuda.Interp = <Interp.LINEAR: 1>, seed: typing.SupportsInt | typing.SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the RandomResizedCrop operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • shape (Tuple) – Shape of output tensor.

  • min_scale (double, optional) – Lower bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • max_scale (double, optional) – Upper bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • min_ratio (double, optional) – Lower bound for the random aspect ratio of the crop, before resizing.

  • max_ratio (double, optional) – Upper bound for the random aspect ratio of the crop, before resizing.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • seed (int, optional) – Random seed, should be unsigned int32.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.random_resized_crop(src: cvcuda.ImageBatchVarShape, sizes: collections.abc.Sequence[tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex]], min_scale: typing.SupportsFloat | typing.SupportsIndex = 0.08, max_scale: typing.SupportsFloat | typing.SupportsIndex = 1.0, min_ratio: typing.SupportsFloat | typing.SupportsIndex = 0.75, max_ratio: typing.SupportsFloat | typing.SupportsIndex = 1.3333333333333333, interp: cvcuda.Interp = <Interp.LINEAR: 1>, seed: typing.SupportsInt | typing.SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the RandomResizedCrop operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • sizes (Tuple vector) – Shapes of output images.

  • min_scale (double, optional) – Lower bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • max_scale (double, optional) – Upper bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • min_ratio (double, optional) – Lower bound for the random aspect ratio of the crop, before resizing.

  • max_ratio (double, optional) – Upper bound for the random aspect ratio of the crop, before resizing.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • seed (int, optional) – Random seed, should be unsigned int32.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.random_resized_crop_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, min_scale: typing.SupportsFloat | typing.SupportsIndex = 0.08, max_scale: typing.SupportsFloat | typing.SupportsIndex = 1.0, min_ratio: typing.SupportsFloat | typing.SupportsIndex = 0.75, max_ratio: typing.SupportsFloat | typing.SupportsIndex = 1.3333333333333333, interp: cvcuda.Interp = <Interp.LINEAR: 1>, seed: typing.SupportsInt | typing.SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the RandomResizedCrop operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • min_scale (double, optional) – Lower bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • max_scale (double, optional) – Upper bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • min_ratio (double, optional) – Lower bound for the random aspect ratio of the crop, before resizing.

  • max_ratio (double, optional) – Upper bound for the random aspect ratio of the crop, before resizing.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • seed (int, optional) – Random seed, should be unsigned int32.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.random_resized_crop_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, min_scale: typing.SupportsFloat | typing.SupportsIndex = 0.08, max_scale: typing.SupportsFloat | typing.SupportsIndex = 1.0, min_ratio: typing.SupportsFloat | typing.SupportsIndex = 0.75, max_ratio: typing.SupportsFloat | typing.SupportsIndex = 1.3333333333333333, interp: cvcuda.Interp = <Interp.LINEAR: 1>, seed: typing.SupportsInt | typing.SupportsIndex = 0, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the RandomResizedCrop operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • min_scale (double, optional) – Lower bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • max_scale (double, optional) – Upper bound for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image.

  • min_ratio (double, optional) – Lower bound for the random aspect ratio of the crop, before resizing.

  • max_ratio (double, optional) – Upper bound for the random aspect ratio of the crop, before resizing.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • seed (int, optional) – Random seed, should be unsigned int32.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.reformat(src: cvcuda.Tensor, layout: cvcuda.TensorLayout, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Reformat operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • layout (cvcuda.TensorLayout) – The tensor layout of the output tensor ((N)CHW/(N)HWC).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.reformat_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Reformat operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 2, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

Yes

16bit Float

No

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.remap(src: cvcuda.Tensor, map: cvcuda.Tensor, src_interp: cvcuda.Interp = <Interp.NEAREST: 0>, map_interp: cvcuda.Interp = <Interp.NEAREST: 0>, map_type: cvcuda.Remap = <Remap.ABSOLUTE: 0>, align_corners: bool = False, border: cvcuda.Border = <Border.CONSTANT: 0>, border_value: typing.Annotated[numpy.typing.ArrayLike, numpy.float32] = array([], dtype=float32), *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Warp Perspective operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor.

  • src_interp (cvcuda.Interp, optional) – Interpolation type used when fetching values from the source image.

  • map_interp (cvcuda.Interp, optional) – Interpolation type used when fetching values from the map tensor.

  • map_type (cvcuda.Remap, optional) – This determines how the values inside the map are interpreted. If it is cvcuda.Remap.ABSOLUTE the map values are absolute, denormalized positions in the input tensor to fetch values from. If it is cvcuda.Remap.ABSOLUTE_NORMALIZED the map values are absolute, normalized positions in [-1, 1] range to fetch values from the input tensor in a resolution agnostic way. If it is cvcuda.Remap.RELATIVE_NORMALIZED the map values are relative, normalized offsets to be applied to each output position to fetch values from the input tensor, also resolution agnostic.

  • align_corners (bool, optional) – The remap operation from output to input via the map is done in the floating-point domain. If True, they are aligned by the center points of their corner pixels. Otherwise, they are aligned by the corner points of their corner pixels.

  • border (cvcuda.Border, optional) – pixel extrapolation method (cvcuda.Border.CONSTANT, cvcuda.Border.REPLICATE, cvcuda.Border.REFLECT, cvcuda.Border.REFLECT_101, or cvcuda.Border.WRAP).

  • border_value (numpy.ndarray, optional) – Used to specify values for a constant border, should have size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (only if Channel=1)

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (only if Channel=1)

64bit Float

No

Input map: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC] Channels: [2]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Channels      | Yes
 Width         | No
 Height        | No
 Samples       | Yes

Input/Map dependency

 Property      |  Input == Map
-------------- | -------------
 Data Layout   | No
 Data Type     | No
 Channels      | No
 Width         | No
 Height        | No
 Samples       | Yes or 1
cvcuda.remap(src: cvcuda.ImageBatchVarShape, map: cvcuda.Tensor, src_interp: cvcuda.Interp = <Interp.NEAREST: 0>, map_interp: cvcuda.Interp = <Interp.NEAREST: 0>, map_type: cvcuda.Remap = <Remap.ABSOLUTE: 0>, align_corners: bool = False, border: cvcuda.Border = <Border.CONSTANT: 0>, border_value: typing.Annotated[numpy.typing.ArrayLike, numpy.float32] = array([], dtype=float32), *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Warp Perspective operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch.

  • src_interp (cvcuda.Interp, optional) – Interpolation type used when fetching values from the source image.

  • map_interp (cvcuda.Interp, optional) – Interpolation type used when fetching values from the map tensor.

  • map_type (cvcuda.Remap, optional) – This determines how the values inside the map are interpreted. If it is cvcuda.Remap.ABSOLUTE the map values are absolute, denormalized positions in the input tensor to fetch values from. If it is cvcuda.Remap.ABSOLUTE_NORMALIZED the map values are absolute, normalized positions in [-1, 1] range to fetch values from the input tensor in a resolution agnostic way. If it is cvcuda.Remap.RELATIVE_NORMALIZED the map values are relative, normalized offsets to be applied to each output position to fetch values from the input tensor, also resolution agnostic.

  • align_corners (bool, optional) – The remap operation from output to input via the map is done in the floating-point domain. If True, they are aligned by the center points of their corner pixels. Otherwise, they are aligned by the corner points of their corner pixels.

  • border (cvcuda.Border, optional) – pixel extrapolation method (cvcuda.Border.CONSTANT, cvcuda.Border.REPLICATE, cvcuda.Border.REFLECT, cvcuda.Border.REFLECT_101, or cvcuda.Border.WRAP).

  • border_value (numpy.ndarray, optional) – Used to specify values for a constant border, should have size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (only if Channel=1)

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (only if Channel=1)

64bit Float

No

Input map: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC] Channels: [2]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Channels      | Yes
 Width         | No
 Height        | No
 Samples       | Yes

Input/Map dependency

 Property      |  Input == Map
-------------- | -------------
 Data Layout   | No
 Data Type     | No
 Channels      | No
 Width         | No
 Height        | No
 Samples       | Yes or 1
cvcuda.remap_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, map: cvcuda.Tensor, src_interp: cvcuda.Interp = <Interp.NEAREST: 0>, map_interp: cvcuda.Interp = <Interp.NEAREST: 0>, map_type: cvcuda.Remap = <Remap.ABSOLUTE: 0>, align_corners: bool = False, border: cvcuda.Border = <Border.CONSTANT: 0>, border_value: typing.Annotated[numpy.typing.ArrayLike, numpy.float32] = array([], dtype=float32), *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Warp Perspective operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor.

  • src (cvcuda.Tensor) – Input tensor.

  • src_interp (cvcuda.Interp, optional) – Interpolation type used when fetching values from the source image.

  • map_interp (cvcuda.Interp, optional) – Interpolation type used when fetching values from the map tensor.

  • map_type (cvcuda.Remap, optional) – This determines how the values inside the map are interpreted. If it is cvcuda.Remap.ABSOLUTE the map values are absolute, denormalized positions in the input tensor to fetch values from. If it is cvcuda.Remap.ABSOLUTE_NORMALIZED the map values are absolute, normalized positions in [-1, 1] range to fetch values from the input tensor in a resolution agnostic way. If it is cvcuda.Remap.RELATIVE_NORMALIZED the map values are relative, normalized offsets to be applied to each output position to fetch values from the input tensor, also resolution agnostic.

  • align_corners (bool, optional) – The remap operation from output to input via the map is done in the floating-point domain. If True, they are aligned by the center points of their corner pixels. Otherwise, they are aligned by the corner points of their corner pixels.

  • border (cvcuda.Border, optional) – pixel extrapolation method (cvcuda.Border.CONSTANT, cvcuda.Border.REPLICATE, cvcuda.Border.REFLECT, cvcuda.Border.REFLECT_101, or cvcuda.Border.WRAP).

  • border_value (numpy.ndarray, optional) – Used to specify values for a constant border, should have size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (only if Channel=1)

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (only if Channel=1)

64bit Float

No

Input map: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC] Channels: [2]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Channels      | Yes
 Width         | No
 Height        | No
 Samples       | Yes

Input/Map dependency

 Property      |  Input == Map
-------------- | -------------
 Data Layout   | No
 Data Type     | No
 Channels      | No
 Width         | No
 Height        | No
 Samples       | Yes or 1
cvcuda.remap_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, map: cvcuda.Tensor, src_interp: cvcuda.Interp = <Interp.NEAREST: 0>, map_interp: cvcuda.Interp = <Interp.NEAREST: 0>, map_type: cvcuda.Remap = <Remap.ABSOLUTE: 0>, align_corners: bool = False, border: cvcuda.Border = <Border.CONSTANT: 0>, border_value: typing.Annotated[numpy.typing.ArrayLike, numpy.float32] = array([], dtype=float32), *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Warp Perspective operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch.

  • src (cvcuda.ImageBatchVarShape) – Input image batch.

  • src_interp (cvcuda.Interp, optional) – Interpolation type used when fetching values from the source image.

  • map_interp (cvcuda.Interp, optional) – Interpolation type used when fetching values from the map tensor.

  • map_type (cvcuda.Remap, optional) – This determines how the values inside the map are interpreted. If it is cvcuda.Remap.ABSOLUTE the map values are absolute, denormalized positions in the input tensor to fetch values from. If it is cvcuda.Remap.ABSOLUTE_NORMALIZED the map values are absolute, normalized positions in [-1, 1] range to fetch values from the input tensor in a resolution agnostic way. If it is cvcuda.Remap.RELATIVE_NORMALIZED the map values are relative, normalized offsets to be applied to each output position to fetch values from the input tensor, also resolution agnostic.

  • align_corners (bool, optional) – The remap operation from output to input via the map is done in the floating-point domain. If True, they are aligned by the center points of their corner pixels. Otherwise, they are aligned by the corner points of their corner pixels.

  • border (cvcuda.Border, optional) – pixel extrapolation method (cvcuda.Border.CONSTANT, cvcuda.Border.REPLICATE, cvcuda.Border.REFLECT, cvcuda.Border.REFLECT_101, or cvcuda.Border.WRAP).

  • border_value (numpy.ndarray, optional) – Used to specify values for a constant border, should have size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (only if Channel=1)

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (only if Channel=1)

64bit Float

No

Input map: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC] Channels: [2]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Channels      | Yes
 Width         | No
 Height        | No
 Samples       | Yes

Input/Map dependency

 Property      |  Input == Map
-------------- | -------------
 Data Layout   | No
 Data Type     | No
 Channels      | No
 Width         | No
 Height        | No
 Samples       | Yes or 1
cvcuda.resize(src: cvcuda.Tensor, shape: tuple, interp: cvcuda.Interp = <Interp.LINEAR: 1>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Resize operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • shape (Tuple[int]) – Shape of output tensor.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.resize(src: cvcuda.ImageBatchVarShape, sizes: collections.abc.Sequence[tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex]], interp: cvcuda.Interp = <Interp.LINEAR: 1>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Resize operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • sizes (Tuple vector) – Shapes of output images.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.resize_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, interp: cvcuda.Interp = <Interp.LINEAR: 1>, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Resize operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • interp (cvcuda.Interp, optional) – Interpolation type used for transform.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.resize_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, interp: cvcuda.Interp = <Interp.LINEAR: 1>, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Resize operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.resize_crop_convert_reformat(src: cvcuda.Tensor, resize_dim: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], interp: cvcuda.Interp, crop_rect: cvcuda.RectI, *, layout: str = '', data_type: cvcuda.Type = 0, manip: cvcuda.ChannelManip = <ChannelManip.NO_OP: 0>, scale: typing.SupportsFloat | typing.SupportsIndex = 1.0, offset: typing.SupportsFloat | typing.SupportsIndex = 0.0, srcCast: bool = True, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the ResizeCropConvertReformat operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • resize_dim (tuple[int,int]) – Dimensions, width & height, of resized tensor (prior to cropping).

  • interp (cvcuda.Interp) – Interpolation type used for resizing. Currently, only cvcuda.Interp.NEAREST and cvcuda.Interp.LINEAR are available.

  • crop_rect (cvcuda.RectI) – Crop rectangle, (left, top, width, height), specifying the top-left corner and width & height dimensions of the region to crop from the resized images.

  • layout (string, optional) – String specifying output tensor layout (e.g., ‘NHWC’ or ‘CHW’). Empty string (default) indicates output tensor layout copies input.

  • data_type (cvcuda.Type, optional) – Data type of output tensor channel (e.g., uint8 or float). 0 (default) indicates output tensor data type copies input.

  • manip (cvcuda.ChannelManip, optional) – Channel manipulation (e.g., shuffle RGB to BGR). NO_OP (default) indicates output tensor channels are unchanged.

  • scale (float, optional) – Scale (i.e., multiply) the output values by this amount. 1.0 (default) results in no scaling of the output values.

  • offset (float, optional) – Offset (i.e., add to) the output values by this amount. This is applied after scaling. Let v be a resized and cropped value, then v * scale + offset is final output value. 0.0 (default) results in no offset being added to the output.

  • srcCast (bool, optional) – Boolean indicating whether or not the resize interpolation results are re-cast back to the input (or source) data type. Refer to the C API reference for more information. True (default) re-cast resize interpolation results back to the source data type.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [NVCV_TENSOR_HWC, NVCV_TENSOR_NHWC, NVCV_TENSOR_CHW, NVCV_TENSOR_NCHW]Channels: [1, 3]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW]Channels: [1, 3]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency:

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No (Limited)
 Data Type     | No (Limited)
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.resize_crop_convert_reformat(src: cvcuda.ImageBatchVarShape, resize_dim: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], interp: cvcuda.Interp, crop_rect: cvcuda.RectI, *, layout: str = '', data_type: cvcuda.Type = 0, manip: cvcuda.ChannelManip = <ChannelManip.NO_OP: 0>, scale: typing.SupportsFloat | typing.SupportsIndex = 1.0, offset: typing.SupportsFloat | typing.SupportsIndex = 0.0, srcCast: bool = True, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the ResizeCropConvertReformat operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images of varying sizes, but all images must have the same data type, channels, and layout.

  • resize_dim (tuple[int,int]) – Dimensions, width & height, of resized tensor (prior to cropping).

  • interp (cvcuda.Interp) – Interpolation type used for resizing. Currently, only cvcuda.Interp.NEAREST and cvcuda.Interp.LINEAR are available.

  • crop_rect (cvcuda.RectI) – Crop rectangle, (left, top, width, height), specifying the top-left corner and width & height dimensions of the region to crop from the resized images.

  • layout (string, optional) – String specifying output tensor layout (e.g., ‘NHWC’ or ‘CHW’). Empty string (default) indicates output tensor layout copies input.

  • data_type (cvcuda.Type, optional) – Data type of output tensor channel (e.g., uint8 or float). 0 (default) indicates output tensor data type copies input.

  • manip (cvcuda.ChannelManip, optional) – Channel manipulation (e.g., shuffle RGB to BGR). NO_OP (default) indicates output tensor channels are unchanged.

  • scale (float, optional) – Scale (i.e., multiply) the output values by this amount. 1.0 (default) results in no scaling of the output values.

  • offset (float, optional) – Offset (i.e., add to) the output values by this amount. This is applied after scaling. Let v be a resized and cropped value, then v * scale + offset is final output value. 0.0 (default) results in no offset being added to the output.

  • srcCast (bool, optional) – Boolean indicating whether or not the resize interpolation results are re-cast back to the input (or source) data type. Refer to the C API reference for more information. True (default) re-cast resize interpolation results back to the source data type.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [NVCV_TENSOR_HWC, NVCV_TENSOR_NHWC, NVCV_TENSOR_CHW, NVCV_TENSOR_NCHW]Channels: [1, 3]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW]Channels: [1, 3]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency:

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No (Limited)
 Data Type     | No (Limited)
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.resize_crop_convert_reformat_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, resize_dim: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], interp: cvcuda.Interp, cropPos: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], *, manip: cvcuda.ChannelManip = <ChannelManip.NO_OP: 0>, scale: typing.SupportsFloat | typing.SupportsIndex = 1.0, offset: typing.SupportsFloat | typing.SupportsIndex = 0.0, srcCast: bool = True, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the ResizeCropConvertReformat operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation. Output tensor also specifies the crop dimensions (i.e., width & height), as well as the output data type (e.g., uchar3 or float) and tensor layout (e.g., ‘NHWC’ or ‘NCHW’).

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • resize_dim (tuple[int,int]) – Dimensions, width & height, of resized tensor (prior to cropping).

  • interp (cvcuda.Interp) – Interpolation type used for resizing. Currently, only cvcuda.Interp.NEAREST and cvcuda.Interp.LINEAR are available.

  • cropPos (tuple[int,int]) – Crop position, (x, y), specifying the top-left corner of the region to crop from the resized images. The crop region’s width and height is specified by the output tensor’s width & height.

  • manip (cvcuda.ChannelManip, optional) – Channel manipulation (e.g., shuffle RGB to BGR). NO_OP (default) indicates output tensor channels are unchanged.

  • scale (float, optional) – Scale (i.e., multiply) the output values by this amount. 1.0 (default) results in no scaling of the output values.

  • offset (float, optional) – Offset (i.e., add to) the output values by this amount. This is applied after scaling. Let v be a resized and cropped value, then v * scale + offset is final output value. 0.0 (default) results in no offset being added to the output.

  • srcCast (bool, optional) – Boolean indicating whether or not the resize interpolation results are re-cast back to the input (or source) data type. Refer to the C API reference for more information. True (default) re-cast resize interpolation results back to the source data type.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [NVCV_TENSOR_HWC, NVCV_TENSOR_NHWC, NVCV_TENSOR_CHW, NVCV_TENSOR_NCHW]Channels: [1, 3]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW]Channels: [1, 3]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency:

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No (Limited)
 Data Type     | No (Limited)
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.resize_crop_convert_reformat_into(dst: cvcuda.Tensor, src: cvcuda.ImageBatchVarShape, resize_dim: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], interp: cvcuda.Interp, cropPos: tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], *, manip: cvcuda.ChannelManip = <ChannelManip.NO_OP: 0>, scale: typing.SupportsFloat | typing.SupportsIndex = 1.0, offset: typing.SupportsFloat | typing.SupportsIndex = 0.0, srcCast: bool = True, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the ResizeCropConvertReformat operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation. Output tensor also specifies the crop dimensions (i.e., width & height), as well as the output data type (e.g., uchar3 or float) and tensor layout (e.g., ‘NHWC’ or ‘NCHW’).

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images of varying sizes, but all images must have the same data type, channels, and layout.

  • resize_dim (tuple[int,int]) – Dimensions, width & height, of resized tensor (prior to cropping).

  • interp (cvcuda.Interp) – Interpolation type used for resizing. Currently, only cvcuda.Interp.NEAREST and cvcuda.Interp.LINEAR are available.

  • cropPos (tuple[int,int]) – Crop position, (x, y), specifying the top-left corner of the region to crop from the resized images. The crop region’s width and height is specified by the output tensor’s width & height.

  • manip (cvcuda.ChannelManip, optional) – Channel manipulation (e.g., shuffle RGB to BGR). NO_OP (default) indicates output tensor channels are unchanged.

  • scale (float, optional) – Scale (i.e., multiply) the output values by this amount. 1.0 (default) results in no scaling of the output values.

  • offset (float, optional) – Offset (i.e., add to) the output values by this amount. This is applied after scaling. Let v be a resized and cropped value, then v * scale + offset is final output value. 0.0 (default) results in no offset being added to the output.

  • srcCast (bool, optional) – Boolean indicating whether or not the resize interpolation results are re-cast back to the input (or source) data type. Refer to the C API reference for more information. True (default) re-cast resize interpolation results back to the source data type.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [NVCV_TENSOR_HWC, NVCV_TENSOR_NHWC, NVCV_TENSOR_CHW, NVCV_TENSOR_NCHW]Channels: [1, 3]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

No

64bit Float

No

Output: Data Layout: [NVCV_TENSOR_NHWC, NVCV_TENSOR_HWC, NVCV_TENSOR_NCHW, NVCV_TENSOR_CHW]Channels: [1, 3]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency:

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No (Limited)
 Data Type     | No (Limited)
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.rotate(src: cvcuda.Tensor, angle_deg: SupportsFloat | SupportsIndex, shift: tuple[SupportsFloat | SupportsIndex, SupportsFloat | SupportsIndex], interpolation: cvcuda.Interp, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Rotate operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • angle_deg (float) – Angle used for rotation in degrees.

  • shift (Tuple[float, float]) – Value of shift in {x, y} directions to move the center at the same coord after rotation.

  • interpolation (cvcuda.Interp) – Interpolation type used for transform.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Interpolation type

 Type                 |  Allowed
--------------------- | -------------
 NVCV_INTERP_NEAREST  | Yes
 NVCV_INTERP_LINEAR   | Yes
 NVCV_INTERP_CUBIC    | Yes
 NVCV_INTERP_AREA     | No
cvcuda.rotate(src: cvcuda.ImageBatchVarShape, angle_deg: cvcuda.Tensor, shift: cvcuda.Tensor, interpolation: cvcuda.Interp, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Rotate operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • angle_deg (cvcuda.Tensor) – Rotation angle in degrees, specified per image.

  • shift (cvcuda.Tensor) – Shift in {x, y} directions, specified per image.

  • interpolation (cvcuda.Interp) – Interpolation type used for transform.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Interpolation type

 Type                 |  Allowed
--------------------- | -------------
 NVCV_INTERP_NEAREST  | Yes
 NVCV_INTERP_LINEAR   | Yes
 NVCV_INTERP_CUBIC    | Yes
 NVCV_INTERP_AREA     | No
cvcuda.rotate_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, angle_deg: SupportsFloat | SupportsIndex, shift: tuple[SupportsFloat | SupportsIndex, SupportsFloat | SupportsIndex], interpolation: cvcuda.Interp, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Rotate operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • angle_deg (float) – Angle used for rotation in degrees.

  • shift (Tuple[float, float]) – Value of shift in {x, y} directions to move the center at the same coord after rotation.

  • interpolation (cvcuda.Interp) – Interpolation type used for transform.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Interpolation type

 Type                 |  Allowed
--------------------- | -------------
 NVCV_INTERP_NEAREST  | Yes
 NVCV_INTERP_LINEAR   | Yes
 NVCV_INTERP_CUBIC    | Yes
 NVCV_INTERP_AREA     | No
cvcuda.rotate_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, angle_deg: cvcuda.Tensor, shift: cvcuda.Tensor, interpolation: cvcuda.Interp, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Rotate operation on the given cuda stream.

Parameters:
Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1, 3, 4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | Yes
 Height        | Yes

Interpolation type

 Type                 |  Allowed
--------------------- | -------------
 NVCV_INTERP_NEAREST  | Yes
 NVCV_INTERP_LINEAR   | Yes
 NVCV_INTERP_CUBIC    | Yes
 NVCV_INTERP_AREA     | No
cvcuda.sift(src: cvcuda.Tensor, max_features: typing.SupportsInt | typing.SupportsIndex = 0, num_octave_layers: typing.SupportsInt | typing.SupportsIndex = 3, contrast_threshold: typing.SupportsFloat | typing.SupportsIndex = 0.029999999329447746, edge_threshold: typing.SupportsFloat | typing.SupportsIndex = 10.0, init_sigma: typing.SupportsFloat | typing.SupportsIndex = 1.600000023841858, flags: cvcuda.SIFT = <SIFT.USE_EXPANDED_INPUT: 1>, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Executes the SIFT operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor to extract features and compute descriptors from.

  • max_features (Number, optional) – Maximum number of features to be extracted, default is 5% of total pixels at a minimum of 1.

  • num_octave_layers (Number, optional) – Number of octave layers, default is 3.

  • contrast_threshold (Number, optional) – Contrast threshold, default is 0.03.

  • edge_threshold (Number, optional) – Edge threshold, default is 10.0.

  • init_sigma (Number, optional) – Initial sigma, default is 1.6.

  • flags (cvcuda.SIFT, optional) – Flag to whether to expand the input or not, default is cvcuda.SIFT.USE_EXPANDED_INPUT.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with feature coordinates, metadata, descriptors and number of features.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.sift_into(feat_coords: cvcuda.Tensor, feat_metadata: cvcuda.Tensor, feat_descriptors: cvcuda.Tensor, num_features: cvcuda.Tensor, src: cvcuda.Tensor, num_octave_layers: typing.SupportsInt | typing.SupportsIndex = 3, contrast_threshold: typing.SupportsFloat | typing.SupportsIndex = 0.029999999329447746, edge_threshold: typing.SupportsFloat | typing.SupportsIndex = 10.0, init_sigma: typing.SupportsFloat | typing.SupportsIndex = 1.600000023841858, flags: cvcuda.SIFT = <SIFT.USE_EXPANDED_INPUT: 1>, *, stream: cvcuda.Stream | None = None) tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

Executes the SIFT operation on the given cuda stream.

Parameters:
  • feat_coords (cvcuda.Tensor) – Output tensor with feature coordinates.

  • feat_metadata (cvcuda.Tensor) – Output tensor with feature metadata.

  • feat_descriptors (cvcuda.Tensor) – Output tensor with feature descriptors.

  • num_features (cvcuda.Tensor) – Output tensor with number of features.

  • src (cvcuda.Tensor) – Input tensor to extract features and compute descriptors from.

  • num_octave_layers (Number, optional) – Number of octave layers, default is 3.

  • contrast_threshold (Number, optional) – Contrast threshold, default is 0.03.

  • edge_threshold (Number, optional) – Edge threshold, default is 10.0.

  • init_sigma (Number, optional) – Initial sigma, default is 1.6.

  • flags (cvcuda.SIFT, optional) – Flag to whether to expand the input or not, default is cvcuda.SIFT.USE_EXPANDED_INPUT.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

A tuple with feature coordinates, metadata, descriptors and number of features.

Return type:

Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]

cvcuda.solarize(src: cvcuda.Tensor, threshold: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Solarize operation on the given cuda stream.

Inverts every pixel at or above threshold: out = (in >= threshold) ? (bound - in) : in, where bound is the data type maximum (255 for uint8, 65535 for uint16, 1.0 for float32). Mirrors torchvision.transforms.v2.functional.solarize.

See also

Refer to the CV-CUDA C API reference for the Solarize operator for more details and usage examples.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • threshold (float) – Pixels with value >= threshold are inverted (in the pixel value domain).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same shape, dtype, and layout as src).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.solarize(src: cvcuda.ImageBatchVarShape, threshold: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Solarize operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • threshold (float) – Pixels with value >= threshold are inverted (in the pixel value domain).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same formats and sizes as src).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.solarize_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, threshold: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Solarize operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Solarize operator for more details and usage examples.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • threshold (float) – Pixels with value >= threshold are inverted (in the pixel value domain).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.solarize_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, threshold: SupportsFloat | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Solarize operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • threshold (float) – Pixels with value >= threshold are inverted (in the pixel value domain).

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.stack(src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Stack operation on the given cuda stream. This takes an ImageBatchVarShape and combines images into a N(HWC/CHW) tensor.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images. All images must have the same format and dimensions.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor containing the stacked input images.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kNCHW, kCHW, kHWC] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kNCHW] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | No
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.stack(src: cvcuda.TensorBatch, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Stack operation on the given cuda stream. This takes a TensorBatch and combines tensors into a N(HWC/CHW) tensor.

Parameters:
  • src (cvcuda.TensorBatch) – Input tensor batch containing one or more tensors. All tensors must be N(HWC/CHW) or HWC/CHW and have the same data type and shape.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor containing the stacked input tensors.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kNCHW, kCHW, kHWC] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kNCHW] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | No
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.stack(src: collections.abc.Sequence[cvcuda.Tensor], *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Stack operation on the given cuda stream. This takes input tensors and combines them into a N(HWC/CHW) tensor.

Parameters:
  • src (List[cvcuda.Tensor]) – Input tensors containing one or more samples each images all tensors must be N(HWC/CHW) or HWC/CHW and have the same data type and shape.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor containing the stacked input tensors.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kNCHW, kCHW, kHWC] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kNCHW] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | No
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.stack_into(dst: cvcuda.Tensor, src: cvcuda.ImageBatchVarShape, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Stack operation on the given cuda stream. This takes an ImageBatchVarShape and combines images into a N(HWC/CHW) tensor.

Parameters:
  • dst (cvcuda.Tensor) – Output N(CHW/HWC) tensor to store the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images. All images must have the same format and dimensions.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kNCHW, kCHW, kHWC] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kNCHW] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | No
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.stack_into(dst: cvcuda.Tensor, src: cvcuda.TensorBatch, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Stack operation on the given cuda stream. This takes a TensorBatch and combines tensors into a N(HWC/CHW) tensor.

Parameters:
  • dst (cvcuda.Tensor) – Output N(CHW/HWC) tensor to store the result of the operation.

  • src (cvcuda.TensorBatch) – Input tensor batch containing one or more tensors. All tensors must be N(HWC/CHW) or HWC/CHW and have the same data type and shape.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kNCHW, kCHW, kHWC] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kNCHW] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | No
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.stack_into(dst: cvcuda.Tensor, src: collections.abc.Sequence[cvcuda.Tensor], *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Stack operation on the given cuda stream. This takes input tensors and combines them into a N(HWC/CHW) tensor.

Parameters:
  • dst (cvcuda.Tensor) – Output N(CHW/HWC) tensor to store the result of the operation.

  • src (List[cvcuda.Tensor]) – Input tensors containing one or more samples each images all tensors must be N(HWC/CHW) or HWC/CHW and have the same data type and shape.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kNCHW, kCHW, kHWC] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Output: Data Layout: [kNHWC, kNCHW] Channels: [1,2,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

Yes

32bit Signed

Yes

16bit Float

Yes

32bit Float

Yes

64bit Float

Yes

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | No
 Channels      | Yes
 Width         | Yes
 Height        | Yes
cvcuda.threshold(src: cvcuda.Tensor, thresh: cvcuda.Tensor, maxval: cvcuda.Tensor, type: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Threshold operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • thresh (cvcuda.Tensor) – An array of size batch that gives the threshold value of each image.

  • maxval (cvcuda.Tensor) – An array of size batch that gives the maxval value of each image, using with the cvcuda.ThresholdType.BINARY or cvcuda.ThresholdType.BINARY_INV threshold types.

  • type (cvcuda.ThresholdType) – Thresholding type.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

cvcuda.threshold(src: cvcuda.ImageBatchVarShape, thresh: cvcuda.Tensor, maxval: cvcuda.Tensor, type: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Threshold operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • thresh (cvcuda.Tensor) – An array of size batch that gives the threshold value of each image.

  • maxval (cvcuda.Tensor) – An array of size batch that gives the maxval value of each image, using with the cvcuda.ThresholdType.BINARY or cvcuda.ThresholdType.BINARY_INV threshold types.

  • type (cvcuda.ThresholdType) – Thresholding type.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

cvcuda.threshold_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, thresh: cvcuda.Tensor, maxval: cvcuda.Tensor, type: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Threshold operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • thresh (cvcuda.Tensor) – An array of size batch that gives the threshold value of each image.

  • maxval (cvcuda.Tensor) – An array of size batch that gives the maxval value of each image, using with the cvcuda.ThresholdType.BINARY or cvcuda.ThresholdType.BINARY_INV threshold types.

  • type (cvcuda.ThresholdType) – Thresholding type.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

cvcuda.threshold_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, thresh: cvcuda.Tensor, maxval: cvcuda.Tensor, type: SupportsInt | SupportsIndex, *, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Threshold operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • thresh (cvcuda.Tensor) – An array of size batch that gives the threshold value of each image.

  • maxval (cvcuda.Tensor) – An array of size batch that gives the maxval value of each image, using with the cvcuda.ThresholdType.BINARY or cvcuda.ThresholdType.BINARY_INV threshold types.

  • type (cvcuda.ThresholdType) – Thresholding type.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

cvcuda.warp_affine(src: cvcuda.Tensor, xform: typing.Annotated[numpy.typing.ArrayLike, numpy.float32], flags: typing.SupportsInt | typing.SupportsIndex, *, border_mode: cvcuda.Border = <Border.CONSTANT: 0>, border_value: typing.Annotated[numpy.typing.ArrayLike, numpy.float32] = 0, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Warp Affine operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • xform (cvcuda.Tensor) – 2x3 float affine transformation matrix.

  • flags (int) – Combination of interpolation methods(cvcuda.Interp.NEAREST, cvcuda.Interp.LINEAR or cvcuda.Interp.CUBIC) and the optional flag cvcuda.Interp.WARP_INVERSE_MAP, that sets xform as the inverse transformation.

  • border_mode (cvcuda.Border, optional) – Pixel extrapolation method (cvcuda.Border.CONSTANT or cvcuda.Border.REPLICATE).

  • border_value (numpy.ndarray, optional) – Used to specify values for a constant border, must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.warp_affine(src: cvcuda.ImageBatchVarShape, xform: cvcuda.Tensor, flags: typing.SupportsInt | typing.SupportsIndex, *, border_mode: cvcuda.Border = <Border.CONSTANT: 0>, border_value: typing.Annotated[numpy.typing.ArrayLike, numpy.float32] = 0, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Warp Affine operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • xform (cvcuda.Tensor) – 2x3 float affine transformation matrix(s) for each image.

  • flags (int) – Combination of interpolation methods(cvcuda.Interp.NEAREST, cvcuda.Interp.LINEAR or cvcuda.Interp.CUBIC) and the optional flag cvcuda.Interp.WARP_INVERSE_MAP, that sets xform as the inverse transformation.

  • border_mode (cvcuda.Border, optional) – Pixel extrapolation method (cvcuda.Border.CONSTANT or cvcuda.Border.REPLICATE).

  • border_value (numpy.ndarray, optional) – Used to specify values for a constant border, must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.warp_affine_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, xform: typing.Annotated[numpy.typing.ArrayLike, numpy.float32], flags: typing.SupportsInt | typing.SupportsIndex, *, border_mode: cvcuda.Border = <Border.CONSTANT: 0>, border_value: typing.Annotated[numpy.typing.ArrayLike, numpy.float32] = 0, stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Warp Affine operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • xform (cvcuda.Tensor) – 2x3 float affine transformation matrix.

  • flags (int) – Combination of interpolation methods(cvcuda.Interp.NEAREST, cvcuda.Interp.LINEAR or cvcuda.Interp.CUBIC) and the optional flag cvcuda.Interp.WARP_INVERSE_MAP, that sets xform as the inverse transformation.

  • border_mode (cvcuda.Border, optional) – Pixel extrapolation method (cvcuda.Border.CONSTANT or cvcuda.Border.REPLICATE).

  • border_value (numpy.ndarray, optional) – Used to specify values for a constant border, must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.warp_affine_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, xform: cvcuda.Tensor, flags: typing.SupportsInt | typing.SupportsIndex, *, border_mode: cvcuda.Border = <Border.CONSTANT: 0>, border_value: typing.Annotated[numpy.typing.ArrayLike, numpy.float32] = 0, stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Warp Affine operation on the given cuda stream.

Parameters:
  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • xform (cvcuda.Tensor) – 2x3 float affine transformation matrix(s) for each image in batch.

  • flags (int) – Combination of interpolation methods(cvcuda.Interp.NEAREST, cvcuda.Interp.LINEAR or cvcuda.Interp.CUBIC) and the optional flag cvcuda.Interp.WARP_INVERSE_MAP, that sets xform as the inverse transformation.

  • border_mode (cvcuda.Border, optional) – Pixel extrapolation method (cvcuda.Border.CONSTANT or cvcuda.Border.REPLICATE).

  • border_value (numpy.ndarray, optional) – Used to specify values for a constant border, must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.warp_perspective(src: cvcuda.Tensor, xform: Annotated[numpy.typing.ArrayLike, numpy.float32], flags: SupportsInt | SupportsIndex, *, border_mode: cvcuda.Border, border_value: Annotated[numpy.typing.ArrayLike, numpy.float32], stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Warp Perspective operation on the given cuda stream.

Parameters:
  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • (numpy.ndarray (xform) – 3x3 perspective transformation matrix.

  • flags (int) – Combination of interpolation methods(cvcuda.Interp.NEAREST, cvcuda.Interp.LINEAR or cvcuda.Interp.CUBIC) and the optional flag cvcuda.Interp.WARP_INVERSE_MAP, that sets trans_matrix as the inverse transformation.

  • border_mode (cvcuda.Border) – pixel extrapolation method (cvcuda.Border.CONSTANT or cvcuda.Border.REPLICATE).

  • border_value (numpy.ndarray) – Used to specify values for a constant border, should be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.warp_perspective(src: cvcuda.ImageBatchVarShape, xform: cvcuda.Tensor, flags: SupportsInt | SupportsIndex, *, border_mode: cvcuda.Border, border_value: Annotated[numpy.typing.ArrayLike, numpy.float32], stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Warp Perspective operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • xform (cvcuda.Tensor) – 3x3 perspective transformation matrix for each image in the batch.

  • flags (int) – Combination of interpolation methods(cvcuda.Interp.NEAREST, cvcuda.Interp.LINEAR or cvcuda.Interp.CUBIC) and the optional flag cvcuda.Interp.WARP_INVERSE_MAP, that sets trans_matrix as the inverse transformation.

  • border_mode (cvcuda.Border) – pixel extrapolation method (cvcuda.Border.CONSTANT or cvcuda.Border.REPLICATE).

  • border_value (numpy.ndarray) – Used to specify values for a constant border, must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch.

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.warp_perspective_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, xform: Annotated[numpy.typing.ArrayLike, numpy.float32], flags: SupportsInt | SupportsIndex, *, border_mode: cvcuda.Border, border_value: Annotated[numpy.typing.ArrayLike, numpy.float32], stream: cvcuda.Stream | None = None) cvcuda.Tensor

Executes the Warp Perspective operation on the given cuda stream.

Parameters:
  • dst (cvcuda.Tensor) – Output tensor to store the result of the operation.

  • src (cvcuda.Tensor) – Input tensor containing one or more images.

  • (numpy.ndarray (xform) – 3x3 perspective transformation matrix.

  • flags (int) – Combination of interpolation methods(cvcuda.Interp.NEAREST, cvcuda.Interp.LINEAR or cvcuda.Interp.CUBIC) and the optional flag cvcuda.Interp.WARP_INVERSE_MAP, that sets trans_matrix as the inverse transformation.

  • border_mode (cvcuda.Border) – pixel extrapolation method (cvcuda.Border.CONSTANT or cvcuda.Border.REPLICATE).

  • border_value (numpy.ndarray) – Used to specify values for a constant border, should be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor (same as dst).

Return type:

cvcuda.Tensor

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No
cvcuda.warp_perspective_into(dst: cvcuda.ImageBatchVarShape, src: cvcuda.ImageBatchVarShape, xform: cvcuda.Tensor, flags: SupportsInt | SupportsIndex, *, border_mode: cvcuda.Border, border_value: Annotated[numpy.typing.ArrayLike, numpy.float32], stream: cvcuda.Stream | None = None) cvcuda.ImageBatchVarShape

Executes the Warp Perspective operation on the given cuda stream.

Parameters:
  • src (cvcuda.ImageBatchVarShape) – Input image batch containing one or more images.

  • dst (cvcuda.ImageBatchVarShape) – Output image batch containing the result of the operation.

  • xform (cvcuda.Tensor) – 3x3 perspective transformation matrix for each image in the batch.

  • flags (int) – Combination of interpolation methods(cvcuda.Interp.NEAREST, cvcuda.Interp.LINEAR or cvcuda.Interp.CUBIC) and the optional flag cvcuda.Interp.WARP_INVERSE_MAP, that sets trans_matrix as the inverse transformation.

  • border_mode (cvcuda.Border) – pixel extrapolation method (cvcuda.Border.CONSTANT or cvcuda.Border.REPLICATE).

  • border_value (numpy.ndarray) – Used to specify values for a constant border, must be a size <= 4 and dim of 1, where the values specify the border color for each color channel.

  • stream (cvcuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output image batch (same as dst).

Return type:

cvcuda.ImageBatchVarShape

Limitations

Input: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Output: Data Layout: [kNHWC, kHWC, kNCHW, kCHW] Channels: [1,3,4]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | Yes
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes
 Width         | No
 Height        | No