I have been using skim age\'s thresholding algorithms to get some binary mask. For example, I obtain binary images like this:
This is actually a mostly solved problem in image processing. Looks like what you want is a Hough Transform, specifically the circular or elliptical kind. I believe the circular one is a bit less computationally intensive in general.
Here are some code examples for scikit-image that show pretty much exactly what you're trying to do. And here is a link to the documentation.