cv::cuda::GpuMat Class Reference
CUDA 加速的计算机视觉 » Core part » Data Structures

Base storage class for GPU memory with reference counting. 更多...

#include <opencv2/core/cuda.hpp>

Inheritance diagram for cv::cuda::GpuMat:
cv::cudev::GpuMat_< T >

class Allocator

Public Member Functions

GpuMat ( GpuMat::Allocator * allocator = GpuMat::defaultAllocator ())
default constructor 更多...
GpuMat (int rows , int cols , int type , GpuMat::Allocator * allocator = GpuMat::defaultAllocator ())
constructs GpuMat of the specified size and type 更多...
GpuMat ( Size size , int type , GpuMat::Allocator * allocator = GpuMat::defaultAllocator ())
GpuMat (int rows , int cols , int type , Scalar s, GpuMat::Allocator * allocator = GpuMat::defaultAllocator ())
constructs GpuMat and fills it with the specified value _s 更多...
GpuMat ( Size size , int type , Scalar s, GpuMat::Allocator * allocator = GpuMat::defaultAllocator ())
GpuMat (const GpuMat &m)
copy constructor 更多...
GpuMat (int rows , int cols , int type , void * data , size_t step = Mat::AUTO_STEP )
constructor for GpuMat headers pointing to user-allocated data 更多...
GpuMat ( Size size , int type , void * data , size_t step = Mat::AUTO_STEP )
GpuMat (const GpuMat &m, Range rowRange , Range colRange )
creates a GpuMat header for a part of the bigger matrix 更多...
GpuMat (const GpuMat &m, Rect roi)
GpuMat ( InputArray arr, GpuMat::Allocator * allocator = GpuMat::defaultAllocator ())
builds GpuMat from host memory (Blocking call) 更多...
~GpuMat ()
destructor - calls release() 更多...
GpuMat & adjustROI (int dtop, int dbottom, int dleft, int dright)
moves/resizes the current GpuMat ROI inside the parent GpuMat 更多...
void assignTo ( GpuMat &m, int type =-1) const
int channels () const
returns number of channels 更多...
GpuMat clone () const
returns deep copy of the GpuMat , i.e. the data is copied 更多...
GpuMat col (int x) const
returns a new GpuMat header for the specified column 更多...
GpuMat colRange (int startcol, int endcol) const
... for the specified column span 更多...
GpuMat colRange ( Range r) const
void convertTo ( OutputArray dst, int rtype) const
converts GpuMat to another datatype (Blocking call) 更多...
void convertTo ( OutputArray dst, int rtype, Stream &stream) const
converts GpuMat to another datatype (Non-Blocking call) 更多...
void convertTo ( OutputArray dst, int rtype, double alpha, double beta=0.0) const
converts GpuMat to another datatype with scaling (Blocking call) 更多...
void convertTo ( OutputArray dst, int rtype, double alpha, Stream &stream) const
converts GpuMat to another datatype with scaling (Non-Blocking call) 更多...
void convertTo ( OutputArray dst, int rtype, double alpha, double beta, Stream &stream) const
converts GpuMat to another datatype with scaling (Non-Blocking call) 更多...
void copyTo ( OutputArray dst) const
copies the GpuMat content to device memory (Blocking call) 更多...
void copyTo ( OutputArray dst, Stream &stream) const
copies the GpuMat content to device memory (Non-Blocking call) 更多...
void copyTo ( OutputArray dst, InputArray mask) const
copies those GpuMat elements to "m" that are marked with non-zero mask elements (Blocking call) 更多...
void copyTo ( OutputArray dst, InputArray mask, Stream &stream) const
copies those GpuMat elements to "m" that are marked with non-zero mask elements (Non-Blocking call) 更多...
void create (int rows , int cols , int type )
allocates new GpuMat data unless the GpuMat already has specified size and type 更多...
void create ( Size size , int type )
int depth () const
returns element type 更多...
void download ( OutputArray dst) const
Performs data download from GpuMat (Blocking call) 更多...
void download ( OutputArray dst, Stream &stream) const
Performs data download from GpuMat (Non-Blocking call) 更多...
size_t elemSize () const
returns element size in bytes 更多...
size_t elemSize1 () const
returns the size of element channel in bytes 更多...
bool empty () const
returns true if GpuMat data is NULL 更多...
bool isContinuous () const
void locateROI ( Size &wholeSize, Point &ofs) const
locates GpuMat header within a parent GpuMat 更多...
template<typename _Tp >
operator PtrStep< _Tp > () const
template<typename _Tp >
operator PtrStepSz< _Tp > () const
GpuMat operator() ( Range rowRange , Range colRange ) const
extracts a rectangular sub-GpuMat (this is a generalized form of row, rowRange etc.) 更多...
GpuMat operator() ( Rect roi) const
GpuMat & operator= (const GpuMat &m)
assignment operators 更多...
uchar * ptr (int y=0)
returns pointer to y-th row 更多...
const uchar * ptr (int y=0) const
template<typename _Tp >
_Tp * ptr (int y=0)
template version of the above method 更多...
template<typename _Tp >
const _Tp * ptr (int y=0) const
void release ()
decreases reference counter, deallocate the data when reference counter reaches 0 更多...
GpuMat reshape (int cn, int rows =0) const
GpuMat row (int y) const
returns a new GpuMat header for the specified row 更多...
GpuMat rowRange (int startrow, int endrow) const
... for the specified row span 更多...
GpuMat rowRange ( Range r) const
GpuMat & setTo ( Scalar s)
sets some of the GpuMat elements to s (Blocking call) 更多...
GpuMat & setTo ( Scalar s, Stream &stream)
sets some of the GpuMat elements to s (Non-Blocking call) 更多...
GpuMat & setTo ( Scalar s, InputArray mask)
sets some of the GpuMat elements to s, according to the mask (Blocking call) 更多...
GpuMat & setTo ( Scalar s, InputArray mask, Stream &stream)
sets some of the GpuMat elements to s, according to the mask (Non-Blocking call) 更多...
Size size () const
返回 GpuMat size : width == number of columns, height == number of rows 更多...
size_t step1 () const
returns step/elemSize1() 更多...
void swap ( GpuMat &mat)
swaps with other smart pointer 更多...
int type () const
returns element type 更多...
void updateContinuityFlag ()
internal use method: updates the continuity flag 更多...
void upload ( InputArray arr)
Performs data upload to GpuMat (Blocking call) 更多...
void upload ( InputArray arr, Stream &stream)
Performs data upload to GpuMat (Non-Blocking call) 更多...

Static Public Member Functions

static GpuMat::Allocator * defaultAllocator ()
default allocator 更多...
static void setDefaultAllocator ( GpuMat::Allocator * allocator )

Public Attributes

Allocator * allocator
allocator 更多...
int cols
uchar * data
pointer to the data 更多...
const uchar * dataend
uchar * datastart
helper fields used in locateROI and adjustROI 更多...
int flags
int * refcount
int rows
the number of rows and columns 更多...
size_t step
a distance between successive rows in bytes; includes the gap if any 更多...

详细描述

Base storage class for GPU memory with reference counting.

Its interface matches the Mat interface with the following limitations:

  • no arbitrary dimensions support (only 2D)
  • no functions that return references to their data (because references on GPU are not valid for CPU)
  • no expression templates technique support

Beware that the latter limitation may lead to overloaded matrix operators that cause memory allocations. The GpuMat class is convertible to cuda::PtrStepSz and cuda::PtrStep so it can be passed directly to the kernel.

注意
In contrast with Mat , in most cases GpuMat::isContinuous() == false . This means that rows are aligned to a size depending on the hardware. Single-row GpuMat is always a continuous matrix.
You are not recommended to leave static or global GpuMat variables allocated, that is, to rely on its destructor. The destruction order of such variables and CUDA context is undefined. GPU memory release function returns error if the CUDA context has been destroyed before.

Some member functions are described as a "Blocking Call" while some are described as a "Non-Blocking Call". Blocking functions are synchronous to host. It is guaranteed that the GPU operation is finished when the function returns. However, non-blocking functions are asynchronous to host. Those functions may return even if the GPU operation is not finished.

Compared to their blocking counterpart, non-blocking functions accept Stream as an additional argument. If a non-default stream is passed, the GPU operation may overlap with operations in other streams.

另请参阅
Mat

Constructor & Destructor Documentation

GpuMat() [1/11]

cv::cuda::GpuMat::GpuMat ( GpuMat::Allocator * allocator = GpuMat::defaultAllocator () )
explicit
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

default constructor

GpuMat() [2/11]

cv::cuda::GpuMat::GpuMat ( int rows ,
int cols ,
int type ,
GpuMat::Allocator * allocator = GpuMat::defaultAllocator ()
)
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

constructs GpuMat of the specified size and type

GpuMat() [3/11]

cv::cuda::GpuMat::GpuMat ( Size size ,
int type ,
GpuMat::Allocator * allocator = GpuMat::defaultAllocator ()
)
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

GpuMat() [4/11]

cv::cuda::GpuMat::GpuMat ( int rows ,
int cols ,
int type ,
Scalar s ,
GpuMat::Allocator * allocator = GpuMat::defaultAllocator ()
)
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

constructs GpuMat and fills it with the specified value _s

GpuMat() [5/11]

cv::cuda::GpuMat::GpuMat ( Size size ,
int type ,
Scalar s ,
GpuMat::Allocator * allocator = GpuMat::defaultAllocator ()
)
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

GpuMat() [6/11]

cv::cuda::GpuMat::GpuMat ( const GpuMat & m )
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

copy constructor

GpuMat() [7/11]

cv::cuda::GpuMat::GpuMat ( int rows ,
int cols ,
int type ,
void * data ,
size_t step = Mat::AUTO_STEP
)
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

constructor for GpuMat headers pointing to user-allocated data

GpuMat() [8/11]

cv::cuda::GpuMat::GpuMat ( Size size ,
int type ,
void * data ,
size_t step = Mat::AUTO_STEP
)
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

GpuMat() [9/11]

cv::cuda::GpuMat::GpuMat ( const GpuMat & m ,
Range rowRange ,
Range colRange
)
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

creates a GpuMat header for a part of the bigger matrix

GpuMat() [10/11]

cv::cuda::GpuMat::GpuMat ( const GpuMat & m ,
Rect roi
)
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

GpuMat() [11/11]

cv::cuda::GpuMat::GpuMat ( InputArray arr ,
GpuMat::Allocator * allocator = GpuMat::defaultAllocator ()
)
explicit
Python:
<cuda_GpuMat object> = cv.cuda_GpuMat( [, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( rows, cols, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( size, type, s[, allocator] )
<cuda_GpuMat object> = cv.cuda_GpuMat( m )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, rowRange, colRange )
<cuda_GpuMat object> = cv.cuda_GpuMat( m, roi )
<cuda_GpuMat object> = cv.cuda_GpuMat( arr[, allocator] )

builds GpuMat from host memory (Blocking call)

~GpuMat()

cv::cuda::GpuMat::~GpuMat ( )

destructor - calls release()

成员函数文档编制

adjustROI()

GpuMat & cv::cuda::GpuMat::adjustROI ( int dtop ,
int dbottom ,
int dleft ,
int dright
)
Python:
retval = cv.cuda_GpuMat.adjustROI( dtop, dbottom, dleft, dright )

moves/resizes the current GpuMat ROI inside the parent GpuMat

assignTo()

void cv::cuda::GpuMat::assignTo ( GpuMat & m ,
int type = -1
) const
Python:
None = cv.cuda_GpuMat.assignTo( m[, type] )

channels()

int cv::cuda::GpuMat::channels ( ) const
Python:
retval = cv.cuda_GpuMat.channels( )

returns number of channels

clone()

GpuMat cv::cuda::GpuMat::clone ( ) const
Python:
retval = cv.cuda_GpuMat.clone( )

returns deep copy of the GpuMat , i.e. the data is copied

col()

GpuMat cv::cuda::GpuMat::col ( int x ) const
Python:
retval = cv.cuda_GpuMat.col( x )

returns a new GpuMat header for the specified column

colRange() [1/2]

GpuMat cv::cuda::GpuMat::colRange ( int startcol ,
int endcol
) const
Python:
retval = cv.cuda_GpuMat.colRange( startcol, endcol )
retval = cv.cuda_GpuMat.colRange( r )

... for the specified column span

colRange() [2/2]

GpuMat cv::cuda::GpuMat::colRange ( Range r ) const
Python:
retval = cv.cuda_GpuMat.colRange( startcol, endcol )
retval = cv.cuda_GpuMat.colRange( r )

convertTo() [1/5]

void cv::cuda::GpuMat::convertTo ( OutputArray dst ,
int rtype
) const
Python:
dst = cv.cuda_GpuMat.convertTo( rtype[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, stream[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha[, dst[, beta]] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha, stream[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha, beta, stream[, dst] )

converts GpuMat to another datatype (Blocking call)

convertTo() [2/5]

void cv::cuda::GpuMat::convertTo ( OutputArray dst ,
int rtype ,
Stream & stream
) const
Python:
dst = cv.cuda_GpuMat.convertTo( rtype[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, stream[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha[, dst[, beta]] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha, stream[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha, beta, stream[, dst] )

converts GpuMat to another datatype (Non-Blocking call)

convertTo() [3/5]

void cv::cuda::GpuMat::convertTo ( OutputArray dst ,
int rtype ,
double alpha ,
double beta = 0.0
) const
Python:
dst = cv.cuda_GpuMat.convertTo( rtype[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, stream[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha[, dst[, beta]] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha, stream[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha, beta, stream[, dst] )

converts GpuMat to another datatype with scaling (Blocking call)

convertTo() [4/5]

void cv::cuda::GpuMat::convertTo ( OutputArray dst ,
int rtype ,
double alpha ,
Stream & stream
) const
Python:
dst = cv.cuda_GpuMat.convertTo( rtype[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, stream[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha[, dst[, beta]] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha, stream[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha, beta, stream[, dst] )

converts GpuMat to another datatype with scaling (Non-Blocking call)

convertTo() [5/5]

void cv::cuda::GpuMat::convertTo ( OutputArray dst ,
int rtype ,
double alpha ,
double beta ,
Stream & stream
) const
Python:
dst = cv.cuda_GpuMat.convertTo( rtype[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, stream[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha[, dst[, beta]] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha, stream[, dst] )
dst = cv.cuda_GpuMat.convertTo( rtype, alpha, beta, stream[, dst] )

converts GpuMat to another datatype with scaling (Non-Blocking call)

copyTo() [1/4]

void cv::cuda::GpuMat::copyTo ( OutputArray dst ) const
Python:
dst = cv.cuda_GpuMat.copyTo( [, dst] )
dst = cv.cuda_GpuMat.copyTo( stream[, dst] )
dst = cv.cuda_GpuMat.copyTo( mask[, dst] )
dst = cv.cuda_GpuMat.copyTo( mask, stream[, dst] )

copies the GpuMat content to device memory (Blocking call)

copyTo() [2/4]

void cv::cuda::GpuMat::copyTo ( OutputArray dst ,
Stream & stream
) const
Python:
dst = cv.cuda_GpuMat.copyTo( [, dst] )
dst = cv.cuda_GpuMat.copyTo( stream[, dst] )
dst = cv.cuda_GpuMat.copyTo( mask[, dst] )
dst = cv.cuda_GpuMat.copyTo( mask, stream[, dst] )

copies the GpuMat content to device memory (Non-Blocking call)

copyTo() [3/4]

void cv::cuda::GpuMat::copyTo ( OutputArray dst ,
InputArray mask
) const
Python:
dst = cv.cuda_GpuMat.copyTo( [, dst] )
dst = cv.cuda_GpuMat.copyTo( stream[, dst] )
dst = cv.cuda_GpuMat.copyTo( mask[, dst] )
dst = cv.cuda_GpuMat.copyTo( mask, stream[, dst] )

copies those GpuMat elements to "m" that are marked with non-zero mask elements (Blocking call)

copyTo() [4/4]

void cv::cuda::GpuMat::copyTo ( OutputArray dst ,
InputArray mask ,
Stream & stream
) const
Python:
dst = cv.cuda_GpuMat.copyTo( [, dst] )
dst = cv.cuda_GpuMat.copyTo( stream[, dst] )
dst = cv.cuda_GpuMat.copyTo( mask[, dst] )
dst = cv.cuda_GpuMat.copyTo( mask, stream[, dst] )

copies those GpuMat elements to "m" that are marked with non-zero mask elements (Non-Blocking call)

create() [1/2]

void cv::cuda::GpuMat::create ( int rows ,
int cols ,
int type
)
Python:
None = cv.cuda_GpuMat.create( rows, cols, type )
None = cv.cuda_GpuMat.create( size, type )

allocates new GpuMat data unless the GpuMat already has specified size and type

create() [2/2]

void cv::cuda::GpuMat::create ( Size size ,
int type
)
Python:
None = cv.cuda_GpuMat.create( rows, cols, type )
None = cv.cuda_GpuMat.create( size, type )

defaultAllocator()

static GpuMat::Allocator * cv::cuda::GpuMat::defaultAllocator ( )
static
Python:
retval = cv.cuda.GpuMat_defaultAllocator( )

default allocator

depth()

int cv::cuda::GpuMat::depth ( ) const
Python:
retval = cv.cuda_GpuMat.depth( )

returns element type

download() [1/2]

void cv::cuda::GpuMat::download ( OutputArray dst ) const
Python:
dst = cv.cuda_GpuMat.download( [, dst] )
dst = cv.cuda_GpuMat.download( stream[, dst] )

Performs data download from GpuMat (Blocking call)

This function copies data from device memory to host memory. As being a blocking call, it is guaranteed that the copy operation is finished when this function returns.

download() [2/2]

void cv::cuda::GpuMat::download ( OutputArray dst ,
Stream & stream
) const
Python:
dst = cv.cuda_GpuMat.download( [, dst] )
dst = cv.cuda_GpuMat.download( stream[, dst] )

Performs data download from GpuMat (Non-Blocking call)

This function copies data from device memory to host memory. As being a non-blocking call, this function may return even if the copy operation is not finished.

The copy operation may be overlapped with operations in other non-default streams if stream is not the default stream and dst is HostMem allocated with HostMem::PAGE_LOCKED 选项。

elemSize()

size_t cv::cuda::GpuMat::elemSize ( ) const
Python:
retval = cv.cuda_GpuMat.elemSize( )

returns element size in bytes

elemSize1()

size_t cv::cuda::GpuMat::elemSize1 ( ) const
Python:
retval = cv.cuda_GpuMat.elemSize1( )

returns the size of element channel in bytes

empty()

bool cv::cuda::GpuMat::empty ( ) const
Python:
retval = cv.cuda_GpuMat.empty( )

returns true if GpuMat data is NULL

isContinuous()

bool cv::cuda::GpuMat::isContinuous ( ) const
Python:
retval = cv.cuda_GpuMat.isContinuous( )

returns true iff the GpuMat data is continuous (i.e. when there are no gaps between successive rows)

locateROI()

void cv::cuda::GpuMat::locateROI ( Size & wholeSize ,
Point & ofs
) const
Python:
None = cv.cuda_GpuMat.locateROI( wholeSize, ofs )

locates GpuMat header within a parent GpuMat

operator PtrStep< _Tp >()

template<typename _Tp >
cv::cuda::GpuMat::operator PtrStep< _Tp > ( ) const

operator PtrStepSz< _Tp >()

template<typename _Tp >
cv::cuda::GpuMat::operator PtrStepSz< _Tp > ( ) const

operator()() [1/2]

GpuMat cv::cuda::GpuMat::operator() ( Range rowRange ,
Range colRange
) const

extracts a rectangular sub-GpuMat (this is a generalized form of row, rowRange etc.)

operator()() [2/2]

GpuMat cv::cuda::GpuMat::operator() ( Rect roi ) const

operator=()

GpuMat & cv::cuda::GpuMat::operator= ( const GpuMat & m )

assignment operators

ptr() [1/4]

uchar * cv::cuda::GpuMat::ptr ( int y = 0 )

returns pointer to y-th row

ptr() [2/4]

const uchar * cv::cuda::GpuMat::ptr ( int y = 0 ) const

ptr() [3/4]

template<typename _Tp >
_Tp* cv::cuda::GpuMat::ptr ( int y = 0 )

template version of the above method

ptr() [4/4]

template<typename _Tp >
const _Tp* cv::cuda::GpuMat::ptr ( int y = 0 ) const

release()

void cv::cuda::GpuMat::release ( )

decreases reference counter, deallocate the data when reference counter reaches 0

reshape()

GpuMat cv::cuda::GpuMat::reshape ( int cn ,
int rows = 0
) const
Python:
retval = cv.cuda_GpuMat.reshape( cn[, rows] )

creates alternative GpuMat header for the same data, with different number of channels and/or different number of rows

row()

GpuMat cv::cuda::GpuMat::row ( int y ) const
Python:
retval = cv.cuda_GpuMat.row( y )

returns a new GpuMat header for the specified row

rowRange() [1/2]

GpuMat cv::cuda::GpuMat::rowRange ( int startrow ,
int endrow
) const
Python:
retval = cv.cuda_GpuMat.rowRange( startrow, endrow )
retval = cv.cuda_GpuMat.rowRange( r )

... for the specified row span

rowRange() [2/2]

GpuMat cv::cuda::GpuMat::rowRange ( Range r ) const
Python:
retval = cv.cuda_GpuMat.rowRange( startrow, endrow )
retval = cv.cuda_GpuMat.rowRange( r )

setDefaultAllocator()

static void cv::cuda::GpuMat::setDefaultAllocator ( GpuMat::Allocator * allocator )
static
Python:
None = cv.cuda.GpuMat_setDefaultAllocator( allocator )

setTo() [1/4]

GpuMat & cv::cuda::GpuMat::setTo ( Scalar s )
Python:
retval = cv.cuda_GpuMat.setTo( s )
retval = cv.cuda_GpuMat.setTo( s, stream )
retval = cv.cuda_GpuMat.setTo( s, mask )
retval = cv.cuda_GpuMat.setTo( s, mask, stream )

sets some of the GpuMat elements to s (Blocking call)

setTo() [2/4]

GpuMat & cv::cuda::GpuMat::setTo ( Scalar s ,
Stream & stream
)
Python:
retval = cv.cuda_GpuMat.setTo( s )
retval = cv.cuda_GpuMat.setTo( s, stream )
retval = cv.cuda_GpuMat.setTo( s, mask )
retval = cv.cuda_GpuMat.setTo( s, mask, stream )

sets some of the GpuMat elements to s (Non-Blocking call)

setTo() [3/4]

GpuMat & cv::cuda::GpuMat::setTo ( Scalar s ,
InputArray mask
)
Python:
retval = cv.cuda_GpuMat.setTo( s )
retval = cv.cuda_GpuMat.setTo( s, stream )
retval = cv.cuda_GpuMat.setTo( s, mask )
retval = cv.cuda_GpuMat.setTo( s, mask, stream )

sets some of the GpuMat elements to s, according to the mask (Blocking call)

setTo() [4/4]

GpuMat & cv::cuda::GpuMat::setTo ( Scalar s ,
InputArray mask ,
Stream & stream
)
Python:
retval = cv.cuda_GpuMat.setTo( s )
retval = cv.cuda_GpuMat.setTo( s, stream )
retval = cv.cuda_GpuMat.setTo( s, mask )
retval = cv.cuda_GpuMat.setTo( s, mask, stream )

sets some of the GpuMat elements to s, according to the mask (Non-Blocking call)

size()

Size cv::cuda::GpuMat::size ( ) const
Python:
retval = cv.cuda_GpuMat.size( )

返回 GpuMat size : width == number of columns, height == number of rows

step1()

size_t cv::cuda::GpuMat::step1 ( ) const
Python:
retval = cv.cuda_GpuMat.step1( )

returns step/elemSize1()

swap()

void cv::cuda::GpuMat::swap ( GpuMat & mat )
Python:
None = cv.cuda_GpuMat.swap( mat )

swaps with other smart pointer

type()

int cv::cuda::GpuMat::type ( ) const
Python:
retval = cv.cuda_GpuMat.type( )

returns element type

updateContinuityFlag()

void cv::cuda::GpuMat::updateContinuityFlag ( )
Python:
None = cv.cuda_GpuMat.updateContinuityFlag( )

internal use method: updates the continuity flag

upload() [1/2]

void cv::cuda::GpuMat::upload ( InputArray arr )
Python:
None = cv.cuda_GpuMat.upload( arr )
None = cv.cuda_GpuMat.upload( arr, stream )

Performs data upload to GpuMat (Blocking call)

This function copies data from host memory to device memory. As being a blocking call, it is guaranteed that the copy operation is finished when this function returns.

upload() [2/2]

void cv::cuda::GpuMat::upload ( InputArray arr ,
Stream & stream
)
Python:
None = cv.cuda_GpuMat.upload( arr )
None = cv.cuda_GpuMat.upload( arr, stream )

Performs data upload to GpuMat (Non-Blocking call)

This function copies data from host memory to device memory. As being a non-blocking call, this function may return even if the copy operation is not finished.

The copy operation may be overlapped with operations in other non-default streams if stream is not the default stream and dst is HostMem allocated with HostMem::PAGE_LOCKED 选项。

Member Data Documentation

allocator

Allocator * cv::cuda::GpuMat::allocator

allocator

cols

int cv::cuda::GpuMat::cols

data

uchar * cv::cuda::GpuMat::data

pointer to the data

dataend

const uchar * cv::cuda::GpuMat::dataend

datastart

uchar * cv::cuda::GpuMat::datastart

helper fields used in locateROI and adjustROI

flags

int cv::cuda::GpuMat::flags

includes several bit-fields:

  • the magic signature
  • continuity flag
  • depth
  • number of channels

refcount

int* cv::cuda::GpuMat::refcount

pointer to the reference counter; when GpuMat points to user-allocated data, the pointer is NULL

rows

int cv::cuda::GpuMat::rows

the number of rows and columns

step

size_t cv::cuda::GpuMat::step

a distance between successive rows in bytes; includes the gap if any


The documentation for this class was generated from the following file: