src/Translate.jl

changeset 2
684032c29023
parent 0
eef71dd7202b
child 5
29b38780d52b
--- a/src/Translate.jl	Mon Nov 18 11:30:12 2019 -0500
+++ b/src/Translate.jl	Mon Nov 18 15:13:04 2019 -0500
@@ -127,8 +127,8 @@
     (bx, by) = size(b)
 
     # Translation from target to source coordinates
-    vxʹ = v[1] + (imx-bx)/2
-    vyʹ = v[2] + (imy-by)/2
+    vxʹ = (imx-bx)/2 - v[1]
+    vyʹ = (imy-by)/2 - v[2]
 
     # Target image indices within source image
     px = ceil(Int, max(1, vxʹ + 1) - vxʹ)

mercurial