# A New Monocular Pose Estimation Method for the Coplanar P4P Problem
## 2 Methodology
### To Calculate the Real Coordinates of the Parallelogram's Four Vertices  
(1) Projection relationships of a parallelogram's four vertices  
As shown in Figure 2, a parallelogram's four vertices are \(P_{1}\) to \(P_{4}\), where \(P_{1}P_{2}\|P_{3}P_{4}\), \(|\,P_{1}P_{2}\,|\,=|\,P_{3}P_{4}\,|\,\) and \(P_{1}P_{3}\|P_{2}P_{4}\), \(|\,P_{1}P_{3}\,|\,=|\,P_{2}P_{4}\,|\,\). The camera system \(S\)-\(XYZ\) is taken as a reference system. The image plane is \(I\). The corresponding projections of \(P_{1}\) to \(P_{4}\) are \(p_{1}\) to \(p_{4}\). Figure 1: Examples of parallelogram structures on buildings. In the reference system, the coordinates of \(P_{i}\) are \(\mathbf{M}_{i}=[X_{Si}\ Y_{Si}\ Z_{Si}]^{T}\), where \(i=1\), \(2\), \(3\), \(4\). The image coordinates of the corresponding projections are \(\mathbf{m}_{i}=[u_{i}\ v_{i}]^{T}\). A pin-hole camera model is used. Because the camera system is taken as the reference system, the translation vector \(\mathbf{T_{S}}\) is a zero vector, and the rotation matrix \(\mathbf{R_{S}}\) is an identity matrix. Then, the projection relationships are  
\[\lambda_{i}\widetilde{\mathbf{m}}_{i}=\mathbf{K}\widetilde{\mathbf{M}}_{i} \quad(i=1,2,3,4) \tag{1}\]  
where \(\widetilde{\mathbf{m}}_{i}\) and \(\widetilde{\mathbf{M}}_{i}\) are the augment matrices of \(\mathbf{m}_{i}\) and \(\mathbf{M}_{i}\). \(\lambda_{i}\) is a scale factor. \(\mathbf{K}\) is the camera's known intrinsic matrix. For a parallelogram, the coordinates of the four vertices meet the following relationship. \[\mathbf{M}_{3}-\mathbf{M}_{1}=\mathbf{M}_{4}-\mathbf{M}_{2} \tag{2}\]  
By denoting \(\mathbf{t}=[t_{X}\ t_{Y}\ t_{Z}]^{T}=\mathbf{M}_{3}-\mathbf{M}_{1}=\mathbf{M}_ {4}-\mathbf{M}_{2}\), the projection relationships are  
\[\left\{ \begin{aligned} \lambda_{1}\widetilde{\mathbf{m}}_{1}= \mathbf{K}\widetilde{\mathbf{M}}_{1}\\ \lambda_{2}\widetilde{\mathbf{m}}_{2}=\mathbf{K}\widetilde{\mathbf{M}}_{2 }\\ \lambda_{3}\widetilde{\mathbf{m}}_{3}=\mathbf{K}\Big{(}\widetilde{ \mathbf{M}}_{1}+\widetilde{\mathbf{t}}\Big{)}\\ \lambda_{4}\widetilde{\mathbf{m}}_{4}=\mathbf{K}\Big{(}\widetilde{ \mathbf{M}}_{2}+\widetilde{\mathbf{t}}\Big{)}\end{aligned} \right. \tag{3}\]  
where \(\widetilde{\mathbf{t}}\) is the augment matrix of \(\mathbf{t}\). (2) Solution of the parallelogram vertices' coordinates in the camera system  
Because the object is in front of the camera, the \(Z\) coordinates of the four vertices are positive. Then, eight intermediate variables can be defined as follows. \[\left\{ \begin{aligned} g_{0}=\frac{X_{Si}}{Z_{Si}},g_{1}= \frac{Y_{Si}}{Z_{Si}},g_{2}=\frac{X_{S2}}{Z_{Si}},g_{3}=\frac{Y_{S2}}{Z_{Si}},g _{4}=\frac{Z_{S2}}{Z_{Si}}\\ g_{5}=\frac{Y_{Si}}{Z_{Si}},g_{6}=\frac{Y_{Si}}{Z_{Si}},g_{7}=\frac{Z_{Si }}{Z_{Si}}\end{aligned} \right. \tag{4}\]  
Figure 2: A parallelogram’s four vertices and their corresponding projections. The scale factor \(\lambda_{i}\) can be eliminated from Equation (3) and the equations can be expressed as  
\[\left\{ \begin{array}{rcl}(u_{1}-u_{0})&=&\text{$sg_{0}+\gamma g_{1}$}\\ (v_{1}-v_{0})&=&\beta g_{1}\\ (u_{2}-u_{0})g_{4}&=&\text{$sg_{2}+\gamma g_{3}$}\\ (v_{2}-v_{0})g_{4}&=&\beta g_{3}\\ (u_{3}-u_{0})(1+g_{7})&=&\text{$(g_{0}+g_{5})+\gamma(g_{1}+g_{6})$}\\ (v_{3}-v_{0})(1+g_{7})&=&\beta(g_{1}+g_{6})\\ (u_{4}-u_{0})(g_{4}+g_{7})&=&\text{$(g_{2}+g_{5})+\gamma(g_{3}+g_{6})$}\\ (v_{4}-v_{0})(g_{4}+g_{7})&=&\beta(g_{3}+g_{6})\end{array} \right. \tag{5}\]  
where \(\alpha\), \(\beta\) and \(\gamma\) are constant coefficients combined by the camera's intrinsic parameters. Thus, a set of linear equations of the intermediate variables are obtained. Moreover, the intermediate variables can be obtained analytically. By setting the length of \(P_{1}P_{2}\) to \(L\), the following expression can be obtained based on the definition of the intermediate variables. \[Z_{S1}=L/\sqrt{\left(g_{2}-g_{0}\right)^{2}+\left(g_{3}-g_{1}\right)^{2}+\left( g_{4}-1\right)^{2}} \tag{6}\]  
Then, the coordinates of the four vertices in the camera system are obtained. \[\left\{