# A Fast and Simple Method for Absolute Orientation Estimation Using a Single Vanishing Point
## 2 Materials and Methods
### Vanishing Point and Method Statement  
The geometrical drawing of this paper is illustrated in Figure 1. The direction vector of a 3D line \(L_{1}\) in the camera frame \(Oc\_XcYcZc\) is denoted as \(d= \begin{pmatrix}d_{x}&d_{y}&d_{z}\end{pmatrix} \) and a point \(P_{1} \begin{pmatrix}p_{1x}&p_{1y}&p_{1z}\end{pmatrix} \) is on this line. From Figure 1, the 3D line \(L_{1}\) can be written as follows:  
\[L_{1}=P_{1}+k_{1}\cdot d \tag{1}\]  
Here, \(k_{1}\) is the arbitrary scale value. Similarly, another 3D line \(L_{2}\) that is parallel to, \(L_{1}\), in the camera frame can be denoted as \(L_{2}=P_{2}+k_{2}\cdot d\). \(k_{2}\) is an arbitrary scale value and \(P_{2} \begin{pmatrix}p_{2x}&p_{2y}&p_{2z}\end{pmatrix} \) is a 3D point on line \(L_{2}\). According to the standard pinhole camera model, the image projection \(l_{1}\) of the 3D line \(L_{1}\) can be written as follows:  
\[ \begin{split} u_{1}&=f\frac{X_{c}}{Z_{c}}=f\frac{p_{1x}+k_{1} \cdot d_{z}}{p_{1x}+k_{1}\cdot d_{z}}\\ v_{1}&=f\frac{Y_{c}}{Z_{c}}=f\frac{p_{1y}+k_{1}\cdot d_{y}}{p_{1x}+k_{1} \cdot d_{z}}\end{split}  \tag{2}\]  
Figure 1: The geometrical drawing of this paper. \(L_{1}//L_{2}\) and their image projections intersect at the vanishing point. Here,\(f\) is the focal length, which can be either known or unknown in this paper. When \(k_{1}\rightarrow\infty\) and \(d_{z}\) is not zero, the image projection of line \(L_{1}\) can be denoted as follows:  
\[ \begin{split} u_{1\infty}&=\lim_{k_{1}\to \infty}f\frac{p_{1x}+k_{1}\cdot d_{x}}{p_{1x}+k_{1}\cdot d_{z}}=\frac{d_{x}}{d_ {z}}\\ v_{1\infty}&=\lim_{k_{1}\to \infty}f\frac{p_{1y}+k_{1}\cdot d_{y}}{p_{1x}+k_{1}\cdot d_{z}}=\frac{d_{y}}{d _{z}}\end{split}  \tag{3}\]  
Similarly, the image projection \(l_{2}\) of line \(L_{2}\) can be denoted as follows:  
\[ \begin{split} u_{2\infty}&=\lim_{k_{2}\to \infty}f\frac{p_{2x}+k_{2}\cdot d_{x}}{p_{2x}+k_{2}\cdot d_{z}}=\frac{d_{x}}{d _{z}}\\ v_{2\infty}&=\lim_{k_{2}\to\infty}f\frac{p_{2x}+k_{2} \cdot d_{y}}{p_{2x}+k_{2}\cdot d_{z}}=\frac{d_{y}}{d_{z}}\end{split}  \tag{4}\]  
It can be seen that the image projections of the 3D line \(L_{1}\), \(L_{2}\), in camera frame intersects at the same point, which is called the vanishing point. \[ \begin{split} u_{vp}&=\frac{d_{x}}{d_{z}}\\ v_{vp}&=\frac{d_{y}}{d_{z}}\end{split}  \tag{5}\]  
The image projections of \(l_{1}\) and \(l_{2}\) can be extracted and thus the corresponding vanishing point \(\big{(}u_{vp}\quad v_{vp}\big{)}\) is known. Consequently, the direction vector of the parallel lines of \(L_{1}\) and \(L_{2}\) can be found from Equation (5) using  
\[d=\big{(}d_{x}\quad d_{y}\quad d_{z}\big{)}=d_{z}\cdot\big{(}u_{vp}\quad v_{ vp}\quad 1\big{)} \tag{6}\]  
Hence, the unit direction vector \(d_{c}\) of the parallel lines of \(L_{1}\) and \(L_{2}\) in the camera frame is obtained using  
\[d_{c}=\big{(}d_{cx}\quad d_{cy}\quad d_{cz}\big{)}=\frac{1}{\sqrt{u_{vp}^{2}+ v_{vp}^{2}+1}}\big{(}u_{vp}\quad v_{vp}\quad 1\big{)} \tag{7}\]  
It can be seen that the unit direction vector of the parallel lines in the camera frame can be obtained through the corresponding vanishing point. Then, the unit direction vector \(d_{w}\) of the parallel lines of \(L_{1}\) and \(L_{2}\) in the world frame can be given according the rotation between the world frame and the camera frame, as follows. \[d_{w}= \begin{bmatrix}d_{wx}\\ d_{wy}\\ d_{wz}\end{bmatrix} =R_{c\_w}\cdot \begin{bmatrix}d_{cx}\\ d_{cy}\\ d_{cz}\end{bmatrix}  \tag{8}\]  
Here, \(R_{c\_w}\) is the rotation matrix that contains the information of three rotational angles \(\big{(}a_{x}\quad a_{y}\quad a_{z}\big{)}\). Because the roll angle is set to zero through the IMU, \(a_{y}=0\) and the other two rotational angles are unknown and need to be estimated in this paper. Then, according to the rigid motion, \(R_{c\_w}\) can be written as  
\[R_{c\_w}= \begin{bmatrix}\cos a_{z}&-\sin a_{z}\cdot\cos a_{x}&\sin a_{z}\sin a _{x}\\ \sin a_{z}&\cos a_{z}\cos a_{x}&-\cos a_{z}\sin a_{x}\\ 0&\sin a_{x}&\cos a_{x}\end{bmatrix}