Table of Contents

Method SubMat

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

SubMat(int, int, int, int)

Extracts a rectangular submatrix.

public Mat<TElem> SubMat(int rowStart, int rowEnd, int colStart, int colEnd)

Parameters

rowStart int

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

rowEnd int

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

colStart int

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

colEnd int

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

Returns

Mat<TElem>

SubMat(Range, Range)

Extracts a rectangular submatrix.

public Mat<TElem> SubMat(Range rowRange, Range colRange)

Parameters

rowRange Range

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

colRange Range

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

Returns

Mat<TElem>

SubMat(Rect)

Extracts a rectangular submatrix.

public Mat<TElem> SubMat(Rect roi)

Parameters

roi Rect

Extracted submatrix specified as a rectangle.

Returns

Mat<TElem>

SubMat(Range[])

Extracts a rectangular submatrix.

public Mat<TElem> SubMat(Range[] ranges)

Parameters

ranges Range[]

Array of selected ranges along each array dimension.

Returns

Mat<TElem>