Detach blobs with a contact point
Hello. I'm working with blob analysis and i'm having problems on detaching 2 blobs which have a contact point. The images i'm working on are of this type:
These are the same images binarized:
My problem is morphological operators like erosion, dilation and opening don't work since the dimensions of the contact points are the same or even greater than some important points of the image (like the heads of the objects with 2 holes) and so when I set my operator (opening in this case) in order to delete contact points I end up deleting also parts of the image which I need to do other calculations (like number of holes per object).
I thought of applying a certain number of opening operators using a rectangle oriented as each of the objects as structuring element (as suggested here http://answers.opencv.org/question/56...), but this solution doesn't work well, since it is not assured that the contact points are oriented as one of the objects involved (as it happens, for example, for the contact point in the inferior part of the second image). Anyone of you have ideas of how I could solve this problem?
Edit: Here are the results thanks to sturkmen
nice job ;-). Could you add also the code for drawing the coordinate axes with the curve. I like the way you draw it. It seems quite nice. Moreover, I think it would be better to post the code here, since in an external service it might get inactive after some period and get lost after all.
Here's the code for the axes and the curve:
Basically i draw 2 arrowed lines of certain length stasrting from barycenter, then i properly draw a portion of ellipse (circle) to draw the angle.
@Drakem well done ;-)