<<

Geometric Interpretation of side-sharing and point-sharing solutions in the P3P Problem

Bo Wang Institute of Automation, Chinese Academy of Sciences [email protected] Hao Hu Ming Hsieh Department of Electrical Engineering, University of Southern California [email protected] Caixia Zhang College of Science, North China University of Technology [email protected]

Abstract 1. Introduction

The Perspective-3-Point Problem, or P3P problem, was It is well known that the P3P problem could have 1, 2, first introduced by Grunert [1] in 1841, and popularized in 3 and at most 4 positive solutions under different configu- computer vision community a century later by mainly the rations among its 3 control points and the position of the Fishler and Bolles’ work in 1981 [3]. Since it is the least optical center. Since in any real applications, the knowl- number of points to have a finite number of solutions, it has edge on the exact number of possible solutions is a pre- been widely used in various fields ([8],[9],[10],[11],[16]), requisite for selecting the right one among all the possi- either for its minimal demand in restricted working envi- ble solutions, the study on the phenomenon of multiple so- ronment, such as robotics and aeronautics, or for its com- lutions in the P3P problem has been an active topic . In putational efficiency of robust pose estimation under the this work, we provide some new geometric interpretations random-sampling paradigm, for example, RANSAC-like on the multi-solution phenomenon in the P3P problem, our algorithms. main results include: (1): The necessary and sufficient con- The P3P problem can be defined as: Given the perspec- dition for the P3P problem to have a pair of side-sharing tive projections of three control points with known coordi- solutions is the two optical centers of the solutions both lie nates in the world system and a calibrated camera, deter- on one of the 3 vertical planes to the plane of con- mine the position and orientation of the camera in the world trol points; (2): The necessary and sufficient condition for system. It is shown that [6] the P3P problem could have 1, the P3P problem to have a pair of point-sharing solutions is 2, 3 or at most 4 solutions depending on the configuration arXiv:1902.00105v1 [cs.CV] 29 Jan 2019 the two optical centers of the solutions both lie on one of the between the optical center and its 3 control points. If the 3 so-called skewed danger cylinders;(3): If the P3P prob- optical center and 3 control points happen to be cocyclic, lem has other solutions in addition to a pair of side-sharing the problem becomes degenerated, and an infinitely large ( point-sharing) solutions, these remaining solutions must number of solutions could be possible. be a point-sharing ( side-sharing ) pair. In a sense, the Since in any real applications, a unique solution is al- side-sharing pair and the point-sharing pair are companion ways desirable, and if the multiple solutions are unavoid- pairs. In sum, our results provide some new insights into the able, the knowledge on the exact number of possible solu- nature of the multi-solution phenomenon in the P3P prob- tions is a prerequisite for selecting the right solution from lem, in addition to their academic value, they could also be all the possible ones, the study on the phenomenon of mul- used as some theoretical guidance for practitioners in real tiple solutions in the P3P problem has been an active topic applications to avoid occurrence of multiple solutions by since its very inception. In the literature, the research on properly arranging the control points. the multi-solution phenomenon in the P3P problem can be broadly divided into two directions. The one is so-called the

1 algebraic approach, the other is the geometric approach. For the algebraic approach, it basically boils down in the literature to the analysis of the roots distribution of the re- sulting quartic equation from the 3 original constraints. The related works include ([2],[4],[5],[12],[13],[14],[18],[19]): For example, Gao [4] provided the complete solution set and the probability [5] of having 1, 2, 3 and 4 solutions of the P3P problem; Rieck systematically analyzed solutions around the danger cylinder [12],[14], and proposed a new algorithm for camera pose estimation close to the danger cylinder. Figure 1. P3P problem definition: A, B, C are the 3 control points, For the geometric approach, Zhang and Hu[21] showed O is the optical center. that if the optical center lies on the danger cylinder, the cor- responding P3P problem must have 3 different solutions, is the optical center. Since the camera (under the pinhole and that if the optical center lies on one of the three vertical model) is calibrated, the three subtended α, β, γ of planes to the base plane of control points, the corresponding the projection rays can be computed, hence can be consid- P3P problem must have 4 different solutions [17],[20]. Sun ered as known entities, then by the Law of Cosines, we im- [15] found that when the optical center lies on the two inter- mediately have the following 3 basic constraints on the three secting vertical lines between the danger cylinder and one unknown s1 = |OA|, s2 = |OB|, s3 = |OC| in (1). of the three vertical planes, either the side-sharing pair or  the point-sharing pair of solutions degenerates into a dou- s2 + s2 − 2cosγs s = c2  1 2 1 2 ble solution. However such geometric conclusions do not 2 2 2 s + s − 2cosβs1s3 = b (1) indicate whether besides the danger cylinder or the 3 verti- 1 3 s2 + s2 − 2cosαs s = a2 cal planes, the P3P problem could still have 3 or 4 different 2 3 2 3 solutions if the optical center lies on other places. Hence the P3P problem refers to determine such positive In this work, we push the frontier a step further for the triplets (s1, s2, s3) satisfying the 3 basic constraints in (1). geometrical approach, we not only find the geometrically And the so-called multiple-solution phenomenon in the P3P meaningful sufficient conditions but also necessary condi- problem means for a given P3P problem, more than one tions for the multiple solutions of the P3P problem. To our positive triplets exist which all satisfy the 3 basic constraints knowledge, we are the first to obtain both the necessary and in (1). Clearly, given a positive triplet (or a solution), its sufficient conditions with clear geometrical interpretations optical center location with respect to the 3 control points in the literature. can be uniquely determined. This work is organized as follows: The next section in- Let u = s2/s1, and v = s3/s1, then the three constraints troduces some preliminaries on the P3P problem. The main in (1) can be transformed into the following two conics in results are listed in Section 3: In subsection 3.1, three the- (2) with u and v as variables: orems are related to algebraic and geometric conditions of ( 2 2 2 2 2 2 2 2 a pair of side-sharing solutions;In subsection 3.2, three the- C1 :(a − b )v + 2b cosαuv − b u − 2a cosβv + a = 0 2 2 2 2 2 2 2 2 orems are related to algebraic and geometric conditions of C2 :(a − c )u + 2c cosαuv − c v − 2a cosγu + a = 0 a pair of point-sharing solutions; In subsection 3.3, we pro- (2) pose the relation between the point-sharing and side-sharing Clearly the above two conics can intersect at most 4 points solutions, that is: the side-sharing pair and the point-sharing with positive coordinates, and since each positive intersect- pair are often companion pairs, and followed by some con- ing point can give rise to a positive solution of the P3P prob- clusions in Section 4. lem, the P3P problem can have at most 4 different positive 2. Preliminaries solutions. For the presentational purpose, hereinafter, a so- lution of the P3P problem means a positive solution. As For the notational convenience and a better understand- shown later in the text, these two conics are the charac- ing of our main results in the next section, here we first list teristic conics of the P3P problem, and the configurations some preliminaries on the P3P problem. of their intersecting points directly determine the multi- solution phenomenon in the P3P problem. 2.1. The three basic constraints of the P3P problem and its transformed two conics 2.2. The danger cylinder and the 3 vertical planes As shown in Fig.1, A, B, C are the three control points As shown in Fig.2, the vertical cylinder passing through with known distance a = |BC|, b = |AC|, c = |AB|, O the 3 control points A, B, C is called the danger cylinder. It

2 be expressed either by superposing the 3 control points but with different optical center positions, such as {O, (A, B, C)}, {O0, (A, B, C)}, or equivalently by super- posing the optical centers O and O0, but with different posi- tions of the control points at their respective projection rays, denoted as {O, (A, B, C)}, {O, (A0,B0,C0)}. For conve- nience, we call them as three control points unchanged ex- pression and the optical center unchanged expression. In the following theorems, these two different expressions are in- terchangeably used for the easy representation purpose de- Figure 2. The danger cylinder and three vertical planes. pending on the circumstance. In this work, a pair of side-sharing solutions and a pair of point-sharing solutions are frequently used. As shown in [20], a pair of side-sharing solutions refers to two such solutions that if their optical centers are superposed, they must share two control points or share a common side of the control point triangle. In contrast, a pair of point- sharing solutions refers to two such solutions that if their optical centers are superposed, they must share a single common control point. As shown in Fig.3, {O, (A, B, C)} and {O, (A, B, C0)} are a pair of side-sharing solu- tions with shared side AB, and {O, (A0,B0,C00)} and Figure 3. Side-sharing solutions and point-sharing solutions: 00 00 00 0 {O, (A ,B ,C )} are a pair of point-sharing solutions {O, (A, B, C)} and {O, (A, B, C )} are a side-sharing pair with shared point C00. with AB being the shared side, {O, (A0,B0,C00)} and {O, (A00,B00,C00)} are a point-sharing pair with C00 being the shared point. 3. Main Results In this section, we show that the necessary and sufficient is shown that if the optical center lies on the danger cylinder, condition for the P3P problem to have a pair of side-sharing the solution of the P3P problem is unstable [7]. Zhang [21] solutions is its optical center lies on one of the three ver- showed that if the optical center lies on the danger cylin- tical planes, and the necessary and sufficient condition for der, there are always three different solutions of the P3P the P3P problem to have a pair of point-sharing solutions is problem. Later on, Sun [15] showed that the necessary and its optical center lies on one of the three so-called skewed sufficient condition for the optical center lies on the danger danger cylinders. In addition, we show that given a side- cylinder is the nullness of the determinant of the Jacobian sharing pair (or a point-sharing pair) of solutions, if the P3P of the 3 constraints in (1). In [14] it is shown that the opti- problem still has other solutions, these remaining solutions cal center lying on the danger cylinder is the necessary and must be a pair of point-sharing (or side-sharing) solutions. sufficient condition for the P3P problem to have repeated Before discussing our main results, we would at first solutions. needs the following statements: As shown in Fig.2, AD, BE, CF are the three altitudes of the triangle ABC, the three vertical planes to the base Theorem 1 If the two conics have an intersection (u0, v0) plane of the triangle ABC are the vertical planes going in the quadrant I, then (u0, v0) is corresponding to one so- lution of the P3P problem. through AD, or BE, or CF , denoted as π1 , π2 and π3. In Section 3, we show that when the optical center lies on one of these 3 vertical planes, the corresponding P3P problem Proof Since (u0, v0) lies in the quadrant I, we have u0 > 0, v > 0 and also have must have a pair of side-sharing solutions, and vice versa. 0 2 2 2 2 2 2 2 2 2.3. Side-sharing solutions and point-sharing solu- (a − b )v0 + 2b cosαu0v0 − b u0 − 2a cosβv0 + a = 0 tions (3) 2 2 2 2 2 2 2 2 (a − c )u0 + 2c cosαu0v0 − c v0 − 2a cosγu0 + a = 0 Geometrically, a solution of P3P problem can be com- (4) pletely defined by the 3 control points A, B, C and the optical center position O, denoted as {O, (A, B, C)}. It is obvious that equation (3) and equation (4) are equiva- Given a P3P problem, its two different solutions can lent to the following equations (5) and (6) respectively.

3  a2 b2  2 2 = 2 (5)  u0 + v0 − 2cosαu0v0 1 + v0 − 2cosβv0 a2 c2   2 2 = 2 (6) u0 + v0 − 2cosαu0v0 1 + u0 − 2cosγu0 2 2 Considering the inequality u0 + v0 − 2cosαu0v0 > 0, let s a2 s01 = 2 2 (7) u0 + v0 − 2cosαu0v0 Figure 4. {O, (A, B, C)} and {O, (A0,B,C)} are a side-sharing where in the above double subscript, the first ”0” and the pair of solutions. second ”1” indicate a specific solution and the component of the solution respectively, it is similar in the following notations. Let Theorem 2 Under the optical center unchanged expres- sion, the necessary and sufficient condition for the P3P s02 = u0s01 (8) problem to have a side-sharing pair with a shared side BC s03 = v0s01 (9) is both the corresponding (u1, v1) and (u2, v2) satisfy the equation cosγu − cosβv = 0. It is obvious that s01 > 0, s02 > 0, s03 > 0 and (s01, s02, s03) satisfy the 3 basic constraints in (1). So Proof (Necessity) (s01, s02, s03) is one solution of the P3P problem.  Let (O, ABC) and (O,A0BC) be a side-sharing pair with Lemma 1 The necessary and sufficient condition for the a shared side BC (see Figure 4) . 0 0 P3P problem to have the repeated solutions is that the opti- Then |A B| = |AB|,|A C| = |AC|. Let F be the midpoint 0 cal center lies in the danger cylinder. of the segment AA , then CF ⊥ OA, BF ⊥ OA, Clearly, BC ⊥ OA and The proof of this lemma refers to [12]. ( |OF | = |OB|cosγ Lemma 2 The necessary and sufficient condition for the P3P problem to have the repeated solutions is that the two |OF | = |OC|cosβ conics derived from the P3P problem are tangential in the Let s = |OA|, s = |OB|, s = |OC|, s = |OA0| be quadrant I. 11 2 3 21 the side lengths. We get Proof (Sufficiency) If the two conics derived from the P3P problem are tangential in the quadrant I, then they have s2cosγ = s3cosβ (10) a couple of repeated positive solutions which are (ut, vt) 0 0 Divide each side of Equation (10) by s11 , cosγu1 − and (ut, vt). By Theorem 1, The P3P problem has two 0 0 0 cosβv1 = 0 . solutions (st1, st2, st3) and (st1, st2, st3) corresponding to 0 0 Divide each side of Equation (10) by s21 , cosγu2 − (ut, vt) and (ut, vt) respectively. By Equations (??)–(??), 0 0 0 cosβv = 0 . (s , s , s ) = (s , s , s ), so the P3P problem has the 2 t1 t2 t3 t1 t2 t3 (Sufficiency) Since both (u , v ) and (u , v ) satisfy the repeated solutions. 1 1 2 2 equation cosγu − cosβv = 0, we have (Necessity) If the P3P problem has the repeated solutions 0 0 0 which are (st1, st2, st3) and (st1, st2, st3) , then the corre- ( 0 0 cosγu1 − cosβv1 = 0 sponding (ut, vt) and (ut, vt) are equal and locate in the quadrant I by Equations (8) and (9). This shows that the cosγu2 − cosβv2 = 0 two conics are tangential in the quadrant I.  si2 si3 By definition, ui = , vi = , i = 1, 2. We get si1 si1 3.1. A side-sharing pair and the geometric meaning ( cosγs − cosβs = 0 In this section, we show that three theorems about the 12 13 side-sharing pair: Theorem 2 is the necessary and sufficient cosγs22 − cosβs23 = 0 condition, Theorem 3 is a sufficient condition, Theorem 4 So we have is the geometric meaning that the optical centers of side- s s sharing solutions must lie on one of three vertical planes. 12 = 13 = k > 0 s22 s23

4 Since

2 2 2 s12 + s13 − 2cosαs12s13 = a (11)

Substitute s12 = ks22, s13 = ks23 into Equation (11), we have

2 2 2 2 k (s22 + s23 − 2cosαs22s23) = a Since

2 2 2 Figure 5. To construct another solution which has a shared side s22 + s23 − 2cosαs22s23 = a (12) BC with (O, ABC).

We get k = 1. So s12 = s22, s13 = s23, that is, two so- p p lutions of the P3P problem corresponding to (u1, v1) and |OC| = |OE|2 + |CE|2,|AC| = |AE|2 + |CE|2, (u , v ) are a side-sharing pair with a shared side BC . 2 2  Thus |OC| > |AC| iff |OE| > |AE| . By ∠BAC > α, we have ABC + ACB < OBC + OCB, thus at Theorem 3 Under the optical center unchanged expres- ∠ ∠ ∠ ∠ least one holds of inequalities ABC < OBC < π/2 sion, if (u , v ) satisfy cosγu − cosβv = 0 which corre- ∠ ∠ 1 1 and ACB < OCB < π/2 (corresponding respectively spond to a solution (O, ABC) of the P3P Problem, and ∠ ∠ to three situations, the first is when E lies on the base side α < BAC, then the P3P problem has another solution ∠ BC, the second is when E lies on the extended side BC, which has a shared side BC with (O, ABC) , and the cor- the third is when E lies on the extended side CB ). With- responding (u2, v2) also satisfy cosγu − cosβv = 0. out loss of generality, let ∠ABC < ∠OBC < π/2 , Proof (By construction) since|AE| = |BE| tan ∠ABC,|OE| = |BE| tan ∠OBC, we know |OE| > |AE|. Let s11 = |OA|, s12 = |OB|, s13 = |OC| be the side  lengths corresponding to the solution (O, ABC) . Since Remark 1 cosγu1 − cosβv1 = 0, We get cosγs12 − cosβs13 = 0. Furthermore, 2cosγs12 − s11 = 2cosβs13 − s11. 1.The difference between Theorems 2 and 3 is that Theo- Let s21 = 2cosγs12 − s11 or s21 = 2cosβs13 − s11, then rem 2 gives the necessary and sufficient condition about a side-sharing pair, while Theorem 3 gives how to con- 2 2 s21 + s12 − 2cosγs21s12 struct another solution which has a common side with the 2 2 known specific solution. Moreover, a side-sharing pair with = (2cosγs12 − s11) + s12 − 2cosγ(2cosγs12 − s11)s12 2 2 2 a shared side AB or AC has similar result. = s11 + s12 − 2cosγs11s12 = c 2.α < ∠BAC means that the optical center O lies outside Similarly, the toroid by rotating the arc BAC of circumcircle of the triangle 4ABC around BC . 2 2 s21 + s13 − 2cosβs21s13 2 2 Theorem 4 (The geometric meaning of the side-sharing = (2cosβs13 − s11) + s13 − 2cosβ(2cosβs13 − s11)s13 2 2 2 pair) = s11 + s13 − 2cosβs11s13 = b Under the optical center unchanged expression, if (O, ABC) and (O,A0BC) are a side-sharing pair with a So (s , s , s )satisfy the three constraints of the P3P 21 12 13 shared side BC of the P3P problem, then both the opti- Problem. Thus if s > 0, then (s , s , s ) is another so- 21 21 12 13 cal centers O and O0 of (O, ABC) and (O0, ABC) ,un- lution of the P3P problem which has a shared side BC with der three control points unchanged expression, locate on (s , s , s ) . Thus by Theorem 2, we will conclude that 11 12 13 the vertical plane π , where (O0, ABC) is equivalent to the corresponding (u , v ) also satisfy cosγu − cosβv = 0. 1 2 2 (O,A0BC). Let us next show that when α < ∠BAC , s21 > 0. As shown in Figure 5, Let CF ⊥AO , F be the foot of C on segment OA , then by s21 = 2cosβs13 − s11, we get Proof By the necessity of Theorem 2, we know BC⊥OA . s21 = 2|OF | − |OA| = 2|OF | − (|OF | + |FA|) = As shown in Figure 6, Let OH⊥4ABC, H is the foot. |OF | − |FA|. Thus s21 > 0 iff |OF | > |FA|. Consid- Link A and H, let the intersection of AH and line BC ering CF ⊥AO, |OF | > |FA| iff |OC| > |AC| . Link B is E, then by BC⊥OH and BC⊥OA, BC⊥AE is obvi- and F , and by cosγs12 − cosβs13 = 0, we have BF ⊥AO, ous. So the optical center O of (O, ABC) locate on the ver- 0 then AO⊥BCF , furthermore, AO⊥BC. Let AE⊥BC tical plane πBC . Link A and E, by 4ABC is congruent to and link O and E, then BC⊥AEO, so OE⊥BC, then 4A0BC, BC⊥A0E holds. Let OH⊥A0E, H0 is the foot.

5  2 2 2  s11 + s22 − 2cosγs11s22 = c (16)  2 2 2 s11 + s23 − 2cosβs11s23 = b (17)  2 2 2 s22 + s23 − 2cosαs22s23 = a (18) By subtracting equations (16), (17) ,(13) from (13) ,(14), (14) respectively , we get

s22 = 2cosγs11 − s12 (19)

s23 = 2cosβs11 − s13 (20) Figure 6. The geometric meaning of the side-sharing pair. 2 2 2 2 s13 − s12 − 2cosβs11s13 + 2cosγs11s12 = b − c (21)

By BC⊥OA0 and BC⊥A0E, we have OH0⊥BC, then Substitute (15), (19), (20), (21) into the left hand side of OH0⊥4A0BC, so the optical center O of (O,A0BC) lo- (18), we get A0BC 2 2 2 cate on the vertical plane perpendicular to the plane s + s − 2cosαs22s23 − a 0 22 23 and going through the from A , that is, the opti- 2   0 0 0 −4acosβcosγs11 cos∠ACB cos∠ABC cal center O of (O , ABC) being equivalent to (O,A BC) = bu1 + cv1 − a s12s13 cosγ cosβ locate on the vertical plane πBC under three control points unchanged expression. (22) Similarly, we can prove that a side-sharing pair with a So cos∠ACB bu + cos∠ABC cv − a = 0. Similarly, we shared side AC or AB of the P3P problem under the opti- cosγ 1 cosβ 1 cos∠ACB bu + cos∠ABC cv − a = 0 cal center unchanged expression, then both the correspond- can prove cosγ 2 cosβ 2 . cos∠ACB cos∠ABC ing optical centers locate on the vertical plane π2 and π3 (Sufficiency) Since cosγ bui + cosβ cvi − a = respectively under three control points unchanged expres- 0, i = 1, 2, then substitute them into Equation (3) , we have sion.  M − N 1 + v2 − 2cosβv = , i = 1, 2 (23) 3.2. A point-sharing pair and the geometric mean- i i 1 − N ing where N = ( cos∠ABCcosγ )2, cos∠ACBcosβ In this section, we show that three theorems about the acos2γ a  b2 M = 2 2 b − + 2 point-sharing pair: Theorem 5 is the necessary and suffi- c cos∠ACBcos β cos∠ACB c 2 b2 Considering si1 = 2 , i = 1, 2, and Equation cient condition, Theorem 6 is a sufficient condition, Theo- 1+vi −2cosβvi rem 7 is the geometric meaning that the optical centers of (23) always holds for v1 and v2 , so we get s11 = s21. point-sharing solutions must lie on one of three surfaces, By (u1, v1) 6= (u2, v2) and Theorem 2 and Lemma 1, we which look like a modulated danger cylinder, we called it know u1 6= u2, v1 6= v2, so s12 6= s22, s13 6= s23 , it the skewed danger cylinder in this work. follows that the two solutions corresponding to (u1, v1) and (u , v ) respectively are a point-sharing pair with a shared Theorem 5 Under the optical center unchanged expres- 2 2 point A . sion, the necessary and sufficient condition for the P3P  problem to have a point-sharing pair with a shared point Theorem 6 Under the optical center unchanged expres- A is both the corresponding different (u , v ) and (u , v ) cos∠ACB cos∠ABC 1 1 2 2 sion, if (u1, v1) satisfy cosγ bu + cosβ cv − a = 0 satisfy the equation which correspond to a solution (O, ABC) of the P3P Prob- cos ACB cos ABC lem and β < ∠ABC, γ < ∠ACB, then the P3P prob- ∠ bu + ∠ cv − a = 0 cosγ cosβ lem has another solution which has a shared point A with (O, ABC) , and the corresponding (u , v ) also satisfy Proof (Necessity) 2 2 cos∠ACB bu + cos∠ABC cv − a = 0. Suppose the distances between the optical center and each cosγ cosβ control point of the point-sharing pair with a shared point A Proof (By construction) are (s11, s12, s13) and (s11, s22, s23) respectively, then Let s11 = |OA|, s12 = |OB|, s13 = |OC| be the side lengths corresponding to the solution (O, ABC).  2 2 2 cos∠ACB cos∠ABC s + s − 2cosγs s = c (13) Since cosγ bu1 + cosβ cv1 − a = 0 , we have  11 12 11 12 s2 + s2 − 2cosβs s = b2 11 13 11 13 (14) cos∠ACB cos∠ABC  2 2 2 bs12 + cs13 − as11 = 0 s12 + s13 − 2cosαs12s13 = a (15) cosγ cosβ

6 Let s22 = 2cosγs11 − s12 and s23 = 2cosβs11 − s13, then cos ACB cos ABC ∠ bs + ∠ cs − as = 0 cosγ 22 cosβ 23 11

So (u2, v2) corresponding to (s11, s22, s23) also satisfy cos∠ACB cos∠ABC cosγ bu + cosβ cv − a = 0. Let us next show that (s11, s22, s23) is a solution of this P3P problem. Firstly, substituting (s11, s22, s23) into the left hand sides of the three basic constraints of the P3P problem respectively, we get 2 2 2 s11 + s22 − 2cosγs11s22 − c 2 2 2 = s11 + (2cosγs11 − s12) − 2cosγs11(2cosγs11 − s12) − c = 0

2 2 2 Figure 7. {O, (A, B, C)} and {O, (A, B0,C0)} are a point- Similarly, s11 +s23 −2cosβs11s23 −b = 0 also holds. For 2 2 2 sharing pair of solutions. s22 +s23 −2cosαs22s23 −a , by equation (22) of Theorem 2 2 2 5, we know s22 + s23 − 2cosαs22s23 − a = 0 holds when cos ACB cos ABC ∠ bu1 + ∠ cv1 − a = 0. cosγ cosβ so s > b is equivalent to cosγ > cos BCA. Simi- Secondly, if s > 0, s > 0, then (s , s , s ) is an- 11 ∠ 22 23 11 22 23 larly, we can prove that s > c is equivalent to cosβ > other solution of the P3P problem which has a shared point 11 cos∠ABC. Thus when cosβ > cos∠ABC and cosγ > A with (s11, s12, s13) . cos∠BCA, (s11, s22, s23) is another solution which has a It follows that we will prove when β < ∠ABC and γ < shared point A with (s11, s12, s13) .  ∠ACB, s22 > 0 and s23 > 0 hold. 2 2 Substituting s23 = 2cosβs11 − s13 into s11 + s23 − 2 2cosβs11s23 − b = 0, we get Remark 2 Inequalities β < ∠ABC and γ < ∠ACB mean that the optical center O lies outside two toroids by s2 − s s = b2 11 13 23 rotating the arc ABC and ACB of circumcircle of the tri- 2 2 s11 − b 4ABC around AC and AB respectively. s23 = s13 so s23 > 0 is equivalent to s11 > b . Theorem 7 (The geometric meaning of the point- Similarly, s22 > 0 is equivalent to s11 > c . sharing pair) Next we prove that s11 > b is equivalent to cosγ > Under the optical center unchanged expression, if cos∠BCA . If (s11, s22, s23) is another solution of the P3P (O, ABC) and (O, AB0C0) are a point-sharing pair with problem, then as shown in Figure 7, Let AH ⊥ planeBOC a shared side A of the P3P Problem, then both the op- , H is the foot. And let AD ⊥ OB, AE ⊥ OC , D,E are tical centers O and O0 of (O, ABC) and (O0, ABC) lo- the feet respectively. By 4ABC is congruent to 4AB0C0 cate on a cubic surface, where (O0, ABC) is equivalent to , we have |BC| = |B0C0|, and D,E are midpoint of (O, AB0C0). segment BB0 and CC0 respectively, so |HB| = |HB0| and |HC| = |HC0|, Furthermore, 4HBC is congruent 0 0 0 0 to 4HB C , it is obvious ∠BHC = ∠B HC , thus 0 0 0 Proof Without loss of generality,suppose (O, ABC) is one ∠BHB = ∠CHC , then isosceles triangles 4BHB and 0 0 0 of the point-sharing pair, let the coordinates of three control 4CHC are similar ones. we get ∠B BH = ∠C CH , so points are A = (e, f, 0),B = (0, 0, 0),C = (a, 0, 0),the ∠OBH + ∠OCH = π, then four points B,O,C,H are optical center is O = (x, y, z) , it is easy to get cocyclic, we have ∠BOH = ∠BCH. b2 = f 2 + (a − e)2, c2 = e2 + f 2 we note that p 2 2 2 s11 = (x − e) ) + (y − f) + z s p 2 2 2 |AH|2 s12 = x + y + z cosγ = 1 − cos BOH p 2 2 2 2 ∠ s13 = (x − a) + y + z s11 s2 +s2 −b2 s2 +s2 −c2 cosβ = 11 13 , cosγ = 11 12 . By Theorem and 2s11s13 2s11s12 r 5, cos∠ACB bu + cos∠ABC cv − a = 0 hold, that is, |AH|2 cosγ 1 cosβ 1 cos BCA = 1 − cos BCH cos∠ACB bs + cos∠ABC cs − as = 0 ∠ b2 ∠ cosγ 12 cosβ 13 11 Substituting all

7 solutions with BC being the shared side, we have cosγu − cosβv = 0, then v = ucosγ/cosβ (26) Substituting (26) into (25), we have

2 2 2 2 2 2 2 2 2 2 2(b −c )cosαcosβcosγ−cos γ(b −a −c )+cos β(c −a −b ) 2 cos2β u = 0 then cos2γ(b2−a2−c2)−cos2β(c2−a2−b2) cosα = 2(b2−c2)cosβcosγ (27) Substituting (27) into (25), (25) can be factorized as: cos ACB cos ABC  (ucosγ − vcosβ) ∠ bu + ∠ cv − a = 0 Figure 8. A graphical representation of the skewed danger cylinder cosγ cosβ in equation(24). (28)

cos∠ACB cos∠ABC So cosγ bu + cosβ cv − a = 0 also holds, then by parameters into the equation,we have Theorem 5, and if u > 0, v > 0, there must exist a pair

" 2 # of point-sharing solutions with the shared point on the ray  a 2  e2 − ae + f 2  (e2 + f 2)((a − e)2 + f 2) y · x − + y − − OA. 2 2f 4f 2 | {z } (II).Given a pair of point-sharing solutions, if the P3P prob- danger cylinder lem still has other solutions, these remaining solutions must be a pair of side-sharing solutions. = z2(e2 − fy − ae) (24) From Theorem 5, suppose there is a pair of point- 2 cos ACB 2  e2−ae+f 2  ∠ a  sharing solutions with shared point A, then cosγ bu + Where equation x − 2 + y − 2f − cos∠ABC (e2+f 2)((a−e)2+f 2) cosβ cv − a = 0, so substituting v into (25), we have: 4f 2 = 0 is the danger cylinder of the P3P problem, so equation 24 is called the skewed danger 2(b2−c2)cosαcosβcosγ−cos2γ(b2−a2−c2)+cos2β(c2−a2−b2)=0 cylinder(see Figure ), and it is a cubic surface, so the (29) theorem is proved.  (29) is the same with (27), hence (25) can be factorized as (28)again. Remark 3 In this work, Equations cosγu−cosβv = 0 and So ucosγ − vcosβ = 0 additionally holds, then by The- cos∠ACB bu + cos∠ABC cv − a = 0 are called constraints cosγ cosβ orem 2, and if u > 0, v > 0, there must exist a pair of of the side-sharing pair and the point-sharing pair. side-sharing solutions with BC being the shared side. 3.3. Companion pairs of the side-sharing pair and Combining (I) and (II), the theorem is proved.  the point-sharing pair 4. Conclusion The side-sharing pair and point-sharing pair of solutions In this work, we investigate the multi-solution phe- have a close relationship, which can be formally stated as: nomenon in the P3P problem, and provide some new in- Theorem 8 If the P3P problem has a side-sharing pair (or sights into the nature of some interesting phenomena. In a point-sharing pair) of solutions, their remaining solu- particular we show that the necessary and sufficient con- tions, if any, must be a point-sharing pair (or a side-sharing dition for the P3P problem to have a pair of side-sharing pair). solutions is that the two optical centers of the solutions lie on the 3 vertical planes to the base plane of control points; Proof Let us consider the pair of conics (2) in section 2.1. the necessary and sufficient condition for the P3P problem By subtracting (C1) from (C2), we have: to have a pair of point-sharing solutions is that the two op- tical centers of the solutions lie on the 3 so-called skewed 2 2 2 2 2 2 2 2 2 2 (a + b − c )u + 2(c − b )cosαuv − (a − b + c )v danger cylinders; And if the P3P problem has other solu- − 2a2cosγu + 2a2cosβv = 0 (25) tions in addition to a pair of side-sharing (point-sharing) so- lutions, these remaining solutions must be a point-sharing (I). Given a pair of side-sharing solutions, if the P3P prob- (side-sharing) pair, or, the side-sharing pair and the point- lem still has other solutions, these remaining solutions must sharing pair are often companion pairs. These results are be a pair of point-sharing solutions. helpful to understand the multiple solution phenomenon in According to Theorem 2, if there is a pair of side-sharing the P3P problem.

8 References [20] C. X. Zhang and Z. Y. Hu. A general sufficient condition of four positive solutions of the p3p problem. in JCST, [1] J. A.Grunert. Das pothenotische problem in erweiterter 20(6):836–842, 2005. gestalt nebst uber seine anwendungen in der geodasie. in [21] C. X. Zhang and Z. Y. Hu. Why is the danger cylinder Grunerts Archiv fur Mathematik und Physik, 1:238–248, dangerous in the p3p problem? Acta Automatica Sinica, 1841. 32(4):504–511, 2006. [2] J. C. Faugre, G. Moroz, F. Rouillier, and M. S. E. Din. Classi- fication of the perspective-three-point problem, discriminant variety and real solving polynomial systems of inequalities. International Symposium on Symbolic and Algebraic Com- putation, 3(1):79–86, 2008. [3] M. A. Fischler and R. C. Bolles. Random sample consen- sus: a paradigm for model fitting with applications to image analysis and automatic cartography. in Graphics and Image Processing, 24(6):381–395, 1981. [4] X. S. Gao, X. R. Hou, J. Tang, and H. F. Cheng. Complete so- lution classification for the perspective-three-point problem. in PAMI, 25(8):930–943, 2003. [5] X. S. Gao and J. L. Tang. On the probability of the number of solutions for the p4p problem. in JMIV, 25(1):79–86, 2006. [6] R. M. Haralick, C. N. Lee, and K. Ottenberg. Review and analysis of solutions of the three point perspective pose esti- mation problem. in IJCV, 13(3):331–356, 1994. [7] E. H.Thompson. Space resection: failure cases. Photogram- metric Record, 5(27):201–207, 1966. [8] Q. Jia, P. Zheng, and H. Sun. The study of positioning with high-precision by single camera based on p3p algo- rithm. IEEE International Conference on Industrial Infor- matics, pages 1385–1388, 2007. [9] D. G. Lowe. Fitting parameterized three-dimensional models to images. in PAMI, 13(5):441–450, 1991. [10] D. Nister. A minimal solution to the generalized 3-point pose problem. in JMIV, 27(1):67–79, 2007. [11] L. Quan and Z. Lan. Linear n-point camera pose determina- tion. in PAMI, 21(7):774–780, 1999. [12] M. Q. Rieck. An algorithm for finding repeated solutions to the general perspective three-point pose problem. in JMIV, 42(1):92–100, 2012. [13] M. Q. Rieck. Solving the three-point camera pose problem in the vicinity of the danger cylinder. in VISAPP, 2:335–340, 2012. [14] M. Q. Rieck. A fundamentally new view of the perspective three-point pose problem. in JMIV, 48(3):499–516, 2014. [15] F. M. Sun and B. Wang. A note on the roots of distribution and stability of the pnp problem. Acta Automatica Sinica, 36(9):1213–1219, 2010. [16] J. Tang and N. Liu. The unique solution for p3p problem. Proceedings of the 2009 ACM symposium on Applied Com- puting, pages 1138–1139, 2009. [17] W. J. Wolfe. A special case solution to the perspective 3-point problem, 2008. http://faculty.csuci.edu/william.wolfe/CSUCI/articles /PerspectiveView/New P3P Article/Wolfe P3P Special Case.pdf. [18] W. J. Wolfe, D. Mathis, C. W. Sklair, and M. Magee. The per- spective view of three points. in PAMI, 13(1):66–73, 1991. [19] Y. H. Wu and Z. Y. Hu. Pnp problem revisited. in JMIV, 24(1):131–141, 2006.

9