OpenCvSharp.Cv2.Watershed C# (CSharp) Method

Watershed() public static method

Performs a marker-based image segmentation using the watershed algorithm.
public static Watershed ( InputArray image, InputOutputArray markers ) : void
image InputArray Input 8-bit 3-channel image.
markers InputOutputArray Input/output 32-bit single-channel image (map) of markers. /// It should have the same size as image.
return void
        public static void Watershed(InputArray image, InputOutputArray markers)
        {
            if (image == null)
                throw new ArgumentNullException(nameof(image));
            if (markers == null)
                throw new ArgumentNullException(nameof(markers));
            image.ThrowIfDisposed();
            markers.ThrowIfNotReady();
            NativeMethods.imgproc_watershed(image.CvPtr, markers.CvPtr);
            GC.KeepAlive(image);
            markers.Fix();
        }
        #endregion
Cv2