Philokey
Philokey

Reputation: 491

Algorithm of ellipse fitting in OpenCV

I read the code of ellipse fitting in OpenCV, the following link gives the source code of ellipse fitting in OpenCV: http://lpaste.net/161378.

I want to know some details about ellipse fitting in OpenCV, but I can not find any documents of the algorithm. In the comments, it said " New fitellipse algorithm, contributed by Dr. Daniel Weiss". But I can not find any paper about ellipse fitting of Dr. Daniel Weiss.

I have some questions of the algorithm:

  1. Why does the algorithm need re-fit. It first fit for parameters A - E, and then re-fit for parameters A - C with those center coordinates.
  2. Ellipse need the satisfy the constraint of 4*a*b - c^2 > 0, how does the algorithm satisfy it?

Upvotes: 4

Views: 3309

Answers (3)

Henri Chat Noir
Henri Chat Noir

Reputation: 11

You might find this repo useful (with pip set-up):

https://github.com/bdhammel/least-squares-ellipse-fitting

which works from an upgrade to the Fitzgibbon algorithm (as a starting point), as authored by Halir here:

https://github.com/bdhammel/least-squares-ellipse-fitting/blob/master/media/WSCG98.pdf

I've since tested this a little and seems to be very effective. Note that the 'example' on the repo home page is out of date -- look to the example.py module in the code itself for usage that seems to work as to module imports, etc.

Upvotes: 1

zvrba
zvrba

Reputation: 24546

I'm wondering about this myself since I've discovered that the algorithm is bugged. See this bug-report: https://github.com/Itseez/opencv/issues/6544

I tried to find any relevant papers by Dr. Daniel Weiss and failed.

Upvotes: 2

Related Questions