AdaptiveThreshold

cvcuda.adaptivethreshold()
cvcuda.adaptivethreshold(src: nvcv.Tensor, max_value: float, adaptive_method: cvcuda.AdaptiveThresholdType = cvcuda.AdaptiveThresholdType.MEAN_C,

threshold_type: cvcuda.ThresholdType = cvcuda.ThresholdType.BINARY, block_size: int, c: float, stream: Optional[nvcv.cuda.Stream] = None) -> nvcv.Tensor

Executes the adaptive threshold operation on the given cuda stream.

See also

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

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

Returns:

The output image.

Return type:

nvcv.Tensor

Caution

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

cvcuda.adaptivethreshold(src: nvcv.ImageBatchVarShape, max_value: nvcv.Tensor, adaptive_method: cvcuda.AdaptiveThresholdType = cvcuda.AdaptiveThresholdType.MEAN_C, threshold_type: cvcuda.ThresholdType = cvcuda.ThresholdType.BINARY, block_size: int, c: float, stream: Optional[nvcv.cuda.Stream] = None) -> nvcv.ImageBatchVarShape

Executes the adaptive threshold operation on the given cuda stream.

See also

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

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

  • max_value (nvcv.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 (nvcv.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 (nvcv.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 (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.adaptivethreshold_into()
cvcuda.adaptivethreshold_into(dst: nvcv.Tensor, src: nvcv.Tensor, max_value: float, adaptive_method: cvcuda.AdaptiveThresholdType = <

cvcuda.AdaptiveThresholdType.MEAN_C >, threshold_type: cvcuda.ThresholdType = cvcuda.ThresholdType.BINARY, block_size: int, c: float, stream: Optional[nvcv.cuda.Stream] = None)

Executes the adaptive threshold operation on the given cuda stream.

See also

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

  • 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 (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.adaptivethreshold_into(dst: nvcv.ImageBatchVarShape, src: nvcv.ImageBatchVarShape, max_value: nvcv.Tensor,

adaptive_method: cvcuda.AdaptiveThresholdType = cvcuda.AdaptiveThresholdType.MEAN_C, threshold_type: cvcuda.ThresholdType = cvcuda.ThresholdType.BINARY, block_size: int, c: float, stream: Optional[nvcv.cuda.Stream] = None)

Executes the adaptive threshold operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Composite 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 the result of the operation.

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