Reputation: 5821
I want to analyse object geometry in images with the help of contours. This way parameters like angle and distance can be determined:
But some images look like this:
I am trying to make a contour break in between both objects, problem is that the objects have not a fixed size. They can change their length and shape. As a result the contour break is done at wrong positions, so that no proper analysis is possible. Right now the contour break is coupled with the size of the lower object. This is how a correct break should look like:
Any idea how to solve this?
Edit:
Folder with Input Images: https://ufile.io/v6fqs
Example:
Upvotes: 4
Views: 294
Reputation: 315
Thanks for the examples and the well framed question.
That's a big issue indeed, even more considering medical imaging. Seems to me that the answer lies in a blob detection and separation method.
A good method for that would be to do some binarization, morphological transforms and search for convexity defects (https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#gada4437098113fd8683c932e0567f47ba).
convexityDefects = cv.convexityDefects(contour, convexhull[, convexityDefects] )
And I also think this thread can help you as well:
Upvotes: 4