Given an image that contains several irregularly sized and shaped images (shown here as circles for the sake of simplicity):
...how can I:
- Detect sub-images
- Split and save sub-images as separate files?
Ideally I'm looking for a python solution. I've tried "connected component analysis" algorithms, and centroid measurement but the first breaks down for non-uniform images like those given, and I'm not sure how to apply the second to extract separate images.
Note, I'm not asking about splitting an image into equally-sized, uniform parts, which has been asked and answered many times on SO.
Thanks for any help you can give.