## 4 Selecting the Straight Line Segments  
### Theoretical Error Analysis  
We can compute the depth of objects using Formula (3) if the length of the two straight line segments is known. In theory, the first straight line segment consists of any two SIFT feature points of an object in image \(A\), and the second one consists of the two corresponding matching SIFT feature points in image \(B\). There is always a certain error in the matching SIFT points, because the Nearest Neighbor Distance method is adopted to match the points. For example, we assume that the matching point of the SIFT feature point \(P_{a}\) in image \(A\) is theoretically the \(P_{b}\) in image \(B\), but we get the matching point \({P_{b}}^{\prime}\) in fact by the method. The distance between \(P_{b}\) and \({P_{b}}^{\prime}\) is the error. Although, the error is very little, even no more than one pixel, the accuracy of estimating depth of object is dependent on it. Figure 2: The overview of our depth measurement method. We assume the length of the straight line segment which consists of two SIFT feature points on an object in image \(A\) is \(L_{1}\), and the length of the matching line segment is \(L_{2}\) in image \(B\), theoretically. But we obtain the length is \({L_{2}}^{\prime}\) in fact for there are matching point errors. The difference between \(L_{2}\) and \({L_{2}}^{\prime}\) is \(\Delta={L_{2}}^{\prime}-L_{2}\), and the relation of two length is \(L_{2}=kL_{1}\). We assume that \(U\) is ground truth of depth of object, and \(U^{\prime}\) is the computed depth of object by the Formula (3), and we have  
\[U=\frac{L_{2}}{L_{1}-L_{2}}d \tag{6}\]  
\[U^{\prime}=\frac{L_{2}^{\prime}}{L_{1}-L_{2}^{\prime}}d=\frac{L_{2}+\Delta}{L _{1}-L_{2}-\Delta}d \tag{7}\]  
\[e=\left|\frac{U^{\prime}-U}{U}\right|=\left|\frac{\frac{\Delta}{1-k}}{L_{1}- \frac{\Delta}{1-k}}\right|\frac{1}{k}=\left|\frac{J}{L_{1}-J}\right|\frac{1}{k} \tag{8}\]  
where \(e\) is percentage error of depth measurement, \(J=\frac{\Delta}{1-k}\). Normally, the \(\Delta\) is very little, no more than several pixels, even a single pixel, because \(\Delta\) is produced by the matching error of SIFT feature points. We assume \(\mid\Delta\mid\leq 3\) pixels, and \(0.75\leq k\leq 0.9\), then \(0\leq\mid J\mid\leq 30\). The Figure 3 shows the relations of \(e\) to \(k\) and \(\Delta\). Figure 3a shows the error curve when \(\Delta\leq 0\). Figure 3b shows the error curve when \(\Delta>0\). The range of \(e\) values was so large that the curve is hard to see when the \(L_{1}\) more than 50 in Figure 3b, therefore, it was divided into two parts, as Figure 3c,d. From Figure 3 and Formula (8), we know: (1) that \(e\) increases rapidly when \(L_{1}\to J\); and (2) that \(L_{1}\) is longer, and \(e\) is lower, when the value of \(L_{1}\) is higher than a certain value (e.g., 50) and the variable \(\Delta\) and \(k\) are unchanged. Hence we should select the longest straight line segment to compute the depth of object to minimize the error. Figure 3: Cont. It is also proved by the experimental method that when the \(L_{1}\) is longer, the error is smaller. In the experiment, we select the longest straight line segment, the shortest one, the middle length one, and a random one to compute the depth of object, respectively. 103 pairs of images (resolution: 1280 \(\times\) 1024 pixels) were used, and the depth of 309 objects in the images were to be measured. Table 1 shows the experimental results of the above 4 classes of straight line segment selected to measure depth. For every class of straight line segment, different objects have different lengths, so value range of the length of every class line segment is shown in Table 1. It indicates that we should select the longest straight line segment to compute the depth of object. Different objects have different lengths of the longest straight line segment, which consists of the 2 SIFT points on the object.