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

fitEllipse sometimes computes wrong angles #200

Open
dlegland opened this issue Aug 22, 2024 · 1 comment
Open

fitEllipse sometimes computes wrong angles #200

dlegland opened this issue Aug 22, 2024 · 1 comment
Assignees

Comments

@dlegland
Copy link
Member

When the data to fit correspond to nearly vertical ellipses, the resulting angle is sometimes around zero (corresponding to the wrong axis).

A quick workaround is to change line 124 into:

if (par(2)>0)
    theta = 0.5 * atan2(par(2), par(1) - par(3));
else
    theta = 0.5 * atan2(-par(2), -par(1) + par(3));
end

@dlegland dlegland self-assigned this Aug 22, 2024
@dlegland
Copy link
Member Author

dlegland commented Sep 13, 2024

It seems there is more involved code in fitEllipse3d.m. Could propagate to 2D case.

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