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

Use higher precision in imrotate #148

Merged
merged 2 commits into from
Oct 10, 2021
Merged

Use higher precision in imrotate #148

merged 2 commits into from
Oct 10, 2021

Conversation

timholy
Copy link
Member

@timholy timholy commented Oct 9, 2021

Fixes #147
Fixes #145

@timholy
Copy link
Member Author

timholy commented Oct 9, 2021

Let me acknowledge that the broken test isn't ideal. nvm, I figured out a fix. Still, it's worth pointing out:

julia> mod2pi(2π)
6.283185307179586

julia> mod2pi(nextfloat(2π))
6.432490598706546e-16

so it cannot exactly hit 0, and hence the NaN pattern at the edge is different. But it's the only case from among all the angles where there is a difference. But both differ from 0 or 2π by less than eps(2π) so we can still figure out what was meant.

@codecov
Copy link

codecov bot commented Oct 9, 2021

Codecov Report

Merging #148 (1ea801b) into master (4d89e5c) will increase coverage by 0.84%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #148      +/-   ##
==========================================
+ Coverage   89.06%   89.90%   +0.84%     
==========================================
  Files           8        8              
  Lines         192      208      +16     
==========================================
+ Hits          171      187      +16     
  Misses         21       21              
Impacted Files Coverage Δ
src/warp.jl 100.00% <100.00%> (ø)
src/resizing.jl 100.00% <0.00%> (ø)
src/autorange.jl 93.33% <0.00%> (+0.65%) ⬆️
src/interpolations.jl 75.00% <0.00%> (+3.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d89e5c...1ea801b. Read the comment docs.

Copy link
Member

@johnnychen94 johnnychen94 left a comment

Choose a reason for hiding this comment

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

Nice! Thank you for putting your efforts into this issue.

@timholy
Copy link
Member Author

timholy commented Oct 10, 2021

Just trying to catch up on rather a long time of letting you carry the load!

@timholy timholy merged commit ad4053a into master Oct 10, 2021
@timholy timholy deleted the teh/fix_147 branch October 10, 2021 18:08
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.

Clarification of rotations imrotate(img, pi/2) changes size of image
2 participants