Skip to content

Commit

Permalink
use explicit and intuitive CartesianIndex(1, 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnychen94 committed Dec 17, 2019
1 parent 733e32b commit 67e9784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/operations/resize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ end

function applyaffineview(op::Resize{N}, img::AbstractArray{T,N}, param) where {T,N}
Rin, Rout = CartesianIndices(axes(img)), CartesianIndices(op.size)
sf = Tuple(last(Rout)) ./ Tuple(last(Rin) - first(Rin) + first(Rout))
sf = Tuple(last(Rout)) ./ Tuple(last(Rin) - first(Rin) + CartesianIndex(1, 1))
# We have to extrapolate if the image is upscaled,
# otherwise the original border will only cause a single pixel
tinv = toaffinemap(op, img, param)
Expand Down

0 comments on commit 67e9784

Please sign in to comment.