OpenCV453
公開型 | 公開メンバ関数 | 静的公開メンバ関数 | 公開変数類 | 全メンバ一覧

#include <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 }
 

公開メンバ関数

 UMat (UMatUsageFlags usageFlags=USAGE_DEFAULT) CV_NOEXCEPT
 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
 
 ~UMat ()
 destructor - calls release()
 
UMatoperator= (const UMat &m)
 assignment operators
 
Mat getMat (AccessFlag flags) const
 
UMat row (int y) const
 returns a new matrix header for the specified row
 
UMat col (int x) const
 returns a new matrix header for the specified column
 
UMat rowRange (int startrow, int endrow) const
 ... for the specified row span
 
UMat rowRange (const Range &r) const
 
UMat colRange (int startcol, int endcol) const
 ... for the specified column span
 
UMat colRange (const Range &r) const
 
UMat diag (int d=0) const
 
UMat clone () const CV_NODISCARD
 returns deep copy of the matrix, i.e. the data is copied
 
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 convertTo (OutputArray m, int rtype, double alpha=1, double beta=0) const
 converts matrix to another datatype with optional scaling. See cvConvertScale.
 
void assignTo (UMat &m, int type=-1) const
 
UMatoperator= (const Scalar &s)
 sets every matrix element to s
 
UMatsetTo (InputArray value, InputArray mask=noArray())
 sets some of the matrix elements to s, according to the mask
 
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 t () const
 matrix transposition by means of matrix expressions
 
UMat inv (int method=DECOMP_LU) const
 matrix inversion by means of matrix expressions
 
UMat mul (InputArray m, double scale=1) const
 per-element matrix multiplication by means of matrix expressions
 
double dot (InputArray m) const
 computes dot-product
 
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 addref ()
 increases the reference counter; use with care to avoid memleaks
 
void release ()
 decreases reference counter;
 
void deallocate ()
 deallocates the matrix data
 
void copySize (const UMat &m)
 internal use function; properly re-allocates _size, _step arrays
 
void locateROI (Size &wholeSize, Point &ofs) const
 locates matrix header within a parent matrix. See below
 
UMatadjustROI (int dtop, int dbottom, int dleft, int dright)
 moves/resizes the current matrix ROI inside the parent matrix.
 
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
 
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
 
size_t elemSize () const
 returns element size in bytes,
 
size_t elemSize1 () const
 returns the size of element channel in bytes.
 
int type () const
 returns element type, similar to CV_MAT_TYPE(cvmat->type)
 
int depth () const
 returns element type, similar to CV_MAT_DEPTH(cvmat->type)
 
int channels () const
 returns element type, similar to CV_MAT_CN(cvmat->type)
 
size_t step1 (int i=0) const
 returns step/elemSize1()
 
bool empty () const
 returns true if matrix data is NULL
 
size_t total () const
 returns the total number of matrix elements
 
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 (UMat &&m)
 
UMatoperator= (UMat &&m)
 
void * handle (AccessFlag accessFlags) const
 
void ndoffset (size_t *ofs) const
 
void updateContinuityFlag ()
 internal use method: updates the continuity flag
 

静的公開メンバ関数

static UMat diag (const UMat &d, UMatUsageFlags usageFlags)
 constructs a square diagonal matrix which main diagonal is vector "d"
 
static UMat diag (const UMat &d)
 
static UMat zeros (int rows, int cols, int type, UMatUsageFlags usageFlags)
 Matlab-style matrix initialization
 
static UMat zeros (Size size, int type, UMatUsageFlags usageFlags)
 
static UMat zeros (int ndims, const int *sz, int type, UMatUsageFlags usageFlags)
 
static UMat zeros (int rows, int cols, int type)
 
static UMat zeros (Size size, int type)
 
static UMat zeros (int ndims, const int *sz, int type)
 
static UMat ones (int rows, int cols, int type, UMatUsageFlags usageFlags)
 
static UMat ones (Size size, int type, UMatUsageFlags usageFlags)
 
static UMat ones (int ndims, const int *sz, int type, UMatUsageFlags usageFlags)
 
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 eye (int rows, int cols, int type, UMatUsageFlags usageFlags)
 
static UMat eye (Size size, int type, UMatUsageFlags usageFlags)
 
static UMat eye (int rows, int cols, int type)
 
static UMat eye (Size size, int type)
 
static MatAllocatorgetStdAllocator ()
 and the standard allocator
 

公開変数類

int flags
 
int dims
 the matrix dimensionality, >= 2
 
int rows
 number of rows in the matrix; -1 when the matrix has more than 2 dimensions
 
int cols
 number of columns in the matrix; -1 when the matrix has more than 2 dimensions
 
MatAllocatorallocator
 custom allocator
 
UMatUsageFlags usageFlags
 usage flags for allocator; recommend do not set directly, instead set during construct/create/getUMat
 
UMatDatau
 black-box container of UMat data
 
size_t offset
 offset of the submatrix (or 0)
 
MatSize size
 dimensional size of the matrix; accessible in various formats
 
MatStep step
 number of bytes each matrix element/row/plane/dimension occupies
 

詳解

todo:
document

関数詳解

◆ diag()

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)

◆ handle()

void * cv::UMat::handle ( AccessFlag  accessFlags) const

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.

メンバ詳解

◆ flags

int cv::UMat::flags

includes several bit-fields:

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

このクラス詳解は次のファイルから抽出されました: