Method Reshape
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
Reshape(int, int)
Changes the shape and/or the number of channels of a 2D matrix without copying the data.
public Mat Reshape(int cn, int rows = 0)
Parameters
cnintNew number of channels. If the parameter is 0, the number of channels remains the same.
rowsintNew number of rows. If the parameter is 0, the number of rows remains the same.
Returns
Reshape(int, int[])
Changes the shape and/or the number of channels of a 2D matrix without copying the data.
public Mat Reshape(int cn, int[] newDims)
Parameters
cnintNew number of channels. If the parameter is 0, the number of channels remains the same.
newDimsint[]New number of rows. If the parameter is 0, the number of rows remains the same.
Returns
Reshape(int, MatShape)
Changes the shape (and optionally the number of channels) of the matrix without copying the data, using a MatShape (OpenCV 5).
public Mat Reshape(int cn, MatShape newShape)
Parameters
cnintNew number of channels. If 0, the number of channels remains the same.
newShapeMatShapeNew shape.