locateROI method

(Size, Point) locateROI()

Locates the matrix header within a parent matrix.

After you extracted a submatrix from a matrix using Mat::row, Mat::col, Mat::rowRange, Mat::colRange, and others, the resultant submatrix points just to the part of the original big matrix. However, each submatrix contains information (represented by datastart and dataend fields) that helps reconstruct the original matrix size and the position of the extracted submatrix within the original matrix. The method locateROI does exactly that.

https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#a40b5b3371a9c2a4b2b8ce0c8068d7c96

Implementation

(Size wholeSize, Point ofs) locateROI() {
  final pWholeSize = calloc<ccore.Size>();
  final pOfs = calloc<ccore.Point>();
  cvRun(() => ccore.Mat_LocateROI(ref, pWholeSize, pOfs));
  return (Size.fromPointer(pWholeSize), Point.fromPointer(pOfs));
}