Threshold

cvcuda.threshold(src: nvcv.Tensor, thresh: nvcv.Tensor, maxval: nvcv.Tensor, type: ThresholdType, stream: nvcv.cuda.Stream | None = None) nvcv.Tensor

Executes the Threshold operation on the given cuda stream.

See also

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

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

  • thresh (nvcv.Tensor) – An array of size batch that gives the threshold value of each image.

  • maxval (nvcv.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 (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.threshold(src: nvcv.ImageBatchVarShape, thresh: nvcv.Tensor, maxval: nvcv.Tensor, type:ThresholdType, stream: Optional[nvcv.cuda.Stream] = None) -> nvcv.ImageBatchVarShape

Executes the Threshold operation on the given cuda stream.

See also

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

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

  • thresh (nvcv.Tensor) – An array of size batch that gives the threshold value of each image.

  • maxval (nvcv.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 (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.threshold_into(dst: nvcv.Tensor, src: nvcv.Tensor, thresh: nvcv.Tensor, maxval: nvcv.Tensor, type: ThresholdType, stream: nvcv.cuda.Stream | None = None)

Executes the Threshold operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Threshold 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.

  • thresh (nvcv.Tensor) – An array of size batch that gives the threshold value of each image.

  • maxval (nvcv.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 (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.threshold_into(dst: nvcv.ImageBatchVarShape, src: nvcv.ImageBatchVarShape, thresh: nvcv.Tensor, maxval: nvcv.Tensor, type:ThresholdType, stream: Optional[nvcv.cuda.Stream] = None)

Executes the Threshold operation on the given cuda stream.

See also

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

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

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

  • thresh (nvcv.Tensor) – An array of size batch that gives the threshold value of each image.

  • maxval (nvcv.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 (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.