I have this image:

enter image description here

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

enter image description here

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


2 Answers 2


enter image description here


enter image description here

here is the result :


![enter image description here

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}))  

enter image description here

  • 1
    $\begingroup$ 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. $\endgroup$
    – user484
    Jul 12, 2017 at 9:37
  • $\begingroup$ @Rahul Thanks. In fact my approach was "chimical" rather than "image processing". $\endgroup$
    – andre314
    Jul 12, 2017 at 9:41
img = Import["https://i.sstatic.net/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]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.