Constructor UMat
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
UMat(UMatUsageFlags)
Creates empty Mat
public UMat(UMatUsageFlags usageFlags = UMatUsageFlags.None)
Parameters
usageFlagsUMatUsageFlags
UMat(UMat)
protected UMat(UMat m)
Parameters
mUMat
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
rowsintNumber of rows in a 2D array.
colsintNumber of columns in a 2D array.
typeMatTypeArray 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.
usageFlagsUMatUsageFlagsusage 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
sizeSize2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the number of columns go in the reverse order.
typeMatTypeArray 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.
usageFlagsUMatUsageFlagsusage 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
rowsintNumber of rows in a 2D array.
colsintNumber of columns in a 2D array.
typeMatTypeArray 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.
sScalarAn 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 .
usageFlagsUMatUsageFlagsusage 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
sizeSize2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the number of columns go in the reverse order.
typeMatTypeArray 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.
sScalarAn 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 .
usageFlagsUMatUsageFlagsusage 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
mUMatArray 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() .
rowRangeRangeRange 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.
colRangeRangeRange of the m columns to take. Use Range.All to take all the columns.
usageFlagsUMatUsageFlagsusage flags for allocator
UMat(UMat, Range[])
creates a matrix header for a part of the bigger matrix
public UMat(UMat m, Range[] ranges)
Parameters
mUMatArray 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() .
rangesRange[]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
mUMatArray 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() .
roiRectRegion of interest.
UMat(IEnumerable<int>, MatType)
constructs n-dimensional matrix
public UMat(IEnumerable<int> sizes, MatType type)
Parameters
sizesIEnumerable<int>Array of integers specifying an n-dimensional array shape.
typeMatTypeArray 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
sizesIEnumerable<int>Array of integers specifying an n-dimensional array shape.
typeMatTypeArray 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.
sScalarAn 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 .