Class cv::UMat#
#include <opencv2/core/mat.hpp>Collaboration diagram for cv::UMat:
Public Types#
enum cv::UMat {
cv::MAGIC_VAL = 0x42FF0000,
cv::AUTO_STEP = 0,
cv::CONTINUOUS_FLAG = CV_MAT_CONT_FLAG,
cv::SUBMATRIX_FLAG = CV_SUBMAT_FLAG
}
enum cv::UMat {
cv::MAGIC_MASK = 0xFFFF0000,
cv::TYPE_MASK = 0x00000FFF,
cv::DEPTH_MASK = 7
}Detailed Description#
- Todo:
document
- Examples
- samples/hog_tapi.cpp, and samples/cpp/stitching_detailed.cpp.
Member Enumeration Documentation#
enum UMat
|
|
|
|
enum UMat
|
|
|
Constructor & Destructor Documentation#
UMat()#
cv::UMat::UMat(
const MatShape & shape,
int type,
const Scalar & s,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
Python:
UMat()#
cv::UMat::UMat(
const MatShape & shape,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
Python:
UMat()#
cv::UMat::UMat(const UMat & m)
Python:
copy constructor
UMat()#
cv::UMat::UMat(
const UMat & m,
const Range & rowRange,
const Range & colRange = Range::all() )
Python:
creates a matrix header for a part of the bigger matrix
UMat()#
cv::UMat::UMat(
const UMat & m,
const Range * ranges )
Python:
UMat()#
cv::UMat::UMat(
const UMat & m,
const Rect & roi )
Python:
UMat()#
cv::UMat::UMat(
const UMat & m,
const std::vector< Range > & ranges )
Python:
UMat()#
cv::UMat::UMat(
int ndims,
const int * sizes,
int type,
const Scalar & s,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
Python:
UMat()#
cv::UMat::UMat(
int ndims,
const int * sizes,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
Python:
constructs n-dimensional matrix
UMat()#
cv::UMat::UMat(
int rows,
int cols,
int type,
const Scalar & s,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
Python:
constructs 2D matrix and fills it with the specified value _s.
UMat()#
cv::UMat::UMat(
int rows,
int cols,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
Python:
constructs 2D matrix of the specified size and type
UMat()#
cv::UMat::UMat(
Size size,
int type,
const Scalar & s,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
Python:
UMat()#
cv::UMat::UMat(
Size size,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
Python:
UMat()#
Python:
UMat()#
cv::UMat::UMat(UMatUsageFlags usageFlags = USAGE_DEFAULT)
Python:
default constructor
~UMat()#
destructor - calls release()
Member Function Documentation#
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()#
channels()#
int cv::UMat::channels()
returns element type, similar to CV_MAT_CN(cvmat->type)
checkVector()#
int cv::UMat::checkVector(
int elemChannels,
int depth = -1,
bool requireContinuous = true )
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()#
CV_NODISCARD_STD UMat cv::UMat::clone()
returns deep copy of the matrix, i.e. the data is copied
col()#
returns a new matrix header for the specified column
colRange()#
colRange()#
UMat cv::UMat::colRange(
int startcol,
int endcol )
… for the specified column span
convertTo()#
void cv::UMat::convertTo(
OutputArray m,
int rtype,
double alpha = 1,
double beta = 0 )
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()#
void cv::UMat::copyTo(OutputArray m)
copies the matrix content to “m”.
copyTo()#
void cv::UMat::copyTo(
OutputArray m,
InputArray mask )
copies those matrix elements to “m” that are marked with non-zero mask elements.
create()#
void cv::UMat::create(
const MatShape & shape,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
create()#
void cv::UMat::create(
const std::vector< int > & sizes,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
create()#
void cv::UMat::create(
int ndims,
const int * sizes,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
create()#
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()#
void cv::UMat::create(
Size size,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
createSameSize()#
void cv::UMat::createSameSize(
InputArray arr,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
allocates new matrix data unless the matrix already has specified size and type.
deallocate()#
void cv::UMat::deallocate()
deallocates the matrix data
depth()#
int cv::UMat::depth()
returns element type, similar to CV_MAT_DEPTH(cvmat->type)
diag()#
UMat cv::UMat::diag(int d = 0)
… for the specified diagonal (d=0 - the main diagonal, >0 - a diagonal from the upper half, <0 - a diagonal from the lower half)
dot()#
double cv::UMat::dot(InputArray m)
computes dot-product
elemSize()#
size_t cv::UMat::elemSize()
returns element size in bytes,
elemSize1()#
size_t cv::UMat::elemSize1()
returns the size of element channel in bytes.
empty()#
bool cv::UMat::empty()
returns true if matrix data is NULL
fit()#
void cv::UMat::fit(
const MatShape & shape,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
fit()#
void cv::UMat::fit(
const std::vector< int > & sizes,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
fit()#
void cv::UMat::fit(
int ndims,
const int * sizes,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
fit()#
void cv::UMat::fit(
int rows,
int cols,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
fits the new shape into existing data buffer if possible, otherwise reallocates data.
fit()#
void cv::UMat::fit(
Size size,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
fitSameSize()#
void cv::UMat::fitSameSize(
InputArray arr,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
getMat()#
Mat cv::UMat::getMat(AccessFlag flags)
handle()#
void * cv::UMat::handle(AccessFlag accessFlags)
Python:
cv.UMat.handle(accessFlags) -> retval
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 method = DECOMP_LU)
matrix inversion by means of matrix expressions
isContinuous()#
bool cv::UMat::isContinuous()
Python:
cv.UMat.isContinuous() -> retval
returns true iff the matrix data is continuous
isSubmatrix()#
bool cv::UMat::isSubmatrix()
Python:
cv.UMat.isSubmatrix() -> retval
returns true if the matrix is a submatrix of another matrix
locateROI()#
void cv::UMat::locateROI(
Size & wholeSize,
Point & ofs )
locates matrix header within a parent matrix. See below
mul()#
UMat cv::UMat::mul(
InputArray m,
double scale = 1 )
per-element matrix multiplication by means of matrix expressions
ndoffset()#
void cv::UMat::ndoffset(size_t * ofs)
operator()()#
operator()()#
operator()()#
UMat cv::UMat::operator()(const std::vector< Range > & ranges)
operator()()#
UMat cv::UMat::operator()(
Range rowRange,
Range colRange )
extracts a rectangular sub-matrix
operator=()#
UMat & cv::UMat::operator=(const Scalar & s)
sets every matrix element to s
operator=()#
UMat & cv::UMat::operator=(const UMat & m)
assignment operators
operator=()#
release()#
void cv::UMat::release()
decreases reference counter;
reshape()#
reshape()#
UMat cv::UMat::reshape(
int cn,
int newndims,
const int * newsz )
reshape()#
UMat cv::UMat::reshape(
int cn,
int rows = 0 )
creates alternative matrix header for the same data, with different
row()#
returns a new matrix header for the specified row
rowRange()#
rowRange()#
UMat cv::UMat::rowRange(
int startrow,
int endrow )
… for the specified row span
setTo()#
UMat & cv::UMat::setTo(
InputArray value,
InputArray mask = noArray() )
sets some of the matrix elements to s, according to the mask
Here is the call graph for this function:
shape()#
Returns the shape.
step1()#
size_t cv::UMat::step1(int i = 0)
returns step/elemSize1()
t()#
matrix transposition by means of matrix expressions
total()#
size_t cv::UMat::total()
returns the total number of matrix elements
type()#
returns element type, similar to CV_MAT_TYPE(cvmat->type)
updateContinuityFlag()#
void cv::UMat::updateContinuityFlag()
internal use method: updates the continuity flag
diag()#
static CV_NODISCARD_STD UMat cv::UMat::diag(
const UMat & d,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
constructs a square diagonal matrix which main diagonal is vector “d”
eye()#
static CV_NODISCARD_STD UMat cv::UMat::eye(
int rows,
int cols,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
eye()#
static CV_NODISCARD_STD UMat cv::UMat::eye(
Size size,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
getStdAllocator()#
static MatAllocator * cv::UMat::getStdAllocator()
and the standard allocator
ones()#
static CV_NODISCARD_STD UMat cv::UMat::ones(
const MatShape & shape,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
ones()#
static CV_NODISCARD_STD UMat cv::UMat::ones(
int ndims,
const int * sz,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
ones()#
static CV_NODISCARD_STD UMat cv::UMat::ones(
int rows,
int cols,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
ones()#
static CV_NODISCARD_STD UMat cv::UMat::ones(
Size size,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
zeros()#
static CV_NODISCARD_STD UMat cv::UMat::zeros(
const MatShape & shape,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
zeros()#
static CV_NODISCARD_STD UMat cv::UMat::zeros(
int ndims,
const int * sz,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
zeros()#
static CV_NODISCARD_STD UMat cv::UMat::zeros(
int rows,
int cols,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
Matlab-style matrix initialization.
zeros()#
static CV_NODISCARD_STD UMat cv::UMat::zeros(
Size size,
int type,
UMatUsageFlags usageFlags = USAGE_DEFAULT )
Member Data Documentation#
allocator#
MatAllocator * cv::UMat::allocator
custom allocator
cols#
int cv::UMat::cols
number of columns in the matrix; -1 when the matrix has more than 2 dimensions
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
offset of the submatrix (or 0)
rows#
int cv::UMat::rows
number of rows in the matrix; -1 when the matrix has more than 2 dimensions
size#
MatSize cv::UMat::size
dimensional size of the matrix; accessible in various formats
step#
MatStep cv::UMat::step
number of bytes each matrix element/row/plane/dimension occupies
u#
UMatData * cv::UMat::u
black-box container of UMat data
usageFlags#
UMatUsageFlags cv::UMat::usageFlags
usage flags for allocator; recommend do not set directly, instead set during construct/create/getUMat
Source file#
The documentation for this class was generated from the following file:
opencv2/core/mat.hpp