I’m trying to segment all bunched-up objects and I think watershed is the way to go, so I can findCoutours properly, but I am beginning to think the
Gradient Magnitude can give a properly defined Contour and highlight their external edges instead of the Watershed which will only create sub-Contours.
Does OpenCV support the Gradient Magnitude technique? I can’t find it on the website.
Gradient operators compute the horizontal and vertical derivative of an image. So you get two images, with the horizontal and vertical edges.
To get the magnitude, you have to combine these two images using one of the formulas above.
For a more detailed description follow this tutorial: OpenCV: Sobel Derivatives