- Full paper
- Open Access
- Published:

# Analytical algorithm of weighted 3D datum transformation using the constraint of orthonormal matrix

*Earth, Planets and Space*
**volume 67**, Article number: 105 (2015)

## Abstract

Based on the Lagrangian extremum law with the constraint that rotation matrix is an orthonormal matrix, the paper presents a new analytical algorithm of weighted 3D datum transformation. It is a stepwise algorithm. Firstly, the rotation matrix is computed using eigenvalue-eigenvector decomposition. Then, the scale parameter is computed with computed rotation matrix. Lastly, the translation parameters are computed with computed rotation matrix and scale parameter. The paper investigates the stability of the presented algorithm in the cases that the common points are distributed in 3D, 2D, and 1D spaces including the approximate 2D and 1D spaces, and gives the corresponding modified formula of rotation matrix. The comparison of the presented algorithm and classic Procrustes algorithm is investigated, and an improved Procrustes algorithm is presented since that the classic Procrustes algorithm may yield a reflection rather than a rotation in the cases that the common points are distributed in 2D space. A simulative numerical case and a practical case are illustrated.

## Background

Three-dimensional datum transformation is a frequently used work in geodesy, engineering surveying, photogrammetry, mapping, geographical information science (GIS), machine vision, etc., e.g., Aktuğ (2009), Akyilmaz (2007), El-Mowafy et al (2009), Ge et al (2013), Han and Van Gelder (2006), Horn (1986), Kashani (2006), Neitzel (2010), Paláncz et al (2013), Soler (1998), Soler and Snay (2004), Soycan and Soycan (2008), Zeng (2014). Usually, in order to compute the transformed coordinate, the transformation parameters in the transformation model (e.g., seven-parameter similarity transformation, see Aktuğ 2012, Leick 2004, Leick and van Gelder 1975,) need to be solved with several control points in advance. So far, a large number of algorithms for recovering the parameters have been presented, which can be divided into two classes. One is the numerical iterative algorithm, and the other one is analytical algorithm. The former needs the initial parameter values, linearization, and iterative computation, e.g., Zeng and Tao (2003), Chen et al. (2004), Zeng and Huang (2008), El-Habiby et al. (2009), Zeng and Yi (2011), etc. In the case that the rotation angle is large, the initial values are difficult even never to be obtained in advance, and consequently, it leads to the failure of solution (see Zeng and Yi 2011). We should note that if global optimization algorithms are used, then no initial values are required (see, e.g., Xu 2003a, Xu 2003b, Xu 2002). In contrast, the latter does not involve the initial parameter values, linearization, and iterative computation, and can give the exact solution quickly. However, because of the complexity of mathematical derivation, only several analytical algorithms have been put forward. Grafarend and Awange (2003) presented the Procrustes algorithm which utilized the singular value decomposition technique. Shen et al. (2006) presented a quaternion-based algorithm which utilized the quaternion property and eigenvalue-eigenvector decomposition. Han (2010) presented a stepwise approach to individually calculate the transformation parameters by the physical interpretation of similarity transformation. Zeng and Yi (2010) presented a new analytical algorithm based on the good properties of Rodrigues matrix and Gibbs vector.

The present study is organized as follows. In the Methods section, a new analytical algorithm to weighted 3D datum transformation is derived in detail, based on the Lagrangian extremum law with the constraint that the rotation matrix is an orthonormal matrix. In the meanwhile, its stability is discussed when the distribution of 3D control points degenerates into 2D (planar) or even 1D (collinear). The presented algorithm and classic Procrustes algorithm are compared, and an improved Procrustes algorithm is presented since that the classic Procrustes algorithm may yield a reflection rather than a rotation in the cases that the common points are distributed in 2D space. In the Results and discussion section, a simulative numerical case and a practical case are given to demonstrate the presented algorithm, classic Procrustes algorithm, and improved Procrustes algorithm. Lastly, conclusions are made in the Conclusions section.

## Methods

### Presentation of the basic algorithm

The seven-parameter similarity transformation model can be expressed as

subject to

where \( {a}_i={\left[\begin{array}{ccc}\hfill {X}_i\hfill & \hfill {Y}_i\hfill & \hfill {Z}_i\hfill \end{array}\right]}^{\mathrm{T}} \) and \( {b}_i={\left[\begin{array}{ccc}\hfill {x}_i\hfill & \hfill {y}_i\hfill & \hfill {z}_i\hfill \end{array}\right]}^{\mathrm{T}} \)
*i* = 1, 2, ⋯, *n* are the 3D coordinates of a common point in target and source coordinate systems of transformation, tagged as system A and system B, respectively. Superscript T stands for transpose, *I*
_{3} denotes a 3 × 3 identity matrix, and det means computing the determinant of matrix. *λ* denotes the scale parameter, \( t={\left[\begin{array}{ccc}\hfill \Delta X\hfill & \hfill \Delta Y\hfill & \hfill \Delta Z\hfill \end{array}\right]}^{\mathrm{T}} \) denotes the three translation parameters, and *R* denotes the 3 × 3 rotation matrix, which contains the three rotation angles. Supposing *R* is formed by rotating angles *α*, *β*, and *γ* counterclockwise around the Cartesian *X*, *Y*, and *Z* axes, respectively, then *R* can be expressed by rotation angles as

Using (3), the rotation angles *α*, *β*, and *γ* can be computed if *R* is recovered as

where *R*
_{
ij
} is the element of *R* in the *i*th row and *j*th column.

Introducing the following matrix form of the coordinates as

then Eq. (1) is rewritten as

where \( {\mathbf{1}}_n=\underset{n}{\underbrace{\left[\begin{array}{ccc}\hfill 1\hfill & \hfill \cdots \hfill & \hfill 1\hfill \end{array}\right]}} \), i.e., a row vector with *n* elements and all elements are 1. It is obvious that in order to determine the seven parameters, the number *n* of common points must be greater than or equal to 3.

Considering the coordinates include errors, Eq. (7) is transformed as

where *E* is the transformation error matrix. The criterion of the least squares can be constructed by the Lagrangian extremum law with the constraint of Eq. (2), i.e., orthonormal matrix as follows. It is worthy of note that the constraint det(*R*) = + 1 is not imposed, since it can be separately treated at some extra computation as in the Stability of the basic algorithm and its modification section.

where tr denotes trace operation of matrix, Λ is a symmetric Lagrangian multiplier matrix, and *P* represents the weight matrix that every point has an isotropic weight and is independent of each other. Substituting the expression of *E* easily obtained from Eq. (7) into Eq. (8), one can obtain

If and only if the following conditions are satisfied, the Lagrangian extremum exists.

By Eqs. (9) and (10), one gets

and thus,

Obviously, *t* is the function form of *λ* and *R*.

Substituting Eq. (16) into Eq. (7), one gets

where *I*
_{
n
} − (**1**
_{
n
}
*P*
**1**
_{
n
}
^{T})^{− 1}
*P*
**1**
_{
n
}
^{T}
**1**
_{
n
} is the centering matrix. Let Δ*A* = *A*(*I*
_{
n
} − (**1**
_{
n
}
*P*
**1**
_{
n
}
^{T})^{− 1}
*P*
**1**
_{
n
}
^{T}
**1**
_{
n
}), Δ*B* = *B*(*I*
_{
n
} − (**1**
_{
n
}
*P*
**1**
_{
n
}
^{T})^{− 1}
*P*
**1**
_{
n
}
^{T}
**1**
_{
n
}), and thus, they are the centralized coordinate matrix, and then, Eq. (17) is written as

Substituting Eq. (18) into Eq. (8), one gets

Derivation of Eq. (19) makes use of the properties of trace operation, i.e.,

Substituting Eq. (19) into Eq. (11), one gets

Obviously, *λ* is the function form of *R*.

Substituting Eq. (19) into Eq. (12), one gets

and thus,

Substituting Eq. (19) into Eq. (13), one gets the following equation and the derivation process is given in the Appendix.

further substituting Eq. (24) into Eq. (25), one gets

so

and substituting Eq. (27) into Eq. (24), one gets

Let

then Eq. (28) can be rewritten as

Note that *D*
^{T}
*D* is symmetric, non-negative definitive and so has non-negative real eigenvalues. The inverse of the square root of *D*
^{T}
*D* can thus be computed using eigenvalue-eigenvector decomposition.

where *d*
_{
i
} and *v*
_{
i
} for *i* = 1, 2, 3 are the eigenvalues and corresponding eigenvectors of the matrix *D*
^{T}
*D*. So, Eq. (30) can be written as

### Stability of the basic algorithm and its modification

Obviously, the construction of the inverse of the square root of *D*
^{T}
*D*
_{,} i.e., Eq. (31), fails if one or two of *d*
_{
i
} for *i* = 1, 2, 3 equals to 0. Assume that the eigenvalues of the matrix *D*
^{T}
*D* satisfies the following condition.

When the common points are distributed in a plane, i.e., 2D space, the matrix *D*
^{T}
*D* is singular and of rank 2, and thus,

One can compute the rotation matrix as follows.

where the sign ± is chosen so that det(*R*) = + 1 is satisfied.

The above case is the ideal one, but in the case that the common points are distributed in an approximate plane, although

and the order of magnitude of *d*
_{
i
} for *i* = 1, 2, 3 differs greatly from each other. In other words, the matrix *D*
^{T}
*D* is approximately singular, and the condition number of matrix *D*
^{T}
*D* is very big (usually the threshold is set to 100). The Eq. (31) is ill-conditioned and leads to a biased solution. At this time, one can also obtain the exact solution by Eqs. (35)–(37).

When the common points are distributed in a line, i.e., 1D space, the matrix *D*
^{T}
*D* is singular and of rank 1, and thus,

The rotation matrix is impossible to recover in a whole; however, one can recover at most two rotation angles by the following formula.

and the utilization of Eq. (40) make it feasible to compute the translation parameter and scale parameter.

The above case is the ideal one, but in the case that the common points are distributed in an approximate line, although

and the order of magnitude of *d*
_{
i
} for *i* = 2, 3 differs greatly from each other (e.g., *d*
_{3} > 100*d*
_{2}). The computation by Eqs. (35)–(37) is biased, and no exact solution can be found like the case that the common points are distributed in a line space. At this time, one can carry out the computation by Eq. (40).

### Comparison to classic Procrustes algorithm and improvement of the classic Procrustes algorithm

The classic Procrustes algorithm presented by Grafarend and Awange (2003) is a well-known analytical algorithm of 3D datum transformation. It is also based on the Lagrangian extremum law, similarly to the presented algorithm in this paper. But differently, it does not constrain the orthonormal matrix condition. For the Procrustes algorithm, due to utilization of the singular value decomposition technique, the computed rotation matrix always satisfies the constraint condition *R*
^{T}
*R* = *I*
_{3}; however, in the cases that the common points are distributed in a rigid or approximate plane, this situation that det(*R*) = − 1 rather than det(*R*) = + 1 usually happens. This means the computed *R* is a reflection instead of a rotation. For the presented algorithm in this paper, the constraint condition *R*
^{T}
*R* = *I*
_{3} is imposed in the computation, and thus, it is always satisfied. And in the cases that the common points are distributed in a rigid or approximate plane, the sign ± in Eq. (36) is properly chosen so that det(*R*) = + 1 is satisfied.

To recover the exact rotation matrix by Procrustes algorithm when det(*R*) = − 1, the computation formula of *R*, i.e., Eq. (22) in Grafarend and Awange (2003) should be improved as

where \( \tilde{V}=\left[\begin{array}{ccc}\hfill {V}_1\hfill & \hfill {V}_2\hfill & \hfill -{V}_3\hfill \end{array}\right] \), *V*
_{1}, *V*
_{2}, and *V*
_{3} are the column matrix of *V*, and *V*
_{3} is the column matrix that corresponds to the singular value that is 0.

Therefore, the general improved computation formula of *R*, i.e., Eq. (22) in Grafarend and Awange (2003) is

which is stable for the cases that the common points are distributed in 3D and 2D spaces including approximate 2D space. In the case that the common points are distributed in 1D space, Eq. (43) can recover at most two rotation angles and be used to compute the translation parameter and scale parameter.

## Results and discussion

### Simulative case

The case data is simulated as follows. In order to investigate the stability performance of the presented algorithm (PA) in this paper, the classic Procrustes algorithm (CPA) and improved Procrustes algorithm (IPA) in the cases that the control points are distributed in 3D, 2D, and 1D spaces, six sets of control point in system B is first given in Table 1, of which set 1 is distributed in 3D space, sets 2, 3, and 4 are distributed in 2D space, and sets 5 and 6 are distributed in 1D space. The distribution of six sets of control point is depicted intuitively in Fig. 1. Set 2 has only three control points, and it is necessary for the least point number to solve the seven parameters. Secondly, the theoretical seven parameters are given in Table 2. For the sake of an efficient test of the algorithms, the rotation angles are designed to be big angles. Thirdly, the coordinates of control points in system A are computed by Eq. (1), and the result is listed in Table 3. In this case, the stability of the three algorithms is focused, so the weight matrix is designated to identity matrix for easy demonstration.

Next, the transformation seven parameters are recovered by the three algorithms, and the result is listed in Table 4. ME in Table 4 is the mean error and computed by

It is seen from Table 4 that the results of seven parameters are identical and accurate for the three algorithms in the case of set 1, i.e., the case that the control points are distributed in 3D space. For the cases that the control points are distributed in 2D space, PA and IPA have the identical and accurate results of seven parameters, but CPA has one correct result of seven parameters for set 4 and two wrong results of rotation angles for sets 2 and 3, because reflections rather than rotations are found, and all translation and scale parameters are correct. For the cases that the control points are distributed in 1D space, i.e., sets 5 and 6, the three algorithms all recover the correct translation and scale parameters and at most recover two rotation angles. The number of solvable transformation parameters for the three algorithms is counted and listed in Table 5.

### Actual case

The case data is from Grafarend and Awange (2003). The coordinates of control points in system B (local system) and A (WGS-84 system) is listed in Table 6. The distribution of seven control points in local system is depicted in Fig. 2. From this figure, it is seen that the distribution of control points are in an approximate plane. In the process of PA computation, condition number of matrix *D*
^{T}
*D* is 2.5 × 10^{11}, so Eq. (32) is seriously ill-conditioned and yields a biased solution if not processed. When the weight matrix is an identity matrix, the computed results of seven parameters with PA and CPA are listed in Table 7. For the situation that the weight matrix is a point-wise matrix, i.e., every point has isotropic weight and is independent of each other, the point-wise matrix is generated by the way introduced in Grafarend and Awange (2003) and is listed in Table 8. The computed results of seven parameters with PA and CPA are listed in Table 9.

It is seen from Tables 7 and 9 that the results of PA and CPA are identical if the bias caused by decimal rounding is ignored. Hence, the PA is comparable with CPA.

## Conclusions

The numerical case study shows that the presented new algorithm and improved Procrustes algorithm are both stable and reliable for the cases that the control points are distributed in 3D, and 2D including approximate 2D space, and can recover at most two angles as well as all translation and scale parameters for the cases that the control points are distributed in 1D space. The classic Procrustes algorithm also can compute all translation and scale parameters for all the cases that the control points are distributed in 3D, 2D, and 1D spaces; however, it may yield a reflection rather than a rotation in the cases that the common points are distributed in 2D space. The numerical case study also shows the presented algorithm in this paper, and improved Procrustes algorithm is both stable and reliable when the rotation angles are big. And the presented algorithm in this paper is comparable with the classic Procrustes algorithm when the point-wise weight matrix is involved.

## References

Aktuğ B (2009) Inverse and compound datum/frame transformations. J Surv Eng 135(2):46–55

Aktuğ B (2012) Weakly multicollinear datum transformations. J Surv Eng 138(4):184–192

Akyilmaz O (2007) Total least squares solution of coordinate transformation. Surv Rev 39(303):68–80

Chen Y, Shen YZ, Liu DJ (2004) A simplified model of three dimensional-datum transformation adapted to big rotation angle. Geomat Info Sci Wuhan Uni 29(12):1101–1105

El-Habiby MM, Gao Y, Sideris MG (2009) Comparison and analysis of non-linear least squares methods for 3-D coordinates transformation. Surv Rev 41(311):26–43

El-Mowafy A, Fashir H, Al-Marzooqi Y (2009) Improved coordinate transformation in Dubai using a new interpolation approach of coordinate differences. Surv Rev 41(311):71–85

Ge Y, Yuan Y, Jia N (2013) More efficient methods among commonly used robust estimation methods for GPS coordinate transformation. Surv Rev 45(330):229–234

Grafarend EW, Awange JL (2003) Nonlinear analysis of the three-dimensional datum transformation [conformal group C7(3)]. J Geod 77:66–76

Han JY, Van Gelder HWB (2006) Step-wise parameter estimations in a time-variant similarity transformation. J Surv Eng 132(4):141–148

Han JY (2010) Noniterative approach for solving the indirect problems of linear reference frame transformations. J Surv Eng 136(4):150–156

Horn BKP (1986) Robot vision. MIT Press, Cambridge, Massachusetts and McGraw-Hill, New York

Kashani I (2006) Application of generalized approach to datum transformation between local classical and satellite-based geodetic networks. Surv Rev 38(299):412–422

Leick A (2004) GPS satellite surveying, 3d/Ed. Wiley, Hoboken

Leick A, van Gelder BHW (1975) On similarity transformations and geodetic network distortions based on Doppler satellite observations. Rep. No. 235. Dept. of Geodetic Science, Ohio State Univ, Columbus, Ohio

Neitzel F (2010) Generalization of total least-squares on example of weighted 2D similarity transformation. J Geod 84(12):751–762. doi:10.1007/s00190-010-0408-0

Paláncz B, Awange JL, Völgyesi L (2013) Pareto optimality solution of the Gauss-Helmert model. Acta Geod Geophys 48:293–304

Shen YZ, Chen Y, Zheng DH (2006) A quaternion-based geodetic datum transformation algorithm. J Geod 80:233–239

Soler T (1998) A compendium of transformation formulas useful in GPS work. J Geodyn 72(7–8):482–490

Soler T, Snay RA (2004) Transforming positions and velocities between the International Terrestrial Reference Frame of 2000 and North American Datum of 1983. J Surv Eng 130(2):49–55

Soycan M, Soycan A (2008) Transformation of 3D GPS Cartesian coordinates to ED50 using polynomial fitting by robust re-weighting technique. Surv Rev 40(308):142–155

Xu PL (2002) A hybrid global optimization method: the one-dimensional case. J Comput Appl Math 147:301–314

Xu PL (2003a) A hybrid global optimization method: the multi-dimensional case. J Comput Appl Math 155:423–446

Xu PL (2003b) Numerical solution for bounding feasible point sets. J Comput Appl Math 156:201–219

Zeng HE (2014) Planar coordinate transformation and its parameter estimation in the complex number field. Acta Geod Geophys 49(1):79–94

Zeng HE, Huang SX (2008) A kind of direct search method adopted to solve 3D coordinate transformation parameters. Geomat Info Sci Wuhan Uni 33(11):1118–1121

Zeng HE, Yi QL (2010) A new analytical solution of nonlinear geodetic datum transformation. In: Proceedings of the 18th International Conference on Geoinformatics

Zeng HE, Yi QL (2011) Quaternion-based iterative solution of three-dimensional coordinate transformation problem. J of Computers 6(7):1361–1368

Zeng WX, Tao BZ (2003) Non-linear adjustment model of three-dimensional coordinate transformation. Geomat Info Sci Wuhan Uni 28(5):566–568

## Acknowledgments

The study is supported by the Open Foundation of Hubei Key Laboratory of Construction and Management in Hydropower Engineering, China Three Gorges University (Grant No. 2014KSD13), the National Natural Science Foundation of China (Grant No. 41104009), the Open Research Fund Program of the Key Laboratory of Geospace Environment and Geodesy, Ministry of Education, China (Grant No. 11-01-04), and the 2015 Open Foundation of the Key Laboratory of Precise Engineering and Industry Surveying, National Administration of Surveying, Mapping, and Geoinformation of China. The author is grateful for the support and good working atmosphere provided by his research team in China Three Gorges University. Last but not the least, the author’s special thanks are given to Dr. Koji Matsumoto and two anonymous reviewers for their valuable comments and suggestions, which enhance the quality of this manuscript.

## Author information

## Additional information

### Competing interests

The author declares that he has no competing interests.

## Appendix

### Appendix

Let

then *Κ* is a symmetric matrix. Since that *Λ* is a symmetric Lagrangian multiplier matrix, Λ and *Κ* can be described as follows.

By Eqs. (19) and (13), one gets

and then,

Further,

So,

## Rights and permissions

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0), which permits use, duplication, adaptation, distribution, and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

## About this article

### Cite this article

Zeng, H. Analytical algorithm of weighted 3D datum transformation using the constraint of orthonormal matrix.
*Earth Planet Sp* **67, **105 (2015). https://doi.org/10.1186/s40623-015-0263-6

Received:

Accepted:

Published:

### Keywords

- Weighted 3D datum transformation
- Analytical algorithm
- Lagrangian extremum
- Constraint of orthonormal matrix
- Procrustes algorithm