On the Reconstruction of the Center of a Projection by Distances and Incidence Relations

Up to an orientation-preserving symmetry, photographic images are produced by a central projection of a restricted area in the space into the image plane. To obtain reliable information about physical objects and the environment through the process of recording is the basic problem of photogrammetry. We present a reconstruction process based on distances from the center of projection and incidence relations among the points to be projected. For any triplet of collinear points in the space, we construct a surface of revolution containing the center of the projection. It is a generalized conic that can be represented as an algebraic surface. The rotational symmetry allows us to restrict the investigations to the defining polynomial of the profile curve in the image plane. An equivalent condition for the boundedness is given in terms of the input parameters, and it is shown that the defining polynomial of the profile curve is irreducible.


Introduction
In the paper, we give a method for the reconstruction of the center of a projection. The process is based on distances and incidence relations in the following sense. The distance part means that we know the distance between the point to be projected and the center of the projection. The incidence part This work is supported by the EFOP-3.6.2-16-2017-00015 project, which has been supported by the European Union, co-financed by the European Social Fund. The paper was also supported by the National  means that we know (at least) three collinear points to be projected. Combining this information, we can construct a surface of revolution containing the center of the projection. It is a generalized conic in the sense of [5,10,15,16], because all of its points have a zero weighted distance sum from the elements of the (collinear) triplet of the projected images. Using iterative squares, such a generalized conic can also be represented as an algebraic surface. The rotational symmetry allows us to restrict the investigations to the defining polynomial of the profile curve in the image plane.
In this paper, a necessary and sufficient condition for the boundedness is given in terms of the input parameters, and it is shown that the defining polynomial of the profile curve is always irreducible in C[x, y]. Much of the calculation is computer-assisted, but rather surprisingly, after introducing a number of cases, the obstruction to reducibility always presents itself in the form of a simple contradiction. We refine the process by using more than three collinear points to substitute the generalized conics with spheres. Finally, the center of the projection can be given as the intersection of three spheres with non-collinear centers lying on the image plane.
Reconstructing the center of a projection is a fundamental concept in photogrammetry. Various methods of space resection are studied intensively based on different assump-tions in the formulation of the problem [1,4,[6][7][8]. The paper [6] provides a thorough review, by dividing these methods into three major categories: approximate solutions (including direct linear transformation, the Church method, and 3D conformal transformation), rigorous solutions based on fundamental conditions (such as using coplanarity conditions to determine the relative position of more cameras), and solutions based on projective geometry (for example using vanishing points for camera orientation and calibration). Our approach belongs to the second category, rigorous solutions based on fundamental conditions, where certain incidence relations are made use of to determine the parameters of one or more cameras. For instance, collinearity methods are based on the collinearity of the object, the center and the image of the object. In contrast, we derive equations for the coordinates of the center based on collinear objects in the space. There is a similar difference between coplanarity-based techniques in [6] and coplanarity conditions in Sect. 3.3.
We show that six collinear points in the space allow us to construct a sphere (instead of the more complicated generalized conics) containing the center of the projection. Such a sphere is centered at the image plane and the process ends by finding three spheres with non-collinear centers. Up to the symmetry about the image plane, their intersection determines the center of the projection. As soon as the center is found, we can reconstruct the coordinates of the original points in the space from the image coordinates.
This information can also be used for the follow-up editing of photographic images including, for example, the imitation of effects in the spatial area (fog, smoke, smog, brightness). Since the physical models use the coordinates of the original positions, we need a process to reconstruct the points in the space from the image coordinates. The results of the paper are partially motivated by a project with the involvement of both authors, where the goal is to simulate the effect of smog on real-life photographs. The case of homogeneous smog is well understood [9,[12][13][14]. In some databases, the pictures are equipped with a distance matrix, and that information is enough to simulate homogeneous fog [9]. However, for the inhomogeneous variant of the problem, these data are insufficient: one needs the original coordinates of each point projected on the photograph to create a realistic foggy image.

Notation and Terminology
Disregarding distortions and aberrations of optical systems [2,11,17], photographic images are produced by a central projection is an image rectangle constituted by a relatively dense grid of pixels. Throughout the paper, this simplified case of the central projection without any aberrations of the optical systems will be used (a.k.a. the pinhole mode). Let C(x C , y C , z C ) be the center of the projection, z C > 0 and suppose that M ⊂ π −1 (F) ⊂ R 3 satisfying the following properties: -the center of the projection separates the point P and its projected image for all P ∈ M (which we indicate by π(P) − C − P), and -the distance r C P = |C − P| is given for any P ∈ M.
In what follows, we use the coordinate system illustrated by Fig. 1. Since the following computations are independent of the vertical ordering, we omit the half-turn about the axis t of the camera. Identifying the points in the space with the position vectors with respect to the origin, the reconstruction formula of a point P ∈ M is where Q = π(P). Its analytic form is In order to apply formula (2), we obviously need the coordinates of the center of the projection in terms of the (pixel) To solve the reconstruction problem, we use the incidence relations among the points in the space. In practical applications, these relations can be detected by the help of images of special objects (facade, roadway, curb-stone, lamp-post, etc.).

Collinear Triples
Out of many possible incidence relations, we mainly focus on collinearity. Throughout this section, we adhere to the following convention.

Convention 1
Let P 1 , P 2 and P 3 be three points projected to a photograph through center C with pairwise different, collinear images Q 1 , Q 2 and Q 3 , respectively. Assume that the order of this collinear triple is Q 1 − Q 3 − Q 2 , and that Q 3 = (1 − λ)Q 1 + λQ 2 with some 0 < λ < 1. We put r i = r C P i for i = 1, 2, 3. Furthermore, let Note that these r i are positive, and r 1 = r 2 = r 3 is not possible, as three collinear points cannot lie on a sphere. Also note that u, a, b, c > 0.
Collinearity is preserved by central projections: thus, if P 1 , P 2 and P 3 are collinear as in Fig. 2, then so are Q 1 , Q 2 and Q 3 , cf. Convention 1. The following result gives a necessary and sufficient condition for the reverse implication.
Proposition 1 Under Convention 1, the points P 1 , P 2 and P 3 are collinear if and only if Proof Using formula (1), Since Q 1 , Q 2 and Q 3 are collinear, the vector products are parallel vectors. Its analytic expression is based on the affine Equation (3) provides a condition for the unknown center C in terms of the fixed quantities a, b, c and the coordinates of Q 1 , Q 2 and Q 3 . It means the vanishing of a certain weighted distance sum of the point C from Q 1 , Q 2 and Q 3 , respectively. It is a generalized conic [5]; see also [10,15,16]. Since the focal points are collinear, Eq. (3) is invariant under the rotation about the common line of Q 1 , Q 2 and Q 3 . Therefore, it is a surface of revolution. This equation is of central importance for the rest of the paper.

A Sufficient and Necessary Condition for the Boundedness
We provide a simple equivalent condition for the boundedness of the generalized conic surface (3) in terms of the parameters in Convention 1.

Proposition 2 Under Convention 1, the generalized conic surface (3) is unbounded if and only if c = a + b.
Proof Suppose that there is an unbounded sequence C n of points on the surface (3). Since C n = Q 3 for all but finitely many indices, we can write Eq. (3) into the form By using the triangle inequality, we obtain the upper estimates Therefore, we have lim n→∞ For the reverse implication, let us restrict the investigations to the plane of the profile curve. If c = a + b, then Eq. (3) can be written into the form The solutions of this system of equations are therefore the intersection points of one branch from each of two hyperbolae parameterized by K . If K → 0, then the branches tend to the perpendicular bisectors of the segments Q 1 Q 3 and Q 3 Q 2 , respectively. These bisectors are distinct parallel lines since Q 3 lies between Q 1 and Q 2 . Hence, it is enough to show that some branches of these hyperbolae intersect for any K = 0, as the set of common points of the branches cannot be contained in any bounded region of the plane. Therefore, the generalized conic cannot be bounded as was to be proved. Assuming that K > 0, -the real axes of the branches (6) and (7) coincide (the common line of the collinear points Q 1 , Q 2 and Q 3 ); recall that the ordering is The points of the branch (6) are closer to Q 3 than to Q 1 .
-The points of the branch (7) are closer to Q 2 than to Q 3 .
In classical notation, the parameters of the hyperbolae depending on K are and respectively. We show that these two slopes cannot be equal. According to the symmetry about the (common) real axis, it is enough to concentrate on the case of positive slopes. If and consequently, r 1 = r 2 . Then by c = a + b we obtain the contradiction r 1 = r 2 = r 3 , cf. Convention 1.
Hence, the slopes of the asymptotic lines must be different. If m 1 < m 2 , then we have the intersection of the branches (6) and (7); see the branch with default linestyle in Fig. 3. If m 2 < m 1 , then we are looking for the intersection of the branches corresponding to K < 0; see the branch with dash linestyle in Fig. 3. Fig. 4, an unbounded solution set of Eq. (3) with z = 0 is illustrated. The input data are

Irreducibility of the Defining Polynomial in the Image Plane
Squaring iteratively, we can extend (3) to an algebraic surface consisting of the zeros of a polynomial of degree four: leading to the algebraic condition Example 2 In case of the input data  The input data in Example 2 have been obtained by maple-assisted computations (see Online Resource 1): setting the center of the projection to C (5, 4, 7), we -compute P 1 and P 2 , -taking compute its projected pair Q 3 , -compute λ 3 and r 3 , -define the surface (3) for the plot command.
We investigate the profile curve of the surface given by (8) in the image plane, i.e., z = 0. The main result in this subsection is motivated by Bézout's classical theorem [3]: by showing that the defining polynomial of the profile curve is always irreducible, we obtain that two such curves can intersect in at most 16 points. By applying an invertible affine transformation, if necessary, we may assume that the coordinates of the given points are Q 1 (−u, 0), Q 2 (1, 0), Q 3 (0, 0); cf. Convention 1. Indeed, such a transformation preserves the irreducibility of polynomials.
The profile curve of the algebraic surface (8) is then defined by f (x, y) = 0, where f (x, y) is the quartic polynomial such that the coefficients are As we shall see, it is more convenient to switch the expression d 2,x in the above list to in some cases. This leads to the observation which is frequently used in the following arguments. Under the comparison process, the system of equations generated by the original list of the coefficients is equivalent to the system of equations generated by the modified list containing d 2,x − d 2,y instead of d 2,x . Finally, we note that In particular, d 1 = 0 if and only if d 0 = 0, i.e., b = ua.
has degree four or three in the variables x and y.
Proof The leading coefficient d 4 can be factorized: can be written as Hence, the cubic coefficient d 3 vanishes if and only if b = ua. However, by the definition of u this yields r 1 = r 2 , and then by c = a + b we obtain r 1 = r 2 = r 3 , a contradiction (cf. Convention 1).
We break the analysis down to six cases based on the next two lemmas.

Lemma 2 Assume that d 4 = 0 and f (x, y) is reducible in C[x, y]. By applying the invertible linear substitution x → x, y → −y if necessary, the polynomial f can be written as a product of not necessarily irreducible complex polynomials in at least one of the following four ways:
Proof By our assumption, the polynomial is reducible. The sum of all degree four terms in the variables x and y is (x 2 + y 2 ) 2 , which is obtained as the product of the highest degree monomials in the factors. In the first case suppose that both factors are quadratic. Up to multiplication by nonzero constants, there are two ways to write (x 2 + y 2 ) 2 as a product of quadratic polynomials, namely (x + iy) 2 · (x − iy) 2 and (x 2 + y 2 ) · (x 2 + y 2 ). If the degree two parts of the factors are (x + iy) 2 and (x − iy) 2 , then By In the second case suppose that there is a cubic and a linear factor. Since we are allowed to apply the linear substitution x → x, y → −y, there are no essentially different ways to write the degree four part as a product of a cubic and a linear expressions, except (x 2 +y 2 ) 2 = ((x −iy) 2 (x +iy))·(x +iy). Therefore, Since where A, B, C, D ∈ C.
Proof By our assumption, the polynomial is reducible. The sum of all degree three terms in x and y is x(x 2 + y 2 ), which is obtained as the product of the highest degree monomials in the factors. Since one of the factors is quadratic, the other is linear, and we are allowed to apply the linear substitution x → x, y → −y, there are essentially two ways to write the degree three part as such a product, namely (x 2 + y 2 ) · x and (x(x + iy)) · (x − iy). In the first case We are ready to prove that the defining polynomial is always irreducible. The complete calculation run by sagemath is provided in Online Resource 2.
Proof of Theorem 1. According to Lemma 1, we need to show that if the degree of f (x, y) is four or three, then f (x, y) is irreducible in C[x, y]. The proof follows the cases (1)-(6) based on Lemmas 2 and 3.

In particular,
Therefore, A and D are the solutions of the quadratic equation i.e., Similarly, C and F are the solutions of the quadratic equation i.e., We obtain that Putting C D + AF = d 1 /d 4 and taking the square of both sides, we have that the expression vanishes. Using a sagemath-assisted computation, we get that this expression is which is a contradiction.
(3) By comparison of coefficients, Using a sagemath-assisted computation, We show that the condition c 2 = (u + 1) a 2 + 1 u b 2 also implies the equation b = ua. First of all observe that The left-hand side is a polynomial expression containing the even powers of c. By applying the above condition c 2 = (u + 1) a 2 + 1 u b 2 , a sagemath-assisted computation shows that and its vanishing implies that b = ua. To complete the argument, observe that d 0 = (u 2 a 2 − b 2 ) 2 = 0, i.e., C = 0 and and, consequently, c = (u + 1)a = a + b. In particular, d 4 = 0, which is a contradiction.
Computing the left-hand side expression with sagemath, we obtain a quadratic polynomial in c 2 such that the coefficients are real polynomials in u, a, b. Since c 2 ∈ R is a real root, the discriminant must be a non-negative real number.
(6) By comparison of coefficients, We can express the variables A and B from the first and the second equations: By substituting them into the third and the fourth equations, we obtain that Using sagemath, The contradiction is obvious in the case that c = a + b. Finally, if c = a − b or c = b − a, then a − b = 0 and, consequently, c = 0, which is a contradiction.

Collinear Quadruples
Consider a collinear quadruple of the points P 1 , P 2 , P 3 and P 4 in the space together with the collinear quadruple of the are almost never collinear. If the input data provide us with collinear centers then the set of possible solutions is a circle.

A Note About Coplanar Quadruples in the Space
The coplanarity of the points P 1 , P 2 , P 3 and P 4 can be detected by the help of images of special objects (facade, roadway, traffic signs etc.). The sufficient and necessary condition can be given as the vanishing of the triple product as follows: Using formula (1), where Q i = π(P i ) and r i = r C P i , for i = 1, . . . , 4. Therefore, we can formulate Eq. (18) in terms of the projected points: We also have that the distance of C from the image plane = − μ 234 3 , where μ 234 = ⎧ ⎨ ⎩ > 0 if the triangle Q 2 Q 3 Q 4 is positively oriented with respect toC < 0 otherwise is the signed area of the triangle Q 2 Q 3 Q 4 . Therefore, Eq. (18) is equivalent to 0 = −μ 234 r 2 r 3 r 4 |C − Q 2 | · |C − Q 3 | · |C − Q 4 | + μ 214 r 1 r 2 r 4 |C − Q 2 | · |C − Q 1 | · |C − Q 4 | + μ 134 r 1 r 3 r 4 |C − Q 1 | · |C − Q 3 | · |C − Q 4 | + μ 231 r 1 r 2 r 3 |C − Q 2 | · |C − Q 3 | · |C − Q 1 | and, consequently, the center of the projection must be on the generalized conic surface given by where the weights are given by

Conclusions
Our explicit methods presented in Sect. 3 can complement existing computational techniques; see the introduction and [6] for a survey. The distances from the center and the collinearity of the points in the space turned out to be very effective input data for the reconstruction of the center of a projection. It is demonstrated that a small number of collinear triplets determine the center via relatively simple equations. We applied classical geometrical and algebraic techniques, such as (generalized) conics and Bézout's theorem, together with computer-assisted calculations in maple and sagemath. The theoretical results guarantee rigorous solutions based on fundamental conditions. Some perspectives are presented in Sect. 3.3 for future research to establish new combined techniques.

Funding Open Access funding provided by University of Debrecen
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecomm ons.org/licenses/by/4.0/.