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

Fix Akaze's rotational invarience. #64

Closed
wants to merge 1 commit into from
Closed

Fix Akaze's rotational invarience. #64

wants to merge 1 commit into from

Conversation

stephanemagnenat
Copy link
Contributor

Work in progress fixing the rotational invariance bug of Rust CV Akaze implementation.

@@ -318,10 +318,13 @@ fn do_subpixel_refinement(
if f32::abs(dst[0]) <= 1.0 && f32::abs(dst[1]) <= 1.0 {
let mut keypoint_clone = *keypoint;
keypoint_clone.point = ((x as f32) + dst[0], (y as f32) + dst[1]);
let power = f32::powf(2.0f32, evolutions[keypoint.class_id].octave as f32);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change leads to points being out of bounds later, but it is what the C++ code does. I believe that either there is a matching bug somewhere else, or the C++ code might have an illegal memory access that doesn't get noticed due to the use of pointers.

Copy link
Contributor Author

@stephanemagnenat stephanemagnenat Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After putting an assertion in the C++ original code, I can confirm that it doesn't do out of bounds access where the Rust code does, so there is an additional bug somewhere.

@vadixidav
Copy link
Member

That test error is just checking to ensure the behavior stays the same when changes are made. I can update the tests to match the new behavior.

@vadixidav
Copy link
Member

@stephanemagnenat I invited you as a member to Rust CV. Once you accept, you can modify this branch in the upstream repo. Since this PR didn't have the "allow maintainers to edit your branch" checked, it is easier for me to modify it here. I will also be adding changes to fix the other issues I identified in #63 which you can test against. Closing this for now, replaced with #65.

@vadixidav vadixidav closed this Jun 8, 2023
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

Successfully merging this pull request may close these issues.

2 participants