# Estimation of Antenna Pose in the Earth Frame Using Camera and IMU Data from Mobile Phones
## 5 Antenna Poses Estimated from Captured Images  
Considering that the scene containing the antenna is static from one viewpoint to another, if we insert a camera calibration object (e.g., a checkerboard) into the scene and employ a suitable extrinsic camera calibration technique (e.g., [53]) or apply a structure-from-motion (SfM) technique (e.g., [55]) to the background, we can obtain the relative poses of the camera corresponding to all viewpoints relative to a visual reference frame, meaning that the task can be formulated as a visual pose estimation problem using data from \(P\) viewpoints. Let the viewing reference frame (\(VF\)) be denoted by \(V\); let the camera frames (CFs) be denoted by \(C_{i},i=1,2,\ldots,P\); and let the relative poses be denoted by \(\big{(}\overset{\mathbb{C}}{V}R_{i^{\prime}}\overset{\mathbb{C}}{V}T_{i} \big{)},i\in 1,2,\ldots,P\). Then, we need to find only the relative pose between \(O\) and \(V\) instead of the original \(3P\) unknowns. This process is expressed as follows:  
\[\sum_{i=1}^{P}g_{1}\big{(}\overset{\mathbb{J}}{C}R_{i}|K,\mathcal{M},\Phi_{i} \big{)}=g_{1}^{\prime}\big{(}\overset{\mathbb{V}}{C}R|K,\mathcal{M},\Phi_{1}, \Phi_{2},\ldots,\Phi_{P}\big{)}, \tag{6}\]  
where \(g_{2}^{\prime}\) describes the error on the visual pose estimation based on images acquired from \(P\) viewpoints.  
To complete our definition of Equation (6), we define \(g_{1}^{\prime}\) as a contour-based distance function between the projections of the 3D antenna model and the antenna foregrounds in the real images:  
\[\underset{\overset{\mathbb{V}}{C}R}{argmin}\sum_{i=1}^{P}d_{C}\Big{(}\Phi_{i} ^{\pi}\big{(}\overset{\mathbb{V}}{C}R_{,}\overset{\mathbb{V}}{C}T\big{)}, \Phi_{i}\Big{)}, \tag{7}\]  
where \(\Phi_{i}^{\pi}\big{(}\overset{\mathbb{V}}{C}R_{,}\overset{\mathbb{V}}{C}T \big{)}\) is the projection contour of the antenna in pose \(\big{(}\overset{\mathbb{V}}{C}R_{,}\overset{\mathbb{V}}{C}T\big{)}\) from the \(i\)-th viewpoint of extrinsic camera parameters of \(\big{(}\overset{\mathbb{C}}{V}R_{i}\overset{\mathbb{C}}{V}T_{i}\big{)}\); and \(d_{C}(\cdot)\) is a contour-based distance function.  
Our approach does not rely on any assumption regarding the form of \(d_{C}\). Without loss of generality, we define \(d_{C}\) based on a point-to-contour distance:  
\[d_{C}\left(\[PERSON]^{\prime},\[PERSON]^{\prime\prime}\right)=\sum_{X\in\[PERSON]^{\prime}}d_ {p}^{c}\left([PERSON],\[PERSON]^{\prime}\right)+\sum_{X\in\[PERSON]^{\prime\prime}}d_{p}^{c} \left([PERSON],\[PERSON]^{\prime\prime}\right),\]  
where \(\[PERSON]^{\prime}\) and \(\[PERSON]^{\prime\prime}\) are the two contours to be matched and \(d_{p}^{c}\) is the operator for calculating the shortest Euclidean distance between a point and all points on a contour:  
\[d_{p}^{c}\left([PERSON],\[PERSON]\right)=\underset{Y\in\Phi}{\min}(|X-Y|^{2}).\]  
Another way to interpret \(d_{p}^{c}\) is to treat it as an embedding function of the level set underlying a contour; for details, we refer the reader to [56]. An efficient algorithm to compute \(d_{p}^{c}\) is given in [57].  
To solve Equation (6), we adopt a coarse-to-fine strategy. First, we exploit the fact that most antennas are approximately cuboid in shape to recover an approximate pose, by aligning the 3D principal axis of the model with the 2D principal axes in the multi-view images and finding a proper rotation around the principal 3D axis. Then, based on this coarsely estimated pose, we construct bounding constraints to be applied to the pose search space, thereby allowing us to seek the optimal pose by using global optimization techniques to minimize Equation (6). An overview of our approach is provided in Figure 7.