| MatTElem Constructor (Int32, Int32, Array, Int64) |
constructor for matrix headers pointing to user-allocated data
Namespace:
OpenCvSharp
Assembly:
OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax public Mat(
int rows,
int cols,
Array data,
long step = 0
)
Public Sub New (
rows As Integer,
cols As Integer,
data As Array,
Optional step As Long = 0
)
public:
Mat(
int rows,
int cols,
Array^ data,
long long step = 0
)
new :
rows : int *
cols : int *
data : Array *
?step : int64
(* Defaults:
let _step = defaultArg step 0
*)
-> Mat
Parameters
- rows
- Type: SystemInt32
Number of rows in a 2D array. - cols
- Type: SystemInt32
Number of columns in a 2D array. - data
- Type: SystemArray
Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data.
Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied.
This operation is very efficient and can be used to process external data using OpenCV functions.
The external data is not automatically de-allocated, so you should take care of it. - step (Optional)
- Type: SystemInt64
Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any.
If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() .
See Also