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 orientation (from upstream branch) #65

Merged
merged 17 commits into from
Jun 16, 2023
Merged

Conversation

vadixidav
Copy link
Member

This is the same branch as #64 but added to the upstream repository as the original branch was not modifiable by maintainers.

@vadixidav
Copy link
Member Author

@stephanemagnenat I have incorporated your changes along with my own. Could you please compare the Rust CV akaze against the OpenCV implementation again to see if the behavior is now the same.

@stephanemagnenat
Copy link
Contributor

On my unpublished branch, I had the following code for half_size:

Self(ImageBuffer::from_fn(width, height, |x, y| {
    let x = x * 2;
    let y = y * 2;
    let mut sum = self.0.get_pixel(x, y).0[0];
    let mut count = 1.0;
    let horiz_ok = x + 1 < self.0.width();
    let vert_ok = y + 1 < self.0.height();
    if horiz_ok {
        sum += self.0.get_pixel(x + 1, y).0[0];
        count += 1.0;
    }
    if vert_ok {
        sum += self.0.get_pixel(x, y + 1).0[0];
        count += 1.0;
    }
    if vert_ok && horiz_ok {
        sum += self.0.get_pixel(x + 1, y + 1).0[0];
        count += 1.0;
    }
    Luma([sum / count])
}))

It would be interesting to see which one is faster, compared to the one in this PR, that uses iterators and save tests in the inner loop, but touches the right pixels out of order.

@stephanemagnenat
Copy link
Contributor

Further corrections in #66, with the debug dumps.

@stephanemagnenat
Copy link
Contributor

stephanemagnenat commented Jun 9, 2023

Ok, now the push works, thanks!

@stephanemagnenat stephanemagnenat force-pushed the fix_akaze_orientation branch 4 times, most recently from 786d88a to 2d01f6b Compare June 12, 2023 13:17
@stephanemagnenat stephanemagnenat mentioned this pull request Jun 12, 2023
Copy link
Member

@xd009642 xd009642 left a comment

Choose a reason for hiding this comment

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

Checked and we're happy to merge. Thanks for all the hard work!

@xd009642 xd009642 merged commit 147bd10 into main Jun 16, 2023
@xd009642 xd009642 deleted the fix_akaze_orientation branch June 16, 2023 19:37
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.

3 participants