I am trying to implement the Watershed algorithm for image segmentation. I applied in the pre-processing phase Median filter and Morphological Gradient, but the results are way too over segmented as seen in the pictures above. After some research on web I found that adaptive thresholding might be a solution. Otsu's method is not desirable for me, since I am trying to enhance the edges as well as possible, for a further extraction of the objects from the background.
Original elephant image:
Oversegmented image:
Thank you and hopefully you can give me an advice on how to make it work on Java since most of the solutions are in matlab!