Morphology

cvcuda.morphology(src: nvcv.Tensor, morphologyType: cvcuda.MorphologyType, maskSize: Tuple[int, int], anchor: Tuple[int, int], workspace: nvcv.Tensor, iteration: int, border: cvcuda.Border = cvcuda.Border.CONSTANT, stream: nvcv.cuda.Stream | None = None) nvcv.Tensor

Executes the Morphology operation on the given cuda stream.

See also

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

Parameters:
  • src (nvcv.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 (nvcv.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 (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.morphology(src: nvcv.ImageBatchVarShape, morphologyType: cvcuda.MorphologyType, maskSize: nvcv.Tensor, anchor: nvcv.Tensor, workspace: nvcv.ImageBatchVarShape, iteration: int, border: cvcuda.Border = cvcuda.Border.CONSTANT, stream: Optional[nvcv.cuda.Stream] = None) -> nvcv.ImageBatchVarShape

Executes the Morphology operation on the given cuda stream.

See also

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

Parameters:
  • src (nvcv.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 (nvcv.Tensor) – Mask width and height for morphology operation for every image.

  • anchor (nvcv.Tensor) – X,Y offset of kernel for every image, use -1,-1 for center.

  • workspace (nvcv.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 (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.morphology_into(dst: nvcv.Tensor, src: nvcv.Tensor, morphologyType: cvcuda.MorphologyType, maskSize: Tuple[int, int], anchor: Tuple[int, int], workspace: nvcv.Tensor, iteration: int, border: cvcuda.Border = cvcuda.Border.CONSTANT, stream: nvcv.cuda.Stream | None = None)

Executes the Morphology operation on the given cuda stream.

See also

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

  • 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 (nvcv.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 (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.morphology_into(dst: nvcv.ImageBatchVarShape, src: nvcv.ImageBatchVarShape, morphologyType: cvcuda.MorphologyType, maskSize: nvcv.Tensor, anchor: nvcv.Tensor, workspace: nvcv.ImageBatchVarShape, iteration: int, border: cvcuda.Border = cvcuda.Border.CONSTANT, stream: Optional[nvcv.cuda.Stream] = None)

Executes the Morphology operation on the given cuda stream.

See also

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

  • morphologyType (cvcuda.MorphologyType) – Type of operation to perform (e.g. cvcuda.MorphologyType.ERODE or cvcuda.MorphologyType.DILATE).

  • maskSize (nvcv.Tensor) – Mask width and height for morphology operation for every image.

  • anchor (nvcv.Tensor) – X,Y offset of kernel for every image, use -1,-1 for center.

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