UMat class
Constructors
-
UMat.create({int rows = 0, int cols = 0, int r = 0, int g = 0, int b = 0, MatType? type, UMatUsageFlags flags = UMatUsageFlags.USAGE_DEFAULT})
-
constructs 2D matrix and fills it with the specified value.
factory
-
UMat.diag(UMat umat, {UMatUsageFlags flags = UMatUsageFlags.USAGE_DEFAULT})
-
factory
-
UMat.empty({UMatUsageFlags flags = UMatUsageFlags.USAGE_DEFAULT})
-
create an empty UMat
factory
-
UMat.eye({int rows = 0, int cols = 0, MatType type = MatType.CV_8UC1, UMatUsageFlags flags = UMatUsageFlags.USAGE_DEFAULT})
-
factory
-
UMat.fromPointer(UMatPtr mat, {bool attach = true, int? externalSize})
-
construct from pointer directly
factory
-
UMat.fromRange(UMat umat, {int rowStart = 0, int? rowEnd, int colStart = 0, int? colEnd})
-
creates a matrix header for a part of the bigger matrix
factory
-
UMat.fromRect(UMat umat, Rect roi)
-
UMat(const UMat& m, const Rect& roi);
factory
-
UMat.fromUMat(UMat umat)
-
copy constructor
factory
-
UMat.nd(List<int> sizes, MatType type, {Scalar? s, UMatUsageFlags flags = UMatUsageFlags.USAGE_DEFAULT})
-
constructs n-dimensional matrix
factory
-
UMat.ones(int rows, int cols, MatType type, {UMatUsageFlags flags = UMatUsageFlags.USAGE_DEFAULT})
-
factory
-
UMat.onesND(List<int> sizes, MatType type, {UMatUsageFlags flags = UMatUsageFlags.USAGE_DEFAULT})
-
factory
-
UMat.zeros({int rows = 0, int cols = 0, MatType type = MatType.CV_8UC1, UMatUsageFlags flags = UMatUsageFlags.USAGE_DEFAULT})
-
factory
-
UMat.zerosND(List<int> sizes, MatType type, {UMatUsageFlags flags = UMatUsageFlags.USAGE_DEFAULT})
-
factory
Properties
-
channels
→ int
-
returns element type, similar to CV_MAT_CN(cvmat->type)
no setter
-
cols
→ int
-
number of columns in the matrix; -1 when the matrix has more than 2 dimensions
no setter
-
depth
→ int
-
returns element type, similar to CV_MAT_DEPTH(cvmat->type)
no setter
-
dims
→ int
-
the matrix dimensionality, >= 2
no setter
-
elemSize
→ int
-
returns element size in bytes,
no setter
-
elemSize1
→ int
-
returns the size of element channel in bytes.
no setter
-
empty
→ bool
-
returns true if matrix data is NULL
no setter
-
flags
→ int
-
includes several bit-fields:
no setter
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
isContinuous
→ bool
-
returns true iff the matrix data is continuous
no setter
-
isEmpty
→ bool
-
returns true if matrix data is NULL
no setter
-
isSubmatrix
→ bool
-
returns true if the matrix is a submatrix of another matrix
no setter
-
offset
→ int
-
offset of the submatrix (or 0)
no setter
-
props
→ List<Object?>
-
no setterinherited
-
ptr
↔ Pointer<UMat>
-
getter/setter pairinherited
-
ref
→ UMat
-
no setteroverride
-
rows
→ int
-
number of rows in the matrix; -1 when the matrix has more than 2 dimensions
no setter
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
size
→ VecI32
-
dimensional size of the matrix; accessible in various formats
no setter
-
step
→ (int, int, int)
-
number of bytes each matrix element/row/plane/dimension occupies
no setter
-
total
→ int
-
returns the total number of matrix elements
no setter
-
type
→ MatType
-
returns element type, similar to CV_MAT_TYPE(cvmat->type)
no setter
-
usageFlags
→ int
-
usage flags for allocator; recommend do not set directly, instead set during construct/create/getUMat
no setter
Methods
-
addref()
→ void
-
increases the reference counter; use with care to avoid memleaks
-
checkVector(int elemChannels, {int depth = -1, bool requireContinuous = true})
→ int
-
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
-
returns deep copy of the matrix, i.e. the data is copied
-
col(int i)
→ UMat
-
returns a new matrix header for the specified column
-
colRange(int start, int end)
→ UMat
-
... for the specified column span
-
convertTo(MatType type, {UMat? dst, double alpha = 1, double beta = 0})
→ UMat
-
converts matrix to another datatype with optional scaling.
-
copyTo(UMat dst, {UMat? mask})
→ void
-
copies those matrix elements to "m" that are marked with non-zero mask elements.
-
create(List<int> sizes, MatType type, {UMatUsageFlags flags = UMatUsageFlags.USAGE_DEFAULT})
→ void
-
allocates new matrix data unless the matrix already has specified size and type.
-
deallocate()
→ void
-
deallocates the matrix data
-
diag({int d = 0})
→ UMat
-
... for the specified diagonal
(d=0 - the main diagonal,
-
dispose()
→ void
-
-
dot(UMat m)
→ double
-
computes dot-product
-
getMat(AccessFlag accessFlags)
→ Mat
-
https://docs.opencv.org/4.x/d7/d45/classcv_1_1UMat.html#a3d84c72c06ddd55d35b87c3d222d2674
-
handle(AccessFlag flag)
→ Pointer<Void>
-
-
inv({int method = DECOMP_LU})
→ UMat
-
matrix inversion by means of matrix expressions
-
mul(UMat m, {double alpha = 1})
→ UMat
-
per-element matrix multiplication by means of matrix expressions
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
release()
→ void
-
decreases reference counter;
-
reshape(int cn, {int? rows, List<int>? newSizes})
→ UMat
-
creates alternative matrix header for the same data, with different
number of channels and/or different number of rows. see cvReshape.
-
row(int i)
→ UMat
-
returns a new matrix header for the specified row
-
rowRange(int start, int end)
→ UMat
-
.. for the specified row span
-
setTo(Scalar value, {UMat? mask})
→ void
-
sets some of the matrix elements to s, according to the mask
-
step1([int i = 0])
→ int
-
returns step/elemSize1()
-
t()
→ UMat
-
matrix transposition by means of matrix expressions
-
toString()
→ String
-
A string representation of this object.
override