WarpPerspective

cvcuda.warp_perspective(src: nvcv.Tensor, xform: nvcv.Tensor, flags: int, border_mode: cvcuda.Border, border_value: numpy.ndarray, stream: nvcv.cuda.Stream | None = None) nvcv.Tensor

Executes the Warp Perspective operation on the given cuda stream.

See also

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

Parameters:
  • src (nvcv.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 (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.warp_perspective(src: nvcv.ImageBatchVarShape, xform: nvcv.Tensor, flags: int, border_mode: cvcuda.Border, border_value: numpy.ndarray, stream: Optional[nvcv.cuda.Stream] = None) -> nvcv.ImageBatchVarShape

Executes the Warp Perspective operation on the given cuda stream.

See also

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

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

  • xform (nvcv.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 (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.warp_perspective_into(dst: nvcv.Tensor, src: nvcv.Tensor, xform: nvcv.Tensor, flags: int, border_mode: cvcuda.Border, border_value: numpy.ndarray, stream: nvcv.cuda.Stream | None = None)

Executes the Warp Perspective operation on the given cuda stream.

See also

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

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

  • src (nvcv.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 (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

None

Caution

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

cvcuda.warp_perspective_into(dst: nvcv.ImageBatchVarShape, src: nvcv.ImageBatchVarShape, xform: nvcv.Tensor, flags: int, border_mode: cvcuda.Border, border_value: numpy.ndarray, stream: Optional[nvcv.cuda.Stream] = None)

Executes the Warp Perspective operation on the given cuda stream.

See also

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

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

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

  • xform (nvcv.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 (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

None

Caution

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