UMat
import { UMat } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods.
UMat: todo: document
Constructors and members
static new
creates a matrix header for a part of the bigger matrix
new(size: number, _1: number, usageFlags: number): UMat;sizesize argument (number).
_11 argument (number).
usageFlagsusage flags argument (number).
The UMat result.
rows
Number of rows in this CPU-backed unified matrix.
rows: number;cols
Number of columns in this CPU-backed unified matrix.
cols: number;offset
Byte offset of this matrix view within its backing allocation.
offset: number;getMat
Map the CPU-backed unified matrix to an owned Mat header using the requested ACCESS_READ, ACCESS_WRITE or ACCESS_RW mode. Pixel storage is shared.
getMat(access: number): Mat;accessaccess argument (number).
The Mat result. Release returned native handles with using or delete(), including handles nested in results.
get
Return an owned Mat header for CPU read access to this unified matrix. Pixel storage is shared; dispose the returned header.
get(): Mat;The Mat result. Release returned native handles with using or delete(), including handles nested in results.
isContinuous
returns true iff the matrix data is continuous (i.e. when there are no gaps between successive rows). similar to CV_IS_MAT_CONT(cvmat->type)
isContinuous(): boolean;The boolean result.
isSubmatrix
returns true if the matrix is a submatrix of another matrix
isSubmatrix(): boolean;The boolean result.
channels
returns element type, similar to CV_MAT_CN(cvmat->type)
channels(): number;The number result.
depth
returns element type, similar to CV_MAT_DEPTH(cvmat->type)
depth(): number;The number result.
total
returns the total number of matrix elements
total(): number;The number result.
clone
returns deep copy of the matrix, i.e. the data is copied
clone(): UMat;The UMat result.
empty
returns true if matrix data is NULL
empty(): boolean;The boolean result.
type
returns element type, similar to CV_MAT_TYPE(cvmat->type)
type(): number;The number result.
copyTo
copies the matrix content to "m". It calls m.create(this->size(), this->type()).
copyTo(m: Mat): void;mm argument (Mat).
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.