# how to detect contour without inclusion of surface irregularities and high curvature

I have this image:

I wish to know if there is a way to detect a very smooth contour of this blob without including any surface irregularities (objects close or attached to the surface that tend to increase the curvature dramatically).

The approach that I have been using includes the use of MorphologicalBinarize. However, I do not know how to get rid of any irregularities close to the surface of the blob

Note: Since i have a stack of images, drawing by hand is tedious

img00=Import["https://i.stack.imgur.com/unvja.png"]


img01=Erosion[img00,DiskMatrix[60]]


here is the result :

img02=Dilation[img01,DiskMatrix[60]]


The value 60 used for Erosion/Dilation has been easily found by experimental trials (4 iterations : 3 -> 10 -> 30 -> 60) .

comparaison result/initial image :

img03=ImageMultiply @@ (ColorNegate /@ (GradientFilter[#,2]& /@  {img00,img02}))


• Erosion followed by Dilation is known as Opening. If one wants to fill holes as well as remove protrusions, one can perform Closing as well. – user484 Jul 12 '17 at 9:37
• @Rahul Thanks. In fact my approach was "chimical" rather than "image processing". – andre314 Jul 12 '17 at 9:41
img = Import["https://i.stack.imgur.com/fBF7C.png"];

curveImg = ColorNegate@CurvatureFlowFilter[img, 80];

circleImg = ColorNegate@EdgeDetect[FillingTransform[DeleteSmallComponents[Binarize[curveImg]]]];

circleImgCol = Colorize[circleImg, ColorRules -> {0 -> Red, 1 -> White}];

ImageMultiply[img, circleImgCol]