Given a connected component such as this:
I'd like to slice the image into two images where the narrowest part appears, so the output would look like this:
note: I have added few more examples (as requested):.
Given a connected component such as this:
I'd like to slice the image into two images where the narrowest part appears, so the output would look like this:
note: I have added few more examples (as requested):.
A really general and quite robust approach would be using erosion and watershed transformation:
This will eventually result in 2 (or more) separated components. Now:
For a code reference, you may want to take a look at this watershed segmentation guide from OpenCV. They have a use case quite similar to your own application.