How do I detect the aberrations that prevent a smooth curve in the following image?

31 Views Asked by At

So I have been working on a project that require finding defect in onions. The image that's attached is an abnormal onion. You can see that the onion is made-up of two smaller onion twins. What's interesting is that human eye can easily detect whats wrong with the structure.

One can do an structural analysis and can observe that a normal onion has almost smooth curvature while an abnormal one doesn't. Thus quite simply I want to build a classification algorithm based on the edges of the object.

However there are times when the skin of onion makes the curve irregular. See the image, there's a small part of skin that's outside the actual curvature. I want to discriminate the bulged part due to the skin vs the deformities produced at the point where the two subsection meet and then reconstruct the contour of object for further analysis .

Is there a mathemagical thing that would help me here given the fact that I have majority of the points that makes the outer edge of onion including the two irregularities?

Image containing the points and curve formed on the onion