I am writing a program to analyze microscopy images. I have an edge mapping of an image that looks like this:

The program I have written draws bounding boxes around circular shapes, but when the contours are not closed (like in the image above) it struggles and the resulting bounding box can include multiple circles.
So given this image, is there a way to differentiate between the two circular (or ovular) bodies, so the bounding boxes accurately enclose each shape?
(The image is an example of a bounding box incorrectly drawn around multiple circles)