Show / Hide Table of Contents

Class UMat

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

Inheritance
System.Object
DisposableObject
DisposableCvObject
UMat
Implements
ICvPtrHolder
Inherited Members
DisposableCvObject.ptr
DisposableCvObject.CvPtr
DisposableObject.DataHandle
DisposableObject.IsDisposed
DisposableObject.IsEnabledDispose
DisposableObject.AllocatedMemory
DisposableObject.AllocatedMemorySize
DisposableObject.Dispose()
DisposableObject.Dispose(Boolean)
DisposableObject.DisposeManaged()
DisposableObject.AllocGCHandle(Object)
DisposableObject.AllocMemory(Int32)
DisposableObject.NotifyMemoryPressure(Int64)
DisposableObject.ThrowIfDisposed()
Namespace: OpenCvSharp
Assembly: OpenCvSharp.dll
Syntax
public class UMat : DisposableCvObject, ICvPtrHolder

Constructors

| Improve this Doc View Source

UMat(IEnumerable<Int32>, MatType)

constructs n-dimensional matrix

Declaration
public UMat(IEnumerable<int> sizes, MatType type)
Parameters
Type Name Description
IEnumerable<System.Int32> sizes

Array of integers specifying an n-dimensional array shape.

OpenCvSharp.MatType type

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.

| Improve this Doc View Source

UMat(IEnumerable<Int32>, MatType, Scalar)

constructs n-dimensional matrix

Declaration
public UMat(IEnumerable<int> sizes, MatType type, Scalar s)
Parameters
Type Name Description
IEnumerable<System.Int32> sizes

Array of integers specifying an n-dimensional array shape.

OpenCvSharp.MatType type

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.

OpenCvSharp.Scalar s

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 .

| Improve this Doc View Source

UMat(Size, MatType, Scalar, UMatUsageFlags)

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

Declaration
public UMat(Size size, MatType type, Scalar s, UMatUsageFlags usageFlags = UMatUsageFlags.None)
Parameters
Type Name Description
OpenCvSharp.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.

OpenCvSharp.MatType type

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.

OpenCvSharp.Scalar s

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 .

UMatUsageFlags usageFlags

usage flags for allocator

| Improve this Doc View Source

UMat(Size, MatType, UMatUsageFlags)

constructs 2D matrix of the specified size and type

Declaration
public UMat(Size size, MatType type, UMatUsageFlags usageFlags = UMatUsageFlags.None)
Parameters
Type Name Description
OpenCvSharp.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.

OpenCvSharp.MatType type

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.

UMatUsageFlags usageFlags

usage flags for allocator

| Improve this Doc View Source

UMat(UMat)

Declaration
protected UMat(UMat m)
Parameters
Type Name Description
UMat m
| Improve this Doc View Source

UMat(UMat, Range, Range, UMatUsageFlags)

creates a matrix header for a part of the bigger matrix

Declaration
public UMat(UMat m, Range rowRange, Range colRange, UMatUsageFlags usageFlags = UMatUsageFlags.None)
Parameters
Type Name Description
UMat m

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() .

OpenCvSharp.Range rowRange

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.

OpenCvSharp.Range colRange

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

UMatUsageFlags usageFlags

usage flags for allocator

| Improve this Doc View Source

UMat(UMat, Range[])

creates a matrix header for a part of the bigger matrix

Declaration
public UMat(UMat m, params Range[] ranges)
Parameters
Type Name Description
UMat m

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() .

OpenCvSharp.Range[] ranges

Array of selected ranges of m along each dimensionality.

| Improve this Doc View Source

UMat(UMat, Rect)

creates a matrix header for a part of the bigger matrix

Declaration
public UMat(UMat m, Rect roi)
Parameters
Type Name Description
UMat m

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() .

OpenCvSharp.Rect roi

Region of interest.

| Improve this Doc View Source

UMat(UMatUsageFlags)

Creates empty Mat

Declaration
public UMat(UMatUsageFlags usageFlags = UMatUsageFlags.None)
Parameters
Type Name Description
UMatUsageFlags usageFlags
| Improve this Doc View Source

UMat(Int32, Int32, MatType, Scalar, UMatUsageFlags)

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

Declaration
public UMat(int rows, int cols, MatType type, Scalar s, UMatUsageFlags usageFlags = UMatUsageFlags.None)
Parameters
Type Name Description
System.Int32 rows

Number of rows in a 2D array.

System.Int32 cols

Number of columns in a 2D array.

OpenCvSharp.MatType type

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.

OpenCvSharp.Scalar s

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 .

UMatUsageFlags usageFlags

usage flags for allocator

| Improve this Doc View Source

UMat(Int32, Int32, MatType, UMatUsageFlags)

constructs 2D matrix of the specified size and type

Declaration
public UMat(int rows, int cols, MatType type, UMatUsageFlags usageFlags = UMatUsageFlags.None)
Parameters
Type Name Description
System.Int32 rows

Number of rows in a 2D array.

System.Int32 cols

Number of columns in a 2D array.

OpenCvSharp.MatType type

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.

UMatUsageFlags usageFlags

usage flags for allocator

Fields

| Improve this Doc View Source

TypeMap

typeof(T) -> MatType

Declaration
protected static readonly IReadOnlyDictionary<Type, MatType> TypeMap
Field Value
Type Description
IReadOnlyDictionary<Type, OpenCvSharp.MatType>

Properties

| Improve this Doc View Source

Cols

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

Declaration
public int Cols { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Dims

the array dimensionality, >= 2

Declaration
public int Dims { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Flags

includes several bit-fields:

  • the magic signature
  • continuity flag
  • depth
  • number of channels
Declaration
public int Flags { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Height

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

Declaration
public int Height { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Item[Range, Range]

Extracts a rectangular submatrix.

Declaration
public UMat this[Range rowRange, Range colRange] { get; set; }
Parameters
Type Name Description
OpenCvSharp.Range rowRange

Start and end row of the extracted submatrix. The upper boundary is not included. To select all the rows, use Range.All().

OpenCvSharp.Range colRange

Start and end column of the extracted submatrix. The upper boundary is not included. To select all the columns, use Range.All().

Property Value
Type Description
UMat
| Improve this Doc View Source

Item[Range[]]

Extracts a rectangular submatrix.

Declaration
public UMat this[params Range[] ranges] { get; set; }
Parameters
Type Name Description
OpenCvSharp.Range[] ranges

Array of selected ranges along each array dimension.

Property Value
Type Description
UMat
| Improve this Doc View Source

Item[Rect]

Extracts a rectangular submatrix.

Declaration
public UMat this[Rect roi] { get; set; }
Parameters
Type Name Description
OpenCvSharp.Rect roi

Extracted submatrix specified as a rectangle.

Property Value
Type Description
UMat
| Improve this Doc View Source

Item[Int32, Int32, Int32, Int32]

Extracts a rectangular submatrix.

Declaration
public UMat this[int rowStart, int rowEnd, int colStart, int colEnd] { get; set; }
Parameters
Type Name Description
System.Int32 rowStart

Start row of the extracted submatrix. The upper boundary is not included.

System.Int32 rowEnd

End row of the extracted submatrix. The upper boundary is not included.

System.Int32 colStart

Start column of the extracted submatrix. The upper boundary is not included.

System.Int32 colEnd

End column of the extracted submatrix. The upper boundary is not included.

Property Value
Type Description
UMat
| Improve this Doc View Source

Item[Range, Range]

Extracts a rectangular submatrix.

Declaration
public UMat this[Range rowRange, Range colRange] { get; set; }
Parameters
Type Name Description
System.Range rowRange

Start and end row of the extracted submatrix. The upper boundary is not included. To select all the rows, use Range.All().

System.Range colRange

Start and end column of the extracted submatrix. The upper boundary is not included. To select all the columns, use Range.All().

Property Value
Type Description
UMat
| Improve this Doc View Source

Rows

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

Declaration
public int Rows { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Width

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

Declaration
public int Width { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

AdjustROI(Int32, Int32, Int32, Int32)

Adjusts a submatrix size and position within the parent matrix.

Declaration
public UMat AdjustROI(int dtop, int dbottom, int dleft, int dright)
Parameters
Type Name Description
System.Int32 dtop

Shift of the top submatrix boundary upwards.

System.Int32 dbottom

Shift of the bottom submatrix boundary downwards.

System.Int32 dleft

Shift of the left submatrix boundary to the left.

System.Int32 dright

Shift of the right submatrix boundary to the right.

Returns
Type Description
UMat
| Improve this Doc View Source

Alignment(Int32, UMatUsageFlags)

Declaration
public UMat Alignment(int n = 4, UMatUsageFlags usageFlags = UMatUsageFlags.None)
Parameters
Type Name Description
System.Int32 n
UMatUsageFlags usageFlags

usage flags for allocator

Returns
Type Description
UMat
| Improve this Doc View Source

AssignTo(UMat, Nullable<MatType>)

Provides a functional form of convertTo.

Declaration
public void AssignTo(UMat m, MatType? type = null)
Parameters
Type Name Description
UMat m

Destination array.

System.Nullable<OpenCvSharp.MatType> type

Desired destination array depth (or -1 if it should be the same as the source type).

| Improve this Doc View Source

Channels()

Returns the number of matrix channels.

Declaration
public int Channels()
Returns
Type Description
System.Int32
| Improve this Doc View Source

CheckVector(Int32, Int32, Boolean)

Declaration
public int CheckVector(int elemChannels, int depth = -1, bool requireContinuous = true)
Parameters
Type Name Description
System.Int32 elemChannels

Number of channels or number of columns the matrix should have. For a 2-D matrix, when the matrix has only 1 column, then it should have elemChannels channels; When the matrix has only 1 channel, then it should have elemChannels columns. For a 3-D matrix, it should have only one channel. Furthermore, if the number of planes is not one, then the number of rows within every plane has to be 1; if the number of rows within every plane is not 1, then the number of planes has to be 1.

System.Int32 depth

The depth the matrix should have. Set it to -1 when any depth is fine.

System.Boolean requireContinuous

Set it to true to require the matrix to be continuous

Returns
Type Description
System.Int32

-1 if the requirement is not satisfied. Otherwise, it returns the number of elements in the matrix. Note that an element may have multiple channels.

| Improve this Doc View Source

Clone()

Creates a full copy of the matrix.

Declaration
public UMat Clone()
Returns
Type Description
UMat
| Improve this Doc View Source

Clone(Rect)

Returns the partial Mat of the specified Mat

Declaration
public UMat Clone(Rect roi)
Parameters
Type Name Description
OpenCvSharp.Rect roi
Returns
Type Description
UMat
| Improve this Doc View Source

Col(Int32)

Creates a matrix header for the specified matrix column.

Declaration
public UMat Col(int x)
Parameters
Type Name Description
System.Int32 x

A 0-based column index.

Returns
Type Description
UMat
| Improve this Doc View Source

ColRange(Range)

Creates a matrix header for the specified column span.

Declaration
public UMat ColRange(Range range)
Parameters
Type Name Description
OpenCvSharp.Range range
Returns
Type Description
UMat
| Improve this Doc View Source

ColRange(Int32, Int32)

Creates a matrix header for the specified column span.

Declaration
public UMat ColRange(int startCol, int endCol)
Parameters
Type Name Description
System.Int32 startCol

An inclusive 0-based start index of the column span.

System.Int32 endCol

An exclusive 0-based ending index of the column span.

Returns
Type Description
UMat
| Improve this Doc View Source

ColRange(Range)

Creates a matrix header for the specified column span.

Declaration
public UMat ColRange(Range range)
Parameters
Type Name Description
System.Range range
Returns
Type Description
UMat
| Improve this Doc View Source

ConvertTo(OutputArray, MatType, Double, Double)

Converts an array to another data type with optional scaling.

Declaration
public void ConvertTo(OutputArray m, MatType rtype, double alpha = 1, double beta = 0)
Parameters
Type Name Description
OutputArray m

output matrix; if it does not have a proper size or type before the operation, it is reallocated.

OpenCvSharp.MatType rtype

desired output matrix type or, rather, the depth since the number of channels are the same as the input has; if rtype is negative, the output matrix will have the same type as the input.

System.Double alpha

optional scale factor.

System.Double beta

optional delta added to the scaled values.

| Improve this Doc View Source

CopyTo(OutputArray, InputArray)

Copies the matrix to another one.

Declaration
public void CopyTo(OutputArray m, InputArray mask = null)
Parameters
Type Name Description
OutputArray m

Destination matrix. If it does not have a proper size or type before the operation, it is reallocated.

InputArray mask

Operation mask. Its non-zero elements indicate which matrix elements need to be copied.

| Improve this Doc View Source

CopyTo(UMat, InputArray)

Copies the matrix to another one.

Declaration
public void CopyTo(UMat m, InputArray mask = null)
Parameters
Type Name Description
UMat m

Destination matrix. If it does not have a proper size or type before the operation, it is reallocated.

InputArray mask

Operation mask. Its non-zero elements indicate which matrix elements need to be copied.

| Improve this Doc View Source

Create(MatType, Int32[])

Allocates new array data if needed.

Declaration
public void Create(MatType type, params int[] sizes)
Parameters
Type Name Description
OpenCvSharp.MatType type

New matrix type.

System.Int32[] sizes

Array of integers specifying a new array shape.

| Improve this Doc View Source

Create(Size, MatType)

Allocates new array data if needed.

Declaration
public void Create(Size size, MatType type)
Parameters
Type Name Description
OpenCvSharp.Size size

Alternative new matrix size specification: Size(cols, rows)

OpenCvSharp.MatType type

New matrix type.

| Improve this Doc View Source

Create(Int32, Int32, MatType)

Allocates new array data if needed.

Declaration
public void Create(int rows, int cols, MatType type)
Parameters
Type Name Description
System.Int32 rows

New number of rows.

System.Int32 cols

New number of columns.

OpenCvSharp.MatType type

New matrix type.

| Improve this Doc View Source

Depth()

Returns the depth of a matrix element.

Declaration
public int Depth()
Returns
Type Description
System.Int32
| Improve this Doc View Source

Diag(MatDiagType)

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

Declaration
public UMat Diag(MatDiagType d = MatDiagType.Main)
Parameters
Type Name Description
MatDiagType d

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

Returns
Type Description
UMat
| Improve this Doc View Source

Diag(UMat)

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

Declaration
public static UMat Diag(UMat d)
Parameters
Type Name Description
UMat d

One-dimensional matrix that represents the main diagonal.

Returns
Type Description
UMat
| Improve this Doc View Source

DisposeUnmanaged()

Releases unmanaged resources

Declaration
protected override void DisposeUnmanaged()
Overrides
DisposableCvObject.DisposeUnmanaged()
| Improve this Doc View Source

Dot(InputArray)

Computes a dot-product of two vectors.

Declaration
public double Dot(InputArray m)
Parameters
Type Name Description
InputArray m

another dot-product operand.

Returns
Type Description
System.Double
| Improve this Doc View Source

ElemSize()

Returns the matrix element size in bytes.

Declaration
public int ElemSize()
Returns
Type Description
System.Int32
| Improve this Doc View Source

ElemSize1()

Returns the size of each matrix element channel in bytes.

Declaration
public int ElemSize1()
Returns
Type Description
System.Int32
| Improve this Doc View Source

Empty()

Returns true if the array has no elements.

Declaration
public bool Empty()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

EmptyClone(UMatUsageFlags)

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

Declaration
public UMat EmptyClone(UMatUsageFlags usageFlags = UMatUsageFlags.None)
Parameters
Type Name Description
UMatUsageFlags usageFlags
Returns
Type Description
UMat
| Improve this Doc View Source

Eye(Size, MatType)

Returns an identity matrix of the specified size and type.

Declaration
public static UMat Eye(Size size, MatType type)
Parameters
Type Name Description
OpenCvSharp.Size size

Alternative to the matrix size specification Size(cols, rows) .

OpenCvSharp.MatType type

Created matrix type.

Returns
Type Description
UMat
| Improve this Doc View Source

Eye(Int32, Int32, MatType)

Returns an identity matrix of the specified size and type.

Declaration
public static UMat Eye(int rows, int cols, MatType type)
Parameters
Type Name Description
System.Int32 rows

Number of rows.

System.Int32 cols

Number of columns.

OpenCvSharp.MatType type

Created matrix type.

Returns
Type Description
UMat
| Improve this Doc View Source

FromNativePointer(IntPtr)

Creates from native cv::UMat* pointer

Declaration
public static UMat FromNativePointer(IntPtr ptr)
Parameters
Type Name Description
IntPtr ptr
Returns
Type Description
UMat
| Improve this Doc View Source

GetMat(AccessFlag)

Returns the UMat data as a Mat.

Declaration
public Mat GetMat(AccessFlag accessFlags)
Parameters
Type Name Description
AccessFlag accessFlags

AccessFlag determining the mode in which the data is to be acquired

Returns
Type Description
Mat
| Improve this Doc View Source

Inv(DecompTypes)

Inverses a matrix.

Declaration
public UMat Inv(DecompTypes method = DecompTypes.LU)
Parameters
Type Name Description
DecompTypes method

Matrix inversion method

Returns
Type Description
UMat
| Improve this Doc View Source

IsContinuous()

Reports whether the matrix is continuous or not.

Declaration
public bool IsContinuous()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsSubmatrix()

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

Declaration
public bool IsSubmatrix()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

LocateROI(out Size, out Point)

Locates the matrix header within a parent matrix.

Declaration
public void LocateROI(out Size wholeSize, out Point ofs)
Parameters
Type Name Description
OpenCvSharp.Size wholeSize

Output parameter that contains the size of the whole matrix containing *this as a part.

OpenCvSharp.Point ofs

Output parameter that contains an offset of *this inside the whole matrix.

| Improve this Doc View Source

Mul(InputArray, Double)

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

Declaration
public UMat Mul(InputArray m, double scale = 1)
Parameters
Type Name Description
InputArray m
System.Double scale
Returns
Type Description
UMat
| Improve this Doc View Source

Ones(MatType, Int32[])

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

Declaration
public static UMat Ones(MatType type, params int[] sizes)
Parameters
Type Name Description
OpenCvSharp.MatType type

Created matrix type.

System.Int32[] sizes

Array of integers specifying the array shape.

Returns
Type Description
UMat
| Improve this Doc View Source

Ones(Size, MatType)

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

Declaration
public static UMat Ones(Size size, MatType type)
Parameters
Type Name Description
OpenCvSharp.Size size

Alternative to the matrix size specification Size(cols, rows) .

OpenCvSharp.MatType type

Created matrix type.

Returns
Type Description
UMat
| Improve this Doc View Source

Ones(Int32, Int32, MatType)

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

Declaration
public static UMat Ones(int rows, int cols, MatType type)
Parameters
Type Name Description
System.Int32 rows

Number of rows.

System.Int32 cols

Number of columns.

OpenCvSharp.MatType type

Created matrix type.

Returns
Type Description
UMat
| Improve this Doc View Source

Release()

Releases the resources

Declaration
public void Release()
| Improve this Doc View Source

Reshape(Int32, Int32)

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

Declaration
public UMat Reshape(int cn, int rows = 0)
Parameters
Type Name Description
System.Int32 cn

New number of channels. If the parameter is 0, the number of channels remains the same.

System.Int32 rows

New number of rows. If the parameter is 0, the number of rows remains the same.

Returns
Type Description
UMat
| Improve this Doc View Source

Reshape(Int32, Int32[])

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

Declaration
public UMat Reshape(int cn, params int[] newDims)
Parameters
Type Name Description
System.Int32 cn

New number of channels. If the parameter is 0, the number of channels remains the same.

System.Int32[] newDims

New number of rows. If the parameter is 0, the number of rows remains the same.

Returns
Type Description
UMat
| Improve this Doc View Source

Row(Int32)

Creates a matrix header for the specified matrix row.

Declaration
public UMat Row(int y)
Parameters
Type Name Description
System.Int32 y

A 0-based row index.

Returns
Type Description
UMat
| Improve this Doc View Source

RowRange(Range)

Creates a matrix header for the specified row span.

Declaration
public UMat RowRange(Range range)
Parameters
Type Name Description
OpenCvSharp.Range range
Returns
Type Description
UMat
| Improve this Doc View Source

RowRange(Int32, Int32)

Creates a matrix header for the specified row span.

Declaration
public UMat RowRange(int startRow, int endRow)
Parameters
Type Name Description
System.Int32 startRow
System.Int32 endRow
Returns
Type Description
UMat
| Improve this Doc View Source

RowRange(Range)

Creates a matrix header for the specified row span.

Declaration
public UMat RowRange(Range range)
Parameters
Type Name Description
System.Range range
Returns
Type Description
UMat
| Improve this Doc View Source

SetTo(InputArray, UMat)

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

Declaration
public UMat SetTo(InputArray value, UMat mask = null)
Parameters
Type Name Description
InputArray value
UMat mask
Returns
Type Description
UMat
| Improve this Doc View Source

SetTo(Scalar, UMat)

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

Declaration
public UMat SetTo(Scalar value, UMat mask = null)
Parameters
Type Name Description
OpenCvSharp.Scalar value
UMat mask
Returns
Type Description
UMat
| Improve this Doc View Source

Size()

Returns a matrix size.

Declaration
public Size Size()
Returns
Type Description
OpenCvSharp.Size
| Improve this Doc View Source

Size(Int32)

Returns a matrix size.

Declaration
public int Size(int dim)
Parameters
Type Name Description
System.Int32 dim
Returns
Type Description
System.Int32
| Improve this Doc View Source

Step()

Returns number of bytes each matrix row occupies.

Declaration
public long Step()
Returns
Type Description
System.Int64
| Improve this Doc View Source

Step(Int32)

Returns number of bytes each matrix row occupies.

Declaration
public long Step(int i)
Parameters
Type Name Description
System.Int32 i
Returns
Type Description
System.Int64
| Improve this Doc View Source

Step1(Int32)

Returns a normalized step.

Declaration
public long Step1(int i = 0)
Parameters
Type Name Description
System.Int32 i
Returns
Type Description
System.Int64
| Improve this Doc View Source

SubMat(Range, Range)

Extracts a rectangular submatrix.

Declaration
public UMat SubMat(Range rowRange, Range colRange)
Parameters
Type Name Description
OpenCvSharp.Range rowRange

Start and end row of the extracted submatrix. The upper boundary is not included. To select all the rows, use Range::all().

OpenCvSharp.Range colRange

Start and end column of the extracted submatrix. The upper boundary is not included. To select all the columns, use Range::all().

Returns
Type Description
UMat
| Improve this Doc View Source

SubMat(Range[])

Extracts a rectangular submatrix.

Declaration
public UMat SubMat(params Range[] ranges)
Parameters
Type Name Description
OpenCvSharp.Range[] ranges

Array of selected ranges along each array dimension.

Returns
Type Description
UMat
| Improve this Doc View Source

SubMat(Rect)

Extracts a rectangular submatrix.

Declaration
public UMat SubMat(Rect roi)
Parameters
Type Name Description
OpenCvSharp.Rect roi

Extracted submatrix specified as a rectangle.

Returns
Type Description
UMat
| Improve this Doc View Source

SubMat(Int32, Int32, Int32, Int32)

Extracts a rectangular submatrix.

Declaration
public UMat SubMat(int rowStart, int rowEnd, int colStart, int colEnd)
Parameters
Type Name Description
System.Int32 rowStart
System.Int32 rowEnd
System.Int32 colStart
System.Int32 colEnd
Returns
Type Description
UMat
| Improve this Doc View Source

SubMat(Range, Range)

Extracts a rectangular submatrix.

Declaration
public UMat SubMat(Range rowRange, Range colRange)
Parameters
Type Name Description
System.Range rowRange

Start and end row of the extracted submatrix. The upper boundary is not included. To select all the rows, use Range::all().

System.Range colRange

Start and end column of the extracted submatrix. The upper boundary is not included. To select all the columns, use Range::all().

Returns
Type Description
UMat
| Improve this Doc View Source

T()

Transposes a matrix.

Declaration
public UMat T()
Returns
Type Description
UMat
| Improve this Doc View Source

ToString()

Returns a string that represents this Mat.

Declaration
public override string ToString()
Returns
Type Description
System.String
| Improve this Doc View Source

Total()

Returns the total number of array elements.

Declaration
public long Total()
Returns
Type Description
System.Int64
| Improve this Doc View Source

Type()

Returns the type of a matrix element.

Declaration
public MatType Type()
Returns
Type Description
OpenCvSharp.MatType
| Improve this Doc View Source

Zeros(MatType, Int32[])

Returns a zero array of the specified size and type.

Declaration
public static UMat Zeros(MatType type, params int[] sizes)
Parameters
Type Name Description
OpenCvSharp.MatType type

Created matrix type.

System.Int32[] sizes
Returns
Type Description
UMat
| Improve this Doc View Source

Zeros(Size, MatType)

Returns a zero array of the specified size and type.

Declaration
public static UMat Zeros(Size size, MatType type)
Parameters
Type Name Description
OpenCvSharp.Size size

Alternative to the matrix size specification Size(cols, rows) .

OpenCvSharp.MatType type

Created matrix type.

Returns
Type Description
UMat
| Improve this Doc View Source

Zeros(Int32, Int32, MatType)

Returns a zero array of the specified size and type.

Declaration
public static UMat Zeros(int rows, int cols, MatType type)
Parameters
Type Name Description
System.Int32 rows

Number of rows.

System.Int32 cols

Number of columns.

OpenCvSharp.MatType type

Created matrix type.

Returns
Type Description
UMat

Implements

ICvPtrHolder
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX