Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncation of ellipse major and minor axis lengths #19

Open
tobbelobb opened this issue Apr 9, 2021 · 0 comments
Open

Truncation of ellipse major and minor axis lengths #19

tobbelobb opened this issue Apr 9, 2021 · 0 comments

Comments

@tobbelobb
Copy link

In an earlier issue, I've said that I solved an issue by adding + 1.0 to these lines:

  // semimajor axis
  a = sqrt(F3 / A2) + 1.0;
  // semiminor axis
  b = sqrt(F3 / C2) + 1.0;

Now I've removed the + 1.0s again, and solved the issue in a better way.

The semi-major and semi-minor axis lengths were truncated, which caused the accuracy issue I had. This is solved by changing the type of the axes member within the mEllipse class from cv::Size to cv::Size2d.

Here:
https://github.com/CihanTopal/ED_Lib/blob/master/EDCircles.h#L54

Also, the constructor and all calls to it must be adjusted to take doubles.

All other parts of the code use doubles for major/minor axis lengths, so no further changes are required.

This fix improves accuracy of the ellipse detector by half, or maybe a quarter of, a pixel on average.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant