selectROIs method

VecRect selectROIs(
  1. Mat img
)

SelectROIs selects multiple Regions Of Interest (ROI) on the given image. It creates a window and allows user to select ROIs cvRunArena mouse.

Controls: use space or enter to finish current selection and start a new one use esc to terminate multiple ROI selection process

For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga0f11fad74a6432b8055fb21621a0f893

Implementation

VecRect selectROIs(Mat img) {
  return cvRunArena<VecRect>((arena) {
    final result = calloc<chighgui.VecRect>();
    final cname = name.toNativeUtf8().cast<ffi.Char>();
    cvRun(() => chighgui.Window_SelectROIs(cname, img.ref, result));
    calloc.free(cname);
    return VecRect.fromPointer(result);
  });
}