# Uncertainty Analysis of 3D Line Reconstruction in a New Minimal Spatial Line Representation
## 2 The Proposed Method
### A New Minimal Spatial Line Representation Tailored for Uncertainty Analysis  
We expect a spatial line representation method that satisfies the following characteristics: a minimal four-vector representation whose direction and position use two parameters respectively; each parameter corresponds to a clear physical meaning of the line in three-dimensional space, and it can be intuitively imagined how the spatial line moves as each parameter changes. A three-dimensional unit direction vector can be mapped as a point on the unit sphere, which in turn can be represented by a spherical coordinate of two dimensions. In addition to direction, the distance from the origin to the line is also an important attribute of the line. By fixing the direction and the distance to the origin, we can get a set of spatial lines. This set of lines are all tangent of a 3D circle in space, as illustrated in Figure 2. By specifying a point \(\mathbf{P}_{c}\) on the circle, a spatial line can be uniquely determined. The position of \(\mathbf{P}_{c}\) on the circle can be represented by an angular interval with the length of \(2\pi\). Figure 1: A 3D line is projected to two cameras. The line can be determined by intersecting two projection planes. In this paper, we propose to represent a spatial line \(\mathbf{L}\) by \((\theta,\phi,m_{l},\alpha)\). \(\theta\) and \(\phi\) are used to describe the direction in the spherical coordinate system:  
\[\mathbf{d}(\theta,\phi)=(\sin\theta\cos\phi,\sin\theta\sin\phi,\cos\theta)^{ \mathrm{T}}. \tag{8}\]  
Figure 3 illustrates how the line direction varies with \(\theta\) and \(\phi\). \(m_{l}\) denotes the distance between the line and the origin. As showed in Figure 2, a spatial line with fixed direction and distance to the origin can be determined only if the point \(\mathbf{P}_{c}\) is specified. At the same time, \(\mathbf{P}_{c}\) is the closest point from the origin to the line. To specify the position of \(\mathbf{P}_{c}\), we define an artificial intermediate variable \(\mathbf{v}_{s}\) which is perpendicular to the direction vector \(\mathbf{d}\) and passes the origin. Then \(\mathbf{v}_{s}\) is coplanar with the red circle in Figure 2. The rotation from \(\mathbf{v}_{s}\) to \(\mathbf{O}\mathbf{P}_{c}\) is defined by an angle \(\alpha\) about the axis \(\mathbf{d}\). This rotation defines a quaternion, and we assume that the corresponding rotation matrix is \(\mathbf{R}(\mathbf{d},\alpha)\). Then the closest point \(\mathbf{P}_{c}\) on the line to the origin can be denoted as:  
\[\mathbf{P}_{c}=m_{l}\mathbf{R}(\mathbf{d},\alpha)\mathbf{v}_{s}/\left| \mathbf{v}_{s}\right|. \tag{9}\]  
In this way, a 3D line can be represented by three angles and a distance. By (8) and (9), the direction and the closest point can be computed. It is important to emphasize that the artificial intermediate vector \(\mathbf{v}_{s}\) used above can be defined by individual rules. The vectors perpendicular to the direction \(\mathbf{d}\) constitute the null space of \(\mathbf{d}\) and have two degrees of freedom. In this work, \(\mathbf{v}_{s}\) is constructed by a non-zero unit vector:  
\[ \begin{split}\mathbf{v}_{s}&=\mathbf{d}(\theta+ \pi/2,\phi)\\ &=(\cos\theta\cos\phi,\cos\theta\sin\phi,-\sin\theta)^{\mathrm{T} }.\end{split}  \tag{10}\]  
The artificial intermediate vector \(\mathbf{v}_{s}\) is just used to construct the angle \(\alpha\) to specify the relative location of the line on the red circle. Here, we note that \(\mathbf{d}(\theta,\phi+\pi/2)\) is not vertical to \(\mathbf{d}\) in the way how we define the direction vector. Figure 4 illustrates how the line's position varies with \(m_{l}\) and \(\alpha\). \(\Delta\alpha\) corresponds to movements on the red circle in Figure 2.  
As pointed out in [41], the nonlinear minimal four-parameter representations for spatial lines usually have singularities. The proposed representation takes the distance from the origin to the line as one of the representation component, which makes it impossible to represent a line at infinite.