Reputation: 490
I have to detect the border of ellipses in gray images. These images contains a lot of stuff, but there is always a (partially hidden) ellipse. I know where is the center of this ellipse in the image.
Advantages:
Ellipse is always visible
Point near the center of the ellipse is known
Troubles:
White blobs (value = [220, 255]) can appears into the ellipse (not outside)
Black artefacts (value = [0, 80]) can hide 0% to 50% of the ellipse and white blobs (but the center is still known)
Here are 4 examples images which represent the different situations that can appear :
I've tried severals algo (Hough circle, ellipse detection, ..) but none of them managed all the different situations. Moreover, they don't benefit of the known center. All suggestions are welcome !
Upvotes: 0
Views: 624
Reputation: 10852
Try RANSAC method, it will allow you avoid noise edges and fit ellipce accurate. Ellipse have 2 focuses, you can find them, knowing your ellipse equation, and then find middle between them. It will be you ellipse center of mass.
Example of code for RANSAC ellipse fitting: https://github.com/seisgo/EllipseFit
Upvotes: 1