consistent signs

Mon, 18 Nov 2019 15:13:04 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 18 Nov 2019 15:13:04 -0500
changeset 2
684032c29023
parent 1
2b4549ab4a18
child 3
957b62860ab4

consistent signs

src/Translate.jl file | annotate | diff | comparison | revisions
--- 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