# Pose Estimation Utilizing a Gated Recurrent Unit Network for Visual Localization
## 2 System Overview
### Effect of Cornering on VO  
Coordinate system and rotation of the camera around each axis are shown in Figure 3. In the VO, rotation around the y-axis (yaw) is the main component of rotation of robot and vehicle. Rotation of the camera in the x-z plane (yaw) result in large amount of change in the scene of the camera. It leads to tracking failure by changing the light source and causes large pixel change in the image. These are dramatically related to increasing photometric error and reprojection error. That is the main reason why increasing the accuracy of VO when the camera rotates in the x-z plane is crucial.  
Figure 3: Camera coordinate system.  
In the 2D-to-2D VO (i.e., [PERSON]'s 5 point-based MVO) called MVO described in Algorithm 1, pitch angle (\(\theta\)), yaw angle (\(\psi\)), and roll angle (\(\phi\)) are obtained as follows  
\[\theta,\,\psi,\,\phi=\begin{cases}\theta=atan2(R_{32},R_{33})\\ \psi=atan2\big{(}-R_{31},\,\sqrt{R_{11}R_{11}+R_{21}R_{21}}\big{)}&if\,\parallel R ^{T}R\parallel>k\\ \phi=atan2(R_{21},R_{11})\\ \theta=atan2(-R_{23},R_{22})\\ \psi=atan2\big{(}-R_{31},\,\sqrt{R_{11}R_{11}+R_{21}R_{21}}\big{)}&\text{ otherwise}\\ \phi=0\end{cases} \tag{7}\]  
where \(R=\left(\begin{array}{ccc}R_{11}&R_{12}&R_{13}\\ R_{21}&R_{22}&R_{23}\\ R_{31}&R_{32}&R_{33}\end{array}\right)\) and \(atan2(\cdot)\) is a function that returns arctangent value according to IEEE standard 754. The threshold \(k\) is set to \(10^{-6}\). To obtain Figure 4 representing the tendency of change in the yaw angle and the cumulative error of yaw angle, the absolute value of \(\psi\), which corresponds to each pair of the images, is calculated. Then, the error \(e\) is computed as follows  
\[e=\sqrt{\left(\psi_{\text{GT}}-\psi_{MVO}\right)^{2}} \tag{8}\]  
where \(\psi_{\text{GT}}\) and \(\psi_{MVO}\) are the yaw angles obtained with ground truth (GT) and MVO, respectively.  
Figure 4: Accumulated yaw angle error and yaw angles of ground truth (GT) and camera calculated by Monocular Visual Odometry (MVO) with KITTI 06, 08, and 09 sequences. (**a**) The KITTI sequence 06. (**b**) The KITTI sequence 08. (**c**) The KITTI sequence 09. The left y-axis is for the yaw angle and the right y-axis is for the accumulated yaw angle error.  
When the camera is rotated, the variation of the yaw angle calculated through the pair of images seems to be a bell shape that gradually increases and then decreases. In Figure 4, the starting point of increasing yaw angle is shown when the camera enters the cornering section (turn-in). The highest value of the yaw angle is shown when the camera is in the middle of the cornering section (mid-corner). Decrease of yaw angle is shown when the camera escapes from the cornering section (exit). The turn-in, mid-corner, and exit involved in a cornering section are shown in Figure 5. The accumulated error of the yaw angle is figured out to be rapidly increasing when the camera rotates and steadily increasing when sequence continues as shown in Figure 4. Note that the rotation is used for the calculation of \(R_{traj}\) in Equation (5), and it is also used for calculation of \(t_{traj}\) in Equation (6). Therefore, the method of increasing the accuracy in the cornering section can significantly improve the performance of VO.