[GRASS-SVN] r72462 - grass/trunk/imagery/i.ortho.photo/i.ortho.transform

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 21 04:08:47 PDT 2018


Author: mmetz
Date: 2018-03-21 04:08:47 -0700 (Wed, 21 Mar 2018)
New Revision: 72462

Modified:
   grass/trunk/imagery/i.ortho.photo/i.ortho.transform/main.c
Log:
i.ortho.transform: do not overwrite transformed coordinates

Modified: grass/trunk/imagery/i.ortho.photo/i.ortho.transform/main.c
===================================================================
--- grass/trunk/imagery/i.ortho.photo/i.ortho.transform/main.c	2018-03-21 11:02:52 UTC (rev 72461)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.transform/main.c	2018-03-21 11:08:47 UTC (rev 72462)
@@ -139,7 +139,7 @@
     count = 0;
 
     for (n = 0; n < points->count; n++) {
-	double e1, n1, e2, n2;
+	double etmp, ntmp;
 	double fx, fy, fd, fd2;
 	double rx, ry, rd, rd2;
 
@@ -148,14 +148,16 @@
 
 	count++;
 
+	fd = fd2 = rd = rd2 = 0;
+
 	if (need_fwd) {
 	    /* image -> photo -> target */
 
 	    /* image coordinates ex, nx to photo coordinates ex1, nx1 */
-	    I_georef(points->e1[n], points->n1[n], &e1, &n1, group.E12, group.N12, 1);
+	    I_georef(points->e1[n], points->n1[n], &etmp, &ntmp, group.E12, group.N12, 1);
 
 	    /* photo coordinates ex1, nx1 to target coordinates e1, n1 */
-	    I_inverse_ortho_ref(e1, n1, points->z1[n], &e2, &n2, &z2,
+	    I_inverse_ortho_ref(etmp, ntmp, points->z1[n], &e2, &n2, &z2,
 	                        &group.camera_ref,
 				group.XC, group.YC, group.ZC, group.MI);
 
@@ -174,11 +176,11 @@
 
 	    /* target coordinates e1, n1 to photo coordinates ex1, nx1 */
 	    I_ortho_ref(points->e2[n], points->n2[n], points->z2[n],
-	                &e2, &n2, &z2, &group.camera_ref,
+	                &etmp, &ntmp, &z2, &group.camera_ref,
 			group.XC, group.YC, group.ZC, group.M);
 
 	    /* photo coordinates ex1, nx1 to image coordinates ex, nx */
-	    I_georef(e2, n2, &e1, &n1, group.E21, group.N21, 1);
+	    I_georef(etmp, ntmp, &e1, &n1, group.E21, group.N21, 1);
 
 	    rx = fabs(e1 - points->e1[n]);
 	    ry = fabs(n1 - points->n1[n]);



More information about the grass-commit mailing list