Class UMat
OpenCV C++ n-dimensional dense array class (cv::Mat)
Implements
Inherited Members
Namespace: OpenCvSharp
Assembly: OpenCvSharp.dll
Syntax
public class UMat : DisposableCvObject, ICvPtrHolder
Constructors
| Improve this Doc View SourceUMat(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. |
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 . |
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 |
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 |
UMat(UMat)
Declaration
protected UMat(UMat m)
Parameters
Type | Name | Description |
---|---|---|
UMat | m |
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 |
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. |
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. |
UMat(UMatUsageFlags)
Creates empty Mat
Declaration
public UMat(UMatUsageFlags usageFlags = UMatUsageFlags.None)
Parameters
Type | Name | Description |
---|---|---|
UMatUsageFlags | usageFlags |
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 |
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 SourceTypeMap
typeof(T) -> MatType
Declaration
protected static readonly IReadOnlyDictionary<Type, MatType> TypeMap
Field Value
Type | Description |
---|---|
IReadOnlyDictionary<Type, OpenCvSharp.MatType> |
Properties
| Improve this Doc View SourceCols
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 |
Dims
the array dimensionality, >= 2
Declaration
public int Dims { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 SourceAdjustROI(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 |
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 |
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). |
Channels()
Returns the number of matrix channels.
Declaration
public int Channels()
Returns
Type | Description |
---|---|
System.Int32 |
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. |
Clone()
Creates a full copy of the matrix.
Declaration
public UMat Clone()
Returns
Type | Description |
---|---|
UMat |
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 |
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 |
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 |
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 |
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 |
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. |
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. |
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. |
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. |
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. |
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. |
Depth()
Returns the depth of a matrix element.
Declaration
public int Depth()
Returns
Type | Description |
---|---|
System.Int32 |
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 |
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 |
DisposeUnmanaged()
Releases unmanaged resources
Declaration
protected override void DisposeUnmanaged()
Overrides
| Improve this Doc View SourceDot(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 |
ElemSize()
Returns the matrix element size in bytes.
Declaration
public int ElemSize()
Returns
Type | Description |
---|---|
System.Int32 |
ElemSize1()
Returns the size of each matrix element channel in bytes.
Declaration
public int ElemSize1()
Returns
Type | Description |
---|---|
System.Int32 |
Empty()
Returns true if the array has no elements.
Declaration
public bool Empty()
Returns
Type | Description |
---|---|
System.Boolean |
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 |
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 |
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 |
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 |
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 |
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 |
IsContinuous()
Reports whether the matrix is continuous or not.
Declaration
public bool IsContinuous()
Returns
Type | Description |
---|---|
System.Boolean |
IsSubmatrix()
Returns whether this matrix is a part of other matrix or not.
Declaration
public bool IsSubmatrix()
Returns
Type | Description |
---|---|
System.Boolean |
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. |
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 |
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 |
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 |
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 |
Release()
Releases the resources
Declaration
public void Release()
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Size()
Returns a matrix size.
Declaration
public Size Size()
Returns
Type | Description |
---|---|
OpenCvSharp.Size |
Size(Int32)
Returns a matrix size.
Declaration
public int Size(int dim)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | dim |
Returns
Type | Description |
---|---|
System.Int32 |
Step()
Returns number of bytes each matrix row occupies.
Declaration
public long Step()
Returns
Type | Description |
---|---|
System.Int64 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
T()
Transposes a matrix.
Declaration
public UMat T()
Returns
Type | Description |
---|---|
UMat |
ToString()
Returns a string that represents this Mat.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Total()
Returns the total number of array elements.
Declaration
public long Total()
Returns
Type | Description |
---|---|
System.Int64 |
Type()
Returns the type of a matrix element.
Declaration
public MatType Type()
Returns
Type | Description |
---|---|
OpenCvSharp.MatType |
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 |
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 |
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 |