c++ - Detect border of partially hidden ellipse with known center (OpenCV) -


i have detect border of ellipses in gray images. these images contains lot of stuff, there (partially hidden) ellipse. know center of ellipse in image.

advantages:

  1. ellipse visible

  2. point near center of ellipse known

  3. ellipse black (value = [0, 50] on 8bits)

troubles:

  1. white blobs (value = [220, 255]) can appears ellipse (not outside)

  2. black artefacts (value = [0, 80]) can hide 0% 50% of ellipse , white blobs (but center still known)

here 4 examples images represent different situations can appear :

diagrams

i've tried severals algo (hough circle, ellipse detection, ..) none of them managed different situations. moreover, don't benefit of known center. suggestions welcome !

try ransac method, allow avoid noise edges , fit ellipce accurate. ellipse have 2 focuses, can find them, knowing ellipse equation, , find middle between them. ellipse center of mass.

example of code ransac ellipse fitting: https://github.com/seisgo/ellipsefit


Comments