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

Cannot display rotated small images #717

Closed
tbenst opened this issue Apr 15, 2018 · 3 comments
Closed

Cannot display rotated small images #717

tbenst opened this issue Apr 15, 2018 · 3 comments
Labels

Comments

@tbenst
Copy link

tbenst commented Apr 15, 2018

similar to #640. Tested with both Juno and IJulia on Images v0.13.0. Interestingly, it does work in REPL so it appears to be related to displaying the image.

using Images,TestImages,CoordinateTransformations
start = 200
ending = start + 75
img = testimage("lighthouse")[start:ending,start:ending]
tfm = recenter(RotMatrix(pi/8), center(img))
imgrot = warp(img, tfm) # works

start = 200
ending = start + 74
img = testimage("lighthouse")[start:ending,start:ending]
tfm = recenter(RotMatrix(pi/8), center(img))
imgrot = warp(img, tfm) # gives error

size not supported for arrays with axes (-11:87, -11:87); see http://docs.julialang.org/en/latest/devdocs/offset-arrays/

@tbenst tbenst changed the title Cannot dirplay rotated small images Cannot display rotated small images Apr 15, 2018
@Evizero
Copy link
Member

Evizero commented Apr 16, 2018

I suspect this is caused by repeat in the show method: https://github.com/JuliaImages/Images.jl/blob/master/src/showmime.jl#L33

julia> using OffsetArrays

julia> A = OffsetArray(rand(3,3), -1, -1)
OffsetArrays.OffsetArray{Float64,2,Array{Float64,2}} with indices 0:2×0:2:
 0.256666  0.274267  0.962343
 0.580651  0.694334  0.78365 
 0.167408  0.304966  0.766681

julia> repeat(A, inner=2)
ERROR: size not supported for arrays with axes (0:2, 0:2); see http://docs.julialang.org/en/latest/devdocs/offset-arrays/

@zygmuntszpak
Copy link
Member

This seems to be the same underlying issue as #650. See Tim's comments in that thread.

@johnnychen94
Copy link
Member

my temporary solution is to convert it to Array

imgrot = imrotate(img, pi/8) |> Array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants