## 4 Photogrammetric Reconstruction with the UWB Positioning System
Let \(R_{rover2 cam}\), \(t_{rover2 cam}\) be the rotation matrix and translation vector corresponding to the transformation from the rover to the camera reference frame, then measurement vectors in the camera reference frame are obtained by applying the corresponding transformation to \(g_{rover,i}\) and \(m_{rover,i}\):  
\[ \begin{array}{cc}g_{rover,i}&\xrightarrow[R_{rew2 cam}]{}&g_{cam,i}\\ m_{rover,i}&\xrightarrow[R_{rew2 cam}]{}&m_{cam,i}\end{array}  \tag{3}\]  
Let \(R_{cam,i}\), \(t_{cam,i}\) be the rotation matrix and translation vector corresponding to the \(i\)-th camera position and orientation in the photogrammetric reconstruction computed by PhotoScan, then:  
\[ \begin{array}{cc}g_{cam,i}&\xrightarrow[R_{cam,i}]{}&g_{photo,i}\\ m_{cam,i}&\xrightarrow[R_{cam,i}]{}&m_{photo,i}\end{array}  \tag{4}\]  
Finally, the rotation \(R_{photo2 uwb}\) of the previously estimated transformation from \(\Sigma_{photo}\) to \(\Sigma_{uwb}\) is applied to \(g_{photo,i}\) and \(m_{photo,i}\):  
\[ \begin{array}{cc}g_{photo,i}&\xrightarrow[R_{photo2 uwb}]{}&g_{uwb,i}\\ m_{photo,i}&\xrightarrow[R_{photo2 uwb}]{}&m_{uwb,i}\end{array}  \tag{5}\]  
The obtained \(g_{uwb,i}\) and \(m_{uwb,i}\) are in the UWB reference system \(\Sigma_{uwb}\). Being that the rover is firmly held during camera acquisitions, the (unnormalized) estimate of the vertical direction \(g_{vert}\) is obtained by averaging accelerometer measurements in the \(\Sigma_{uwb}\) reference system:  
\[g_{vert}=\sum_{i=1}^{507}\frac{g_{uwb,i}}{507} \tag{6}\]After normalization of \(g_{vert}\), then the north direction is estimated by averaging the projections of magnetometer measurements (in the \(\Sigma_{uvvb}\) coordinate system) on the plane orthogonal to the vertical direction. Let \(\Pi_{\perp g}\) be the projection matrix to such a plane, then:  
\[north=\sum_{i=1}^{507}\frac{\Pi_{\perp g}m_{uvb,i}}{507} \tag{7}\]  
To conclude, the \(north\) vector is normalized, and the 3D model is rotated according to the estimated north-vertical directions. Clearly, since the median is a more robust estimator with respect to the mean, it shall be considered in (6) and (7), in particular when the number of images is relatively low. Table 4 reports the results obtained comparing photogrammetric and TLS reconstructions. To be more specific, the following cases are considered:  
1. Relative error case: obtained registering the two point clouds by using the ICP algorithm. UWB anchor positions were estimated through the self-positioning procedure. 2. As in (A), but discarding the final part of the left wing of the bastion. 3. Relative error case: similarly to A, but with the optimal scale (experimentally set) of the photogrammetric reconstruction being used: this case should provide results on the relative error case similar to the use of ground CPs. 4. As in (C), but discarding the final part of the left wing of the bastion. 5. Absolute error case: obtained with UWB anchor positions estimated through the self-positioning procedure. For comparison, results obtained by using anchor positions (in local coordinates) surveyed with Leica TCR 702 Total Station are considered, as well:  
1. Similar to Case (A), but with surveyed anchor positions. 2. Similar to Case (E), but with surveyed anchor positions. Error map and distribution for Case (A) are shown in Figure 7. For comparison, the error map and distribution for Case (C) are shown in Figure 8. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Average Error (cm)** & **RMS (cm)** & **Max Error (cm)** \\ \hline (A) relative error & 3.6 & 6.1 & 115.9 \\ (B) relative error without left wing & 3.1 & 4.9 & 79.7 \\ (C) relative error + opt.scale & 2.2 & 5.9 & 120.9 \\ (D) relative error + opt.scale without left wing & 1.9 & 4.7 & 90.8 \\ (E) absolute error & 42.0 & 50.3 & 134.9 \\ (F) relative error + surveyed anchor positions & 6.6 & 9.7 & 114.0 \\ (G) absolute error + surveyed anchor positions & 23.7 & 30.7 & 109.2 \\ \hline \hline \end{tabular}
\end{table}