Data Structures#
Detailed Description#
Classes#
Name |
Description |
|---|---|
|
BufferPool for use with CUDA streams. View details |
|
|
|
Class that enables getting cudaEvent_t from cuda::Event. View details |
|
|
|
Base storage class for GPU memory with reference counting. View details |
|
|
|
Class with reference counting wrapping special memory type allocation functions from CUDA. View details |
|
This class encapsulates a queue of asynchronous calls. View details |
|
Class that enables getting cudaStream_t from cuda::Stream. View details |
Typedef Documentation#
IndexArray#
typedef GpuMatND::IndexArray cv::cuda::IndexArray
#include <opencv2/core/cuda.hpp>
SizeArray#
typedef GpuMatND::SizeArray cv::cuda::SizeArray
#include <opencv2/core/cuda.hpp>
StepArray#
typedef GpuMatND::StepArray cv::cuda::StepArray
#include <opencv2/core/cuda.hpp>
Function Documentation#
createContinuous()#
void cv::cuda::createContinuous(
int rows,
int cols,
int type,
OutputArray arr )
#include <opencv2/core/cuda.hpp>
Python:
cv.cuda.createContinuous(rows, cols, type[, arr]) -> arr
Creates a continuous matrix.
Matrix is called continuous if its elements are stored continuously, that is, without gaps at the end of each row.
Parameters
rows— Row count.cols— Column count.type— Type of the matrix.arr— Destination matrix. This parameter changes only if it has a proper type and area ( \(\texttt{rows} \times \texttt{cols}\) ).
createGpuMatFromCudaMemory()#
GpuMat cv::cuda::createGpuMatFromCudaMemory(
int rows,
int cols,
int type,
size_t cudaMemoryAddress,
size_t step = Mat::AUTO_STEP )
#include <opencv2/core/cuda.hpp>
Python:
cv.cuda.createGpuMatFromCudaMemory(rows, cols, type, cudaMemoryAddress[, step]) -> retval
cv.cuda.createGpuMatFromCudaMemory(size, type, cudaMemoryAddress[, step]) -> retval
Bindings overload to create a GpuMat from existing GPU memory.
Note
Overload for generation of bindings only, not exported or intended for use internally from C++.
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 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.
createGpuMatFromCudaMemory()#
GpuMat cv::cuda::createGpuMatFromCudaMemory(
Size size,
int type,
size_t cudaMemoryAddress,
size_t step = Mat::AUTO_STEP )
#include <opencv2/core/cuda.hpp>
Python:
cv.cuda.createGpuMatFromCudaMemory(rows, cols, type, cudaMemoryAddress[, step]) -> retval
cv.cuda.createGpuMatFromCudaMemory(size, type, cudaMemoryAddress[, step]) -> retval
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Note
Overload for generation of bindings only, not exported or intended for use internally from C++.
Parameters
size— 2D array size: Size(cols, rows). In the Size() constructor, the number of rows and the number of columns go in the reverse order.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 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.
ensureSizeIsEnough()#
void cv::cuda::ensureSizeIsEnough(
int rows,
int cols,
int type,
OutputArray arr )
#include <opencv2/core/cuda.hpp>
Python:
cv.cuda.ensureSizeIsEnough(rows, cols, type[, arr]) -> arr
Ensures that the size of a matrix is big enough and the matrix has a proper type.
The function does not reallocate memory if the matrix has proper attributes already.
Parameters
rows— Minimum desired number of rows.cols— Minimum desired number of columns.type— Desired matrix type.arr— Destination matrix.
registerPageLocked()#
void cv::cuda::registerPageLocked(Mat & m)
#include <opencv2/core/cuda.hpp>
Python:
cv.cuda.registerPageLocked(m)
Page-locks the memory of matrix and maps it for the device(s).
Parameters
m— Input matrix.
setBufferPoolConfig()#
void cv::cuda::setBufferPoolConfig(
int deviceId,
size_t stackSize,
int stackCount )
#include <opencv2/core/cuda.hpp>
Python:
cv.cuda.setBufferPoolConfig(deviceId, stackSize, stackCount)
setBufferPoolUsage()#
void cv::cuda::setBufferPoolUsage(bool on)
#include <opencv2/core/cuda.hpp>
Python:
cv.cuda.setBufferPoolUsage(on)
BufferPool management (must be called before Stream creation)
unregisterPageLocked()#
void cv::cuda::unregisterPageLocked(Mat & m)
#include <opencv2/core/cuda.hpp>
Python:
cv.cuda.unregisterPageLocked(m)
Unmaps the memory of matrix and makes it pageable again.
Parameters
m— Input matrix.
wrapStream()#
Stream cv::cuda::wrapStream(size_t cudaStreamMemoryAddress)
#include <opencv2/core/cuda.hpp>
Python:
cv.cuda.wrapStream(cudaStreamMemoryAddress) -> retval
Bindings overload to create a Stream object from the address stored in an existing CUDA Runtime API stream pointer (cudaStream_t).
Note
Overload for generation of bindings only, not exported or intended for use internally from C++.
Parameters
cudaStreamMemoryAddress— Memory address stored in a CUDA Runtime API stream pointer (cudaStream_t). The created Stream object does not perform any allocation or deallocation and simply wraps existing raw CUDA Runtime API stream pointer.