Table of Contents

Class UMat

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

OpenCV C++ n-dimensional dense array class (cv::Mat)

public class UMat : CvObject, IDisposable
Inheritance
UMat
Implements
Inherited Members

Remarks

wasm has no OpenCL backend, so GetUMat(AccessFlag, UMatUsageFlags) falls back to plain CPU execution there with no GPU acceleration benefit; UMat still works, but there is no reason to prefer it over Mat.

Constructors

UMat(Size, MatType, Scalar, UMatUsageFlags)

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

UMat(Size, MatType, UMatUsageFlags)

constructs 2D matrix of the specified size and type

UMat(UMat)
UMat(UMat, Range, Range, UMatUsageFlags)

creates a matrix header for a part of the bigger matrix

UMat(UMat, Range[])

creates a matrix header for a part of the bigger matrix

UMat(UMat, Rect)

creates a matrix header for a part of the bigger matrix

UMat(UMatUsageFlags)

Creates empty Mat

UMat(IEnumerable<int>, MatType)

constructs n-dimensional matrix

UMat(IEnumerable<int>, MatType, Scalar)

constructs n-dimensional matrix

UMat(int, int, MatType, Scalar, UMatUsageFlags)

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

UMat(int, int, MatType, UMatUsageFlags)

constructs 2D matrix of the specified size and type

Fields

TypeMap

typeof(T) -> MatType

Properties

Cols

the number of columns or -1 when the array has more than 2 dimensions

Dims

the array dimensionality, >= 2

Flags

includes several bit-fields:

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

the number of rows or -1 when the array has more than 2 dimensions

this[Range, Range]

Extracts a rectangular submatrix.

this[Range[]]

Extracts a rectangular submatrix.

this[Rect]

Extracts a rectangular submatrix.

this[int, int, int, int]

Extracts a rectangular submatrix.

this[Range, Range]

Extracts a rectangular submatrix.

Rows

the number of rows or -1 when the array has more than 2 dimensions

Width

the number of columns or -1 when the array has more than 2 dimensions

Methods

AdjustROI(int, int, int, int)

Adjusts a submatrix size and position within the parent matrix.

Alignment(int, UMatUsageFlags)
AssignTo(UMat, MatType?)

Provides a functional form of convertTo.

Channels()

Returns the number of matrix channels.

CheckVector(int, int, bool)
Clone()

Creates a full copy of the matrix.

Clone(Rect)

Returns the partial Mat of the specified Mat

Col(int)

Creates a matrix header for the specified matrix column.

ColRange(Range)

Creates a matrix header for the specified column span.

ColRange(int, int)

Creates a matrix header for the specified column span.

ColRange(Range)

Creates a matrix header for the specified column span.

ConvertTo(OutputArray, MatType, double, double)

Converts an array to another data type with optional scaling.

CopyTo(OutputArray, InputArray)

Copies the matrix to another one.

CopyTo(UMat, InputArray)

Copies the matrix to another one.

Create(MatType, params int[])

Allocates new array data if needed.

Create(Size, MatType)

Allocates new array data if needed.

Create(int, int, MatType)

Allocates new array data if needed.

Depth()

Returns the depth of a matrix element.

Diag(MatDiagType)

Single-column matrix that forms a diagonal matrix or index of the diagonal, with the following values:

Diag(UMat)

Extracts a diagonal from a matrix, or creates a diagonal matrix.

Dot(InputArray)

Computes a dot-product of two vectors.

ElemSize()

Returns the matrix element size in bytes.

ElemSize1()

Returns the size of each matrix element channel in bytes.

Empty()

Returns true if the array has no elements.

EmptyClone(UMatUsageFlags)

Makes a Mat that have the same size, depth and channels as this image

Eye(Size, MatType)

Returns an identity matrix of the specified size and type.

Eye(int, int, MatType)

Returns an identity matrix of the specified size and type.

FromNativePointer(nint)

Creates from native cv::UMat* pointer

GetMat(AccessFlag)

Returns the UMat data as a Mat.

Inv(DecompTypes)

Inverses a matrix.

IsContinuous()

Reports whether the matrix is continuous or not.

IsSubmatrix()

Returns whether this matrix is a part of other matrix or not.

LocateROI(out Size, out Point)

Locates the matrix header within a parent matrix.

Mul(InputArray, double)

Performs an element-wise multiplication or division of the two matrices.

Ones(MatType, params int[])

Returns an array of all 1’s of the specified size and type.

Ones(Size, MatType)

Returns an array of all 1’s of the specified size and type.

Ones(int, int, MatType)

Returns an array of all 1’s of the specified size and type.

Release()

Releases the resources

Reshape(int, int)

Changes the shape and/or the number of channels of a 2D matrix without copying the data.

Reshape(int, int[])

Changes the shape and/or the number of channels of a 2D matrix without copying the data.

Row(int)

Creates a matrix header for the specified matrix row.

RowRange(Range)

Creates a matrix header for the specified row span.

RowRange(int, int)

Creates a matrix header for the specified row span.

RowRange(Range)

Creates a matrix header for the specified row span.

SetTo(InputArray, UMat?)

Sets all or some of the array elements to the specified value.

SetTo(Scalar, UMat?)

Sets all or some of the array elements to the specified value.

Size()

Returns a matrix size.

Size(int)

Returns a matrix size.

Step()

Returns number of bytes each matrix row occupies.

Step(int)

Returns number of bytes each matrix row occupies.

Step1(int)

Returns a normalized step.

SubMat(Range, Range)

Extracts a rectangular submatrix.

SubMat(Range[])

Extracts a rectangular submatrix.

SubMat(Rect)

Extracts a rectangular submatrix.

SubMat(int, int, int, int)

Extracts a rectangular submatrix.

SubMat(Range, Range)

Extracts a rectangular submatrix.

T()

Transposes a matrix.

ToString()

Returns a string that represents this Mat.

Total()

Returns the total number of array elements.

Type()

Returns the type of a matrix element.

Zeros(MatType, params int[])

Returns a zero array of the specified size and type.

Zeros(Size, MatType)

Returns a zero array of the specified size and type.

Zeros(int, int, MatType)

Returns a zero array of the specified size and type.