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

Subtle numeric difference from OpenCV #3

Open
jerry73204 opened this issue Jan 15, 2021 · 6 comments
Open

Subtle numeric difference from OpenCV #3

jerry73204 opened this issue Jan 15, 2021 · 6 comments

Comments

@jerry73204
Copy link
Contributor

Hey! I wrote a test that compares the projected pixels against actual OpenCV implementation.

By randomly sampling parameters and input points, it reaches about 97.5% success rate. It shows the Rust implementation covers most cases. I look into the failing parts and it seems due to numeric computation issues.

Do you consider to import or refer to the test, or document potential failing scenarios?

@astraw
Copy link
Member

astraw commented Jan 16, 2021

Yes, I would be interested to hear more and potentially add the tests.

@astraw
Copy link
Member

astraw commented Jan 16, 2021

Ah I didn’t initially see you linked the test. I will look into this.

@astraw
Copy link
Member

astraw commented Jan 17, 2021

I can reproduce your results on my system - thanks. I haven't started digging in any further. Have you started looking at the failure cases to check what might be going on?

@jerry73204
Copy link
Contributor Author

Not in deep dive. I collect the erroneous cases. They are always large in coordinates, for example 9631530000000.0. I guess it's rounding error at some place and multiplied to the one place.

@jerry73204
Copy link
Contributor Author

I see the difference in rounding error might not be avoidable in implementation. Once we can confirm it's a numerical issue but not a logical issue, it's fine to close this issue.

@astraw
Copy link
Member

astraw commented Jan 20, 2021

I think we can build this and OpenCV to print the exact values to high precision at each step and then we can see at exactly which step things get different. Ideally there would be no divergence for all possible inputs.

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

2 participants