Function create_gpu_mat_from_cuda_memory

Source
pub fn create_gpu_mat_from_cuda_memory(
    rows: i32,
    cols: i32,
    typ: i32,
    cuda_memory_address: size_t,
    step: size_t,
) -> Result<GpuMat>
Expand description

Bindings overload to create a GpuMat from existing GPU memory.

§Parameters

  • rows: Row count.
  • cols: Column count.
  • type: Type of the matrix.
  • cudaMemoryAddress: Address of the allocated GPU memory on the device. This does not allocate matrix data. Instead, it just initializes the matrix header that points to the specified \a cudaMemoryAddress, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it.
  • step: Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. If the parameter is missing (set to Mat::AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See GpuMat::elemSize.

Note: Overload for generation of bindings only, not exported or intended for use internally from C++.

§C++ default parameters

  • step: Mat::AUTO_STEP