specialize imrotate for 0, 90, 180, 270 degrees
img = testimage("cameraman") # (512, 512)
# Before: (514, 514)
# After: (512, 512)
size(imrotate(img, pi/2))
# Before: sizes are not equal
# After: true
imrotate(imrotate(imrotate(imrotate(img, pi/2), pi/2), pi/2), pi/2) == img
# Before: sizes are not equal
# After: true
imrotate(imrotate(img, pi), pi) == img
Codecov Report
Merging #79 into master will increase coverage by
0.56%. The diff coverage is100%.
@@ Coverage Diff @@
## master #79 +/- ##
==========================================
+ Coverage 88.56% 89.12% +0.56%
==========================================
Files 7 7
Lines 271 285 +14
==========================================
+ Hits 240 254 +14
Misses 31 31
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/warp.jl | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 9c18de9...ca777ff. Read the comment docs.
I believe this PR is ready for review and merge
is it type stable? was it before this PR?
Thanks for the comment, I'm already aware of the type stability issue, I'll come back and try to fix that later when I finished the upgrading of Augmentor.jl made by @Evizero (for my own research interest)
BTW, 360 ° seems to be missing.
BTW, I think it is better to round the rotation matrix instead of quantizing the angle.
That sounds promising to me!
It seems a bit dangerous to specialize on an approximation for an irrational number. Maybe it would be better to have a degree based version of imrotate and specialize on multiples of 90 like the title suggests? The discretized imrotate could then map to that.
Otherwise, I would really appreciate something like this. It's absence was duly noted when attempting something AoC2020 Day 20: https://adventofcode.com/2020/day/20
sinpi and cospi could also have some relevance here.
https://docs.julialang.org/en/v1/base/math/#Base.Math.sinpi
I'll let @johnnychen94 decide what to do here, but I put all the tests from this PR into #149 and they pass.