Skip to content

Commit 6832955

Browse files
committed
2 parents e127b76 + b387798 commit 6832955

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DataAugmentation"
22
uuid = "88a5189c-e7ff-4f85-ac6b-e6158070f02e"
33
authors = ["lorenzoh <lorenz.ohly@gmail.com>"]
4-
version = "0.1.1"
4+
version = "0.1.3"
55

66
[deps]
77
ColorBlendModes = "60508b50-96e1-4007-9d6c-f475c410f16b"
@@ -11,6 +11,7 @@ ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795"
1111
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
1212
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
1313
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
14+
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
1415
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
1516
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
1617
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"

src/DataAugmentation.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ using Images: Colorant, permuteddimsview
88
using ImageTransformations
99
using ImageTransformations: center, _center, box_extrapolation, warp!
1010
using Interpolations
11+
using OffsetArrays: OffsetArray
1112
using LinearAlgebra: I
1213
using Parameters
1314
using Rotations

src/items/image.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ end
8181
# as they are implicitly given by the buffer.
8282

8383
function project!(bufimage::Image, P, image::Image{N, T}, indices) where {N, T}
84+
# Update index offsets so the correct portion of the image is warped
85+
buf = OffsetArray(itemdata(bufimage), indices)
8486
warp!(
85-
itemdata(bufimage),
87+
buf,
8688
box_extrapolation(itemdata(image), zero(T)),
8789
inv(P),
8890
)
89-
return Image(itemdata(bufimage), P.(getbounds(image)))
91+
return Image(buf, P.(getbounds(image)))
9092
end

0 commit comments

Comments
 (0)