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<cvg.CvSize>();
  final pOfs = calloc<cvg.CvPoint>();
  cvRun(() => ccore.cv_Mat_locateROI(ref, pWholeSize, pOfs, ffi.nullptr));
  return (Size.fromPointer(pWholeSize), Point.fromPointer(pOfs));
}