cv::UMat Class Reference
核心功能 » 基本结构

#include <opencv2/core/mat.hpp>

公共类型

enum {
MAGIC_VAL = 0x42FF0000,
AUTO_STEP = 0,
CONTINUOUS_FLAG = CV_MAT_CONT_FLAG,
SUBMATRIX_FLAG = CV_SUBMAT_FLAG
}
enum {
MAGIC_MASK = 0xFFFF0000,
TYPE_MASK = 0x00000FFF,
DEPTH_MASK = 7
}

Public Member Functions

UMat ( UMatUsageFlags usageFlags = USAGE_DEFAULT )
default constructor 更多...
UMat (int rows , int cols , int type , UMatUsageFlags usageFlags = USAGE_DEFAULT )
constructs 2D matrix of the specified size and type 更多...
UMat ( Size size , int type , UMatUsageFlags usageFlags = USAGE_DEFAULT )
UMat (int rows , int cols , int type , const Scalar &s, UMatUsageFlags usageFlags = USAGE_DEFAULT )
constructs 2D matrix and fills it with the specified value _s. 更多...
UMat ( Size size , int type , const Scalar &s, UMatUsageFlags usageFlags = USAGE_DEFAULT )
UMat (int ndims, const int *sizes, int type , UMatUsageFlags usageFlags = USAGE_DEFAULT )
constructs n-dimensional matrix 更多...
UMat (int ndims, const int *sizes, int type , const Scalar &s, UMatUsageFlags usageFlags = USAGE_DEFAULT )
UMat (const UMat &m)
copy constructor 更多...
UMat (const UMat &m, const Range & rowRange , const Range & colRange = Range::all ())
creates a matrix header for a part of the bigger matrix 更多...
UMat (const UMat &m, const Rect &roi)
UMat (const UMat &m, const Range *ranges)
UMat (const UMat &m, const std::vector< Range > &ranges)
template<typename _Tp >
UMat (const std::vector< _Tp > &vec, bool copyData=false)
builds matrix from std::vector with or without copying the data 更多...
template<typename _Tp , int n>
UMat (const Vec < _Tp, n > &vec, bool copyData=true)
builds matrix from cv::Vec ; the data is copied by default 更多...
template<typename _Tp , int m, int n>
UMat (const Matx < _Tp, m, n > &mtx, bool copyData=true)
builds matrix from cv::Matx ; the data is copied by default 更多...
template<typename _Tp >
UMat (const Point_ < _Tp > &pt, bool copyData=true)
builds matrix from a 2D point 更多...
template<typename _Tp >
UMat (const Point3_ < _Tp > &pt, bool copyData=true)
builds matrix from a 3D point 更多...
template<typename _Tp >
UMat (const MatCommaInitializer_ < _Tp > &commaInitializer)
builds matrix from comma initializer 更多...
UMat ( UMat &&m)
~UMat ()
destructor - calls release() 更多...
void addref ()
increases the reference counter; use with care to avoid memleaks 更多...
UMat & adjustROI (int dtop, int dbottom, int dleft, int dright)
moves/resizes the current matrix ROI inside the parent matrix. 更多...
void assignTo ( UMat &m, int type =-1) const
int channels () const
returns element type, similar to CV_MAT_CN(cvmat->type) 更多...
int checkVector (int elemChannels, int depth =-1, bool requireContinuous=true) const
returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise 更多...
UMat clone () const CV_NODISCARD
returns deep copy of the matrix, i.e. the data is copied 更多...
UMat col (int x) const
returns a new matrix header for the specified column 更多...
UMat colRange (int startcol, int endcol) const
... for the specified column span 更多...
UMat colRange (const Range &r) const
void convertTo ( OutputArray m, int rtype, double alpha=1, double beta=0) const
converts matrix to another datatype with optional scaling. See cvConvertScale. 更多...
void copySize (const UMat &m)
internal use function; properly re-allocates _size, _step arrays 更多...
void copyTo ( OutputArray m) const
copies the matrix content to "m". 更多...
void copyTo ( OutputArray m, InputArray mask) const
copies those matrix elements to "m" that are marked with non-zero mask elements. 更多...
void create (int rows , int cols , int type , UMatUsageFlags usageFlags = USAGE_DEFAULT )
allocates new matrix data unless the matrix already has specified size and type. 更多...
void create ( Size size , int type , UMatUsageFlags usageFlags = USAGE_DEFAULT )
void create (int ndims, const int *sizes, int type , UMatUsageFlags usageFlags = USAGE_DEFAULT )
void create (const std::vector< int > &sizes, int type , UMatUsageFlags usageFlags = USAGE_DEFAULT )
void deallocate ()
deallocates the matrix data 更多...
int depth () const
returns element type, similar to CV_MAT_DEPTH(cvmat->type) 更多...
UMat diag (int d=0) const
double dot ( InputArray m) const
computes dot-product 更多...
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 matrix data is NULL 更多...
Mat getMat ( AccessFlag flags ) const
void * handle ( AccessFlag accessFlags) const
UMat inv (int method= DECOMP_LU ) const
matrix inversion by means of matrix expressions 更多...
bool isContinuous () const
returns true iff the matrix data is continuous 更多...
bool isSubmatrix () const
returns true if the matrix is a submatrix of another matrix 更多...
void locateROI ( Size &wholeSize, Point &ofs) const
locates matrix header within a parent matrix. See below 更多...
UMat mul ( InputArray m, double scale=1) const
per-element matrix multiplication by means of matrix expressions 更多...
void ndoffset (size_t *ofs) const
UMat operator() ( Range rowRange , Range colRange ) const
extracts a rectangular sub-matrix 更多...
UMat operator() (const Rect &roi) const
UMat operator() (const Range *ranges) const
UMat operator() (const std::vector< Range > &ranges) const
UMat & operator= (const UMat &m)
assignment operators 更多...
UMat & operator= (const Scalar &s)
sets every matrix element to s 更多...
UMat & operator= ( UMat &&m)
void release ()
decreases reference counter; 更多...
UMat reshape (int cn, int rows =0) const
creates alternative matrix header for the same data, with different 更多...
UMat reshape (int cn, int newndims, const int *newsz) const
UMat row (int y) const
returns a new matrix header for the specified row 更多...
UMat rowRange (int startrow, int endrow) const
... for the specified row span 更多...
UMat rowRange (const Range &r) const
UMat & setTo ( InputArray value, InputArray mask= noArray ())
sets some of the matrix elements to s, according to the mask 更多...
size_t step1 (int i=0) const
returns step/elemSize1() 更多...
UMat t () const
matrix transposition by means of matrix expressions 更多...
size_t total () const
returns the total number of matrix elements 更多...
int type () const
returns element type, similar to CV_MAT_TYPE(cvmat->type) 更多...
void updateContinuityFlag ()
internal use method: updates the continuity flag 更多...

Static Public Member Functions

static UMat diag (const UMat &d)
constructs a square diagonal matrix which main diagonal is vector "d" 更多...
static UMat eye (int rows , int cols , int type )
static UMat eye ( Size size , int type )
static MatAllocator * getStdAllocator ()
and the standard allocator 更多...
static UMat ones (int rows , int cols , int type )
static UMat ones ( Size size , int type )
static UMat ones (int ndims, const int *sz, int type )
static UMat zeros (int rows , int cols , int type )
Matlab-style matrix initialization. 更多...
static UMat zeros ( Size size , int type )
static UMat zeros (int ndims, const int *sz, int type )

Public Attributes

MatAllocator * allocator
custom allocator 更多...
int cols
int dims
the matrix dimensionality, >= 2 更多...
int flags
size_t offset
int rows
the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions 更多...
MatSize size
MatStep step
UMatData * u
UMatUsageFlags usageFlags

详细描述

Member Enumeration Documentation

anonymous enum

anonymous enum
枚举器
MAGIC_VAL
AUTO_STEP
CONTINUOUS_FLAG
SUBMATRIX_FLAG

anonymous enum

anonymous enum
枚举器
MAGIC_MASK
TYPE_MASK
DEPTH_MASK

Constructor & Destructor Documentation

UMat() [1/19]

cv::UMat::UMat ( UMatUsageFlags usageFlags = USAGE_DEFAULT )
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

default constructor

UMat() [2/19]

cv::UMat::UMat ( int rows ,
int cols ,
int type ,
UMatUsageFlags usageFlags = USAGE_DEFAULT
)
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

constructs 2D matrix of the specified size and type

UMat() [3/19]

cv::UMat::UMat ( Size size ,
int type ,
UMatUsageFlags usageFlags = USAGE_DEFAULT
)
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

UMat() [4/19]

cv::UMat::UMat ( int rows ,
int cols ,
int type ,
const Scalar & s ,
UMatUsageFlags usageFlags = USAGE_DEFAULT
)
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

constructs 2D matrix and fills it with the specified value _s.

UMat() [5/19]

cv::UMat::UMat ( Size size ,
int type ,
const Scalar & s ,
UMatUsageFlags usageFlags = USAGE_DEFAULT
)
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

UMat() [6/19]

cv::UMat::UMat ( int ndims ,
const int * sizes ,
int type ,
UMatUsageFlags usageFlags = USAGE_DEFAULT
)
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

constructs n-dimensional matrix

UMat() [7/19]

cv::UMat::UMat ( int ndims ,
const int * sizes ,
int type ,
const Scalar & s ,
UMatUsageFlags usageFlags = USAGE_DEFAULT
)
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

UMat() [8/19]

cv::UMat::UMat ( const UMat & m )
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

copy constructor

UMat() [9/19]

cv::UMat::UMat ( const UMat & m ,
const Range & rowRange ,
const Range & colRange = Range::all ()
)
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

creates a matrix header for a part of the bigger matrix

UMat() [10/19]

cv::UMat::UMat ( const UMat & m ,
const Rect & roi
)
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

UMat() [11/19]

cv::UMat::UMat ( const UMat & m ,
const Range * ranges
)
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

UMat() [12/19]

cv::UMat::UMat ( const UMat & m ,
const std::vector< Range > & ranges
)
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

UMat() [13/19]

template<typename _Tp >
cv::UMat::UMat ( const std::vector< _Tp > & vec ,
bool copyData = false
)
explicit
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

builds matrix from std::vector with or without copying the data

UMat() [14/19]

template<typename _Tp , int n>
cv::UMat::UMat ( const Vec < _Tp, n > & vec ,
bool copyData = true
)
explicit
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

builds matrix from cv::Vec ; the data is copied by default

UMat() [15/19]

template<typename _Tp , int m, int n>
cv::UMat::UMat ( const Matx < _Tp, m, n > & mtx ,
bool copyData = true
)
explicit
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

builds matrix from cv::Matx ; the data is copied by default

UMat() [16/19]

template<typename _Tp >
cv::UMat::UMat ( const Point_ < _Tp > & pt ,
bool copyData = true
)
explicit
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

builds matrix from a 2D point

UMat() [17/19]

template<typename _Tp >
cv::UMat::UMat ( const Point3_ < _Tp > & pt ,
bool copyData = true
)
explicit
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

builds matrix from a 3D point

UMat() [18/19]

template<typename _Tp >
cv::UMat::UMat ( const MatCommaInitializer_ < _Tp > & commaInitializer )
explicit
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

builds matrix from comma initializer

~UMat()

cv::UMat::~UMat ( )

destructor - calls release()

UMat() [19/19]

cv::UMat::UMat ( UMat && m )
Python:
<UMat object> = cv.UMat( [, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type[, usageFlags] )
<UMat object> = cv.UMat( size, type[, usageFlags] )
<UMat object> = cv.UMat( rows, cols, type, s[, usageFlags] )
<UMat object> = cv.UMat( size, type, s[, usageFlags] )
<UMat object> = cv.UMat( m )
<UMat object> = cv.UMat( m, rowRange[, colRange] )
<UMat object> = cv.UMat( m, roi )
<UMat object> = cv.UMat( m, ranges )

成员函数文档编制

addref()

void cv::UMat::addref ( )

increases the reference counter; use with care to avoid memleaks

adjustROI()

UMat & cv::UMat::adjustROI ( int dtop ,
int dbottom ,
int dleft ,
int dright
)

moves/resizes the current matrix ROI inside the parent matrix.

assignTo()

void cv::UMat::assignTo ( UMat & m ,
int type = -1
) const

channels()

int cv::UMat::channels ( ) const

returns element type, similar to CV_MAT_CN(cvmat->type)

checkVector()

int cv::UMat::checkVector ( int elemChannels ,
int depth = -1 ,
bool requireContinuous = true
) const

returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise

clone()

UMat cv::UMat::clone ( ) const

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

col()

UMat cv::UMat::col ( int x ) const

returns a new matrix header for the specified column

colRange() [1/2]

UMat cv::UMat::colRange ( int startcol ,
int endcol
) const

... for the specified column span

colRange() [2/2]

UMat cv::UMat::colRange ( const Range & r ) const

convertTo()

void cv::UMat::convertTo ( OutputArray m ,
int rtype ,
double alpha = 1 ,
double beta = 0
) const

converts matrix to another datatype with optional scaling. See cvConvertScale.

copySize()

void cv::UMat::copySize ( const UMat & m )

internal use function; properly re-allocates _size, _step arrays

copyTo() [1/2]

void cv::UMat::copyTo ( OutputArray m ) const

copies the matrix content to "m".

范例:
samples/tapi/hog.cpp ,和 samples/tapi/squares.cpp .

copyTo() [2/2]

void cv::UMat::copyTo ( OutputArray m ,
InputArray mask
) const

copies those matrix elements to "m" that are marked with non-zero mask elements.

create() [1/4]

void cv::UMat::create ( int rows ,
int cols ,
int type ,
UMatUsageFlags usageFlags = USAGE_DEFAULT
)

allocates new matrix data unless the matrix already has specified size and type.

create() [2/4]

void cv::UMat::create ( Size size ,
int type ,
UMatUsageFlags usageFlags = USAGE_DEFAULT
)

create() [3/4]

void cv::UMat::create ( int ndims ,
const int * sizes ,
int type ,
UMatUsageFlags usageFlags = USAGE_DEFAULT
)

create() [4/4]

void cv::UMat::create ( const std::vector< int > & sizes ,
int type ,
UMatUsageFlags usageFlags = USAGE_DEFAULT
)

deallocate()

void cv::UMat::deallocate ( )

deallocates the matrix data

depth()

int cv::UMat::depth ( ) const

returns element type, similar to CV_MAT_DEPTH(cvmat->type)

diag() [1/2]

UMat cv::UMat::diag ( int d = 0 ) const

... for the specified diagonal (d=0 - the main diagonal, >0 - a diagonal from the upper half, <0 - a diagonal from the lower half)

diag() [2/2]

static UMat cv::UMat::diag ( const UMat & d )
static

constructs a square diagonal matrix which main diagonal is vector "d"

dot()

double cv::UMat::dot ( InputArray m ) const

computes dot-product

elemSize()

size_t cv::UMat::elemSize ( ) const

returns element size in bytes,

elemSize1()

size_t cv::UMat::elemSize1 ( ) const

returns the size of element channel in bytes.

empty()

bool cv::UMat::empty ( ) const

returns true if matrix data is NULL

范例:
samples/tapi/hog.cpp ,和 samples/tapi/squares.cpp .

eye() [1/2]

static UMat cv::UMat::eye ( int rows ,
int cols ,
int type
)
static

eye() [2/2]

static UMat cv::UMat::eye ( Size size ,
int type
)
static

getMat()

Mat cv::UMat::getMat ( AccessFlag flags ) const

getStdAllocator()

static MatAllocator * cv::UMat::getStdAllocator ( )
static

and the standard allocator

handle()

void* cv::UMat::handle ( AccessFlag accessFlags ) const
Python:
retval = cv.UMat.handle( accessFlags )

Returns the OpenCL buffer handle on which UMat operates on. The UMat instance should be kept alive during the use of the handle to prevent the buffer to be returned to the OpenCV buffer pool.

inv()

UMat cv::UMat::inv ( int 方法 = DECOMP_LU ) const

matrix inversion by means of matrix expressions

isContinuous()

bool cv::UMat::isContinuous ( ) const
Python:
retval = cv.UMat.isContinuous( )

returns true iff the matrix data is continuous

isSubmatrix()

bool cv::UMat::isSubmatrix ( ) const
Python:
retval = cv.UMat.isSubmatrix( )

returns true if the matrix is a submatrix of another matrix

locateROI()

void cv::UMat::locateROI ( Size & wholeSize ,
Point & ofs
) const

locates matrix header within a parent matrix. See below

mul()

UMat cv::UMat::mul ( InputArray m ,
double scale = 1
) const

per-element matrix multiplication by means of matrix expressions

ndoffset()

void cv::UMat::ndoffset ( size_t * ofs ) const

ones() [1/3]

static UMat cv::UMat::ones ( int rows ,
int cols ,
int type
)
static

ones() [2/3]

static UMat cv::UMat::ones ( Size size ,
int type
)
static

ones() [3/3]

static UMat cv::UMat::ones ( int ndims ,
const int * sz ,
int type
)
static

operator()() [1/4]

UMat cv::UMat::operator() ( Range rowRange ,
Range colRange
) const

extracts a rectangular sub-matrix

operator()() [2/4]

UMat cv::UMat::operator() ( const Rect & roi ) const

operator()() [3/4]

UMat cv::UMat::operator() ( const Range * ranges ) const

operator()() [4/4]

UMat cv::UMat::operator() ( const std::vector< Range > & ranges ) const

operator=() [1/3]

UMat & cv::UMat::operator= ( const UMat & m )

assignment operators

operator=() [2/3]

UMat & cv::UMat::operator= ( const Scalar & s )

sets every matrix element to s

operator=() [3/3]

UMat & cv::UMat::operator= ( UMat && m )

release()

void cv::UMat::release ( )

decreases reference counter;

reshape() [1/2]

UMat cv::UMat::reshape ( int cn ,
int rows = 0
) const

creates alternative matrix header for the same data, with different

reshape() [2/2]

UMat cv::UMat::reshape ( int cn ,
int newndims ,
const int * newsz
) const

row()

UMat cv::UMat::row ( int y ) const

returns a new matrix header for the specified row

rowRange() [1/2]

UMat cv::UMat::rowRange ( int startrow ,
int endrow
) const

... for the specified row span

rowRange() [2/2]

UMat cv::UMat::rowRange ( const Range & r ) const

setTo()

UMat & cv::UMat::setTo ( InputArray value ,
InputArray mask = noArray ()
)

sets some of the matrix elements to s, according to the mask

step1()

size_t cv::UMat::step1 ( int i = 0 ) const

returns step/elemSize1()

t()

UMat cv::UMat::t ( ) const

matrix transposition by means of matrix expressions

total()

size_t cv::UMat::total ( ) const

returns the total number of matrix elements

type()

int cv::UMat::type ( ) const

returns element type, similar to CV_MAT_TYPE(cvmat->type)

范例:
samples/tapi/squares.cpp .

updateContinuityFlag()

void cv::UMat::updateContinuityFlag ( )

internal use method: updates the continuity flag

zeros() [1/3]

static UMat cv::UMat::zeros ( int rows ,
int cols ,
int type
)
static

Matlab-style matrix initialization.

zeros() [2/3]

static UMat cv::UMat::zeros ( Size size ,
int type
)
static

zeros() [3/3]

static UMat cv::UMat::zeros ( int ndims ,
const int * sz ,
int type
)
static

Member Data Documentation

allocator

MatAllocator * cv::UMat::allocator

custom allocator

cols

int cv::UMat::cols

dims

int cv::UMat::dims

the matrix dimensionality, >= 2

flags

int cv::UMat::flags

includes several bit-fields:

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

offset

size_t cv::UMat::offset

rows

int cv::UMat::rows

the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions

范例:
samples/tapi/hog.cpp ,和 samples/tapi/squares.cpp .

size

step

MatStep cv::UMat::step

u

UMatData * cv::UMat::u

usageFlags

UMatUsageFlags cv::UMat::usageFlags

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