1 | initial version |
You should first apply watershed segmentation on the image, nextly apply smoothing(median) preferably so as to clear the salt and pepper noise on the binary image obtained and lastly take the contours of the image. Hope this works.