Composite

cvcuda.composite(foreground: nvcv.Tensor, background: nvcv.Tensor, fgmask: nvcv.Tensor, outchannels: int, stream: Optional[nvcv.cuda.Stream] = None) nvcv.Tensor

Executes the Composite 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
  • foreground (nvcv.Tensor) – Input tensor containing one or more foreground images. Each image is BGR (3-channel) 8-bit.

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

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

  • outchannels (int) – Specifies 3 channel for RGB and 4 channel for BGRA.

  • 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.composite(foreground: nvcv.ImageBatchVarShape, background: nvcv.ImageBatchVarShape, fgmask: nvcv.ImageBatchVarShape, outchannels: int, stream: Optional[nvcv.cuda.Stream] = None) -> nvcv.ImageBatchVarShape

Executes the Composite 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
  • foreground (nvcv.ImageBatchVarShape) – Input tensor containing one or more foreground images. Each image is BGR (3-channel) 8-bit.

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

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

  • 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.composite_into(dst: nvcv.Tensor, foreground: nvcv.Tensor, background: nvcv.Tensor, fgmask: nvcv.Tensor, outchannels: int, stream: Optional[nvcv.cuda.Stream] = None)

Executes the Composite 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.

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

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

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

  • 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.composite_into(dst: nvcv.ImageBatchVarShape, foreground: nvcv.ImageBatchVarShape, background: nvcv.ImageBatchVarShape, fgmask: nvcv.ImageBatchVarShape, outchannels: int, stream: Optional[nvcv.cuda.Stream] = None)

Executes the Composite 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.

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

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

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

  • 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.