Determine the center and orientation of an ellipse in $3D$ given two perspective images

3dconic sectionslinear algebranumerical linear algebra

An ellipse is hanging somewhere in $3D$ space with unknown $3D$ center coordinates and unknown $3D$ directions of its semi-axes, and unknown lengths of the semi-major and semi-minor axes. What you're given are two images of this ellipse from two cameras which have known centers and known orientations, and known focal distances (these are just the distances between the center of the camera and the projection plane).

From these two images, I would like to determine the ellipse completely, everything about the ellipse, namely, its center coordinates, its axes lengths, and their orientation in space.

How can this task be accomplished ?

This question is inspired by my recent answer to this question, so this provides some context to the current problem.

Best Answer

As noted in a comment, the ellipse lies on the intersection of the two cones having the centers of the cameras as vertices, and the respective images as guiding curves. The intersection of two quadrics is, in general, a quartic curve. As this curve contains an ellipse, then it must be made of two conics, one of them being the ellipse we want to determine. That means there are in general two possible solutions.

enter image description here

To find the intersection, one could find the equations of both cones. This can be done, for instance, by taking nine points on each cone and inserting their coordinates into the general equation of a quadric. But solving the resulting system of equations can be quite tedious.

I'll suggest then a different approach. Take five points $ABCDE$ on the first image and consider the five lines $abcde$ passing through each point and the center $O_1$ of the first camera. The images of these lines, relative to the second camera, can then be constructed: they are five lines lying in the plane of the second image, each of them intersecting it at two points: $(A_1,A_2)$, $(B_1,B_2)$ and so on. If $O_2$ is the center of the second camera, we can then construct the intersection point $P_1$ between line $A_1O_2$ and line $a$, and the intersection point $P_2$ between line $A_2O_2$ and line $a$. Points $P_1$ and $P_2$ lie then on the intersection of the cones, each on a different conic.

We can similarly find the other four couples of points on the intersection: $(Q_1,Q_2)$, $(R_1,R_2)$ and so on. Five of these ten points lie on the first conic, and the others lie on the second conic, but we don't know which lies on which. To find out, we can consider all $32$ possible cases $(P_i,Q_j,R_k,\dots)$ and check if all five points lie on a the same plane: this should be true only in two cases, which are then five points on each of the two possible conics. These can then be constructed.

See here for a geometrical construction of center and axes of an ellipse, given five points.

EDIT.

You can see below an example of the construction, made with GeoGebra. Note that $O_1$ and $O_2$ are on the same side of the plane of the first solution (ellipse $P_2Q_2R_1S_1T_1$) while they are on opposite sides of the plane of the second solution (ellipse $P_1Q_1R_2S_2T_2$). If this kind of information is given one can then isolate the right solution.

enter image description here