watershed function

Mat watershed(
  1. InputArray image,
  2. InputOutputArray markers
)

Watershed performs a marker-based image segmentation using the watershed algorithm.

For further details, please see: https:///docs.opencv.org/4.x/d3/d47/group__imgproc__segmentation.html#ga3267243e4d3f95165d55a618c65ac6e1

Implementation

Mat watershed(InputArray image, InputOutputArray markers) {
  cvRun(() => cimgproc.cv_watershed(image.ref, markers.ref, ffi.nullptr));
  return markers;
}