Table of Contents

Constructor UMat

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

UMat(UMatUsageFlags)

Creates empty Mat

public UMat(UMatUsageFlags usageFlags = UMatUsageFlags.None)

Parameters

usageFlags UMatUsageFlags

UMat(UMat)

protected UMat(UMat m)

Parameters

m UMat

UMat(int, int, MatType, UMatUsageFlags)

constructs 2D matrix of the specified size and type

public UMat(int rows, int cols, MatType type, UMatUsageFlags usageFlags = UMatUsageFlags.None)

Parameters

rows int

Number of rows in a 2D array.

cols int

Number of columns in a 2D array.

type MatType

Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices.

usageFlags UMatUsageFlags

usage flags for allocator

UMat(Size, MatType, UMatUsageFlags)

constructs 2D matrix of the specified size and type

public UMat(Size size, MatType type, UMatUsageFlags usageFlags = UMatUsageFlags.None)

Parameters

size Size

2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the number of columns go in the reverse order.

type MatType

Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or MatType.CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices.

usageFlags UMatUsageFlags

usage flags for allocator

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

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

public UMat(int rows, int cols, MatType type, Scalar s, UMatUsageFlags usageFlags = UMatUsageFlags.None)

Parameters

rows int

Number of rows in a 2D array.

cols int

Number of columns in a 2D array.

type MatType

Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices.

s Scalar

An optional value to initialize each matrix element with. To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method .

usageFlags UMatUsageFlags

usage flags for allocator

UMat(Size, MatType, Scalar, UMatUsageFlags)

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

public UMat(Size size, MatType type, Scalar s, UMatUsageFlags usageFlags = UMatUsageFlags.None)

Parameters

size Size

2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the number of columns go in the reverse order.

type MatType

Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.

s Scalar

An optional value to initialize each matrix element with. To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method .

usageFlags UMatUsageFlags

usage flags for allocator

UMat(UMat, Range, Range, UMatUsageFlags)

creates a matrix header for a part of the bigger matrix

public UMat(UMat m, Range rowRange, Range colRange, UMatUsageFlags usageFlags = UMatUsageFlags.None)

Parameters

m UMat

Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .

rowRange Range

Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. Use Range.All to take all the rows.

colRange Range

Range of the m columns to take. Use Range.All to take all the columns.

usageFlags UMatUsageFlags

usage flags for allocator

UMat(UMat, Range[])

creates a matrix header for a part of the bigger matrix

public UMat(UMat m, Range[] ranges)

Parameters

m UMat

Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat.Clone() .

ranges Range[]

Array of selected ranges of m along each dimensionality.

UMat(UMat, Rect)

creates a matrix header for a part of the bigger matrix

public UMat(UMat m, Rect roi)

Parameters

m UMat

Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat.Clone() .

roi Rect

Region of interest.

UMat(IEnumerable<int>, MatType)

constructs n-dimensional matrix

public UMat(IEnumerable<int> sizes, MatType type)

Parameters

sizes IEnumerable<int>

Array of integers specifying an n-dimensional array shape.

type MatType

Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices.

UMat(IEnumerable<int>, MatType, Scalar)

constructs n-dimensional matrix

public UMat(IEnumerable<int> sizes, MatType type, Scalar s)

Parameters

sizes IEnumerable<int>

Array of integers specifying an n-dimensional array shape.

type MatType

Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices.

s Scalar

An optional value to initialize each matrix element with. To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method .