Indirect Method Usage of Distance and Error Measurement by Single Optical Cameras

In this paper, we proposed an indirect method to measure the distance of an object accurately by single visual cameras using triangulation. The object can be seen as the third point of a triangle with two known sides and one known angle. Distance to object can be determined indirectly on the base of known sides and angle, rather than being measured directly. It would be very useful in case there is no line of sight to object (inaccessible) or an obstacle interrupts it. Furthermore, the results show that the measured distance using the indirect method has a lower measurement error than the one using the direct method. This method establishes a basis for the implementation of the position algorithm into the navigation subsystem of swarm robots and will be very helpful especially in robot cooperation.


Introduction
Robot vision includes using a combination of camera hardware and computer algorithms to allow robots to process visual data.Finding the location and direction of the objects in the surrounding space, which is relative to the reference frame, is one of the main tasks in robotic vision.Determining the distance between the camera and the objects accurately is essential for localizing, navigating, and performing some high-level task planning.
Nowadays, on robotic systems, we have many algorithms and techniques to measure the distance to objects or targets: image-based distance measurement techniques Y. Bergeon and P. Kutilek [1][2][3]; photogrammetry, stereo vision, structured light, time of flight, laser triangulation, single camera [4] etc.In this study, we apply the image-based techniques using a single visual camera to estimate the distance from a robot to an object directly/indirectly and their uncertainties.

Distance Measurement using a Single Visual Camera
To determine a distance "directly", we use a single visual camera to capture a photo of the object.This camera is usually mounted on a mobile robot and applied to mapping, localization and obstacle detection.Based on the size of the object in the image, focal length and real size of the object via some geometric transformations, we can estimate accurately the distance from the camera to object.Here we use the term "directly" to distinguish it from the "indirect" method, which will be discussed later, although this method is actually considered an indirect measurement.[1] There is a lot of work to be done in the preparation phase for the experiment results to achieve the highest possible accuracy: selection of the area for the experiments with accuracy reference points, a model of the object, a camera with sufficient resolution and software to analyse the images etc.The robots are supposed to be on flat ground, the target is in the field of view and perpendicular to the optical axis of the camera.

Indirect Method Usage of Distance and Error Measurement by Single Optical Cameras 211
The preparation must proceed very carefully and accurately to reduce errors, which may appear due to establishing the measurement system.
In order to determine the distance from a camera to a known object, we are going to utilize triangle similarity.As shown in Fig. 1, an object with a known width w [mm] is placed in some distance d [mm] from our position.We take a picture of the object by using a camera and then measure the apparent width p [mm] of the object in the image.When we know the focal length f [mm] of our camera, it allows us to derive the distance d [mm] [2]: Notice that all components in the above equation need to be in the same unit of length, for example, in millimetres [mm] or meters [m].
To get the value of the image's size in SI unit of length, we have to convert pixels to their equivalent SI units.The size of one pixel can easily be found based on the dimension and the resolution of the camera's CCD sensor.
For example, our camera used in the experiment has these parameters (as shown in Fig. 2 After obtaining the object's image, it can be analysed by using a software to calculate the number of pixels which characterize the object's size.The principle of measuring the object's size in pixels is that, assuming that we have the coordinates of two points on the image plane (in pixel): Point 1 (X1, Y1) and point 2 (X2, Y2), thus the distance from point 1 to point 2 will be calculated by this equation:

Bergeon and P. Kutilek
With a specific model of the object, the camera, and its settings, we have already the following information: the object's width w [mm]; the focal length f [mm] and as presented above, by using the software, we can determine the object's size p[px] on the image plane.Therefore, we can calculate the distance d [mm] from the camera to the object:

Mathematical Model of the Indirect Method
In Fig. 3, we have the illustration of the model of the method.Assuming that we need to determine distance b from the robot located at point A to an object located at point C.
Because of the existence of an obstacle between point A and point C, there is no line of sight from the robot to the object, so that obviously we cannot use the above mentioned approach to determine the robot-object distance.In this case, we can determine this distance from the information provided by another robot located at point B.

Fig. 3 Model of indirect measurement method
The distance measurement is based on the trigonometric proposition that if two sides and one angle of a triangle are known, the remaining side can be computed.In this case, we have known distance c from the robot located at point A to the second robot located at point B, distance a from the second robot located at point B to the object located at point C and angle = between them.Thus distance b from the robot located at point A to the object located at point C can be calculated with the help of the law of cosines: Therefore, by using this method, distance b from the robot located at point A to the object located at point C is determined indirectly by the help of the second robot located at point B. This indirect method can also be applied to the case, in which the distance that a robot transfers from point A to point C can be determined by using only one camera placed at point B (Fig. 4).Firstly, the camera at point B measures the distance from point B to the robot location at point A at the time.After the interval of time, the robot arrives to point C. Then the camera measures the distance from point B to point C. Using the obtained data and knowing the angle created by the two sides BA and BC, we can determine the distance AC which the robot over.

Indirect Method Usage of Distance and Error Measurement by Single Optical Cameras 213
Fig. 4 Model of the indirect measurement method

Measurement Error and Uncertainty
Error analysis is the study and evaluation of uncertainty in measurement.An error in a scientific measurement has not the usual connotations of the terms "mistake" or "blunder", but rather the inevitable occurrence of uncertainty that attends all measurements.
Because of not being a mistake, it cannot be eliminated by measuring very carefully [5].
The experiment has shown that all measurements, however carefully and scientifically they are carried out, are inaccurate operations and cannot be completely free of uncertainties.The word "uncertainty" means doubt about the validity of the result of a measurement [6].It means that the value obtained as the measurement's result is only an approximation or to estimate of the physical object quantity's value.This result differs from its true value and it is only complete when accompanied by a statement of the uncertainty of that estimate.Measurement accuracy is defined as the closeness of agreement between a measured quantity value and a true quantity value [7].
The correct way to express the result of a measurement is to give the best estimate of the quantity value and the interval which the true value of the quantity lies within.Due to formal reasons, the numerical values of uncertainties are always positive quantities, which we afterward have to provide with a sign "±".The interval "estimator ± measurement uncertainty" defines the result of a measurement.This range is required to localize the true value of the measuring (or quantity to be measured) [8].
In general, the result of a measurement of a quantity x is usually stated as follows [5]: where ∆x is the uncertainty in the measurement of x.The true value of x is somewhere between xbest estimate -∆x and xbest estimate + ∆x.
On the whole, measurement uncertainties are composed of two parts, one is due to random errors and the other is due to unknown systematic errors.Random errors make results of the repeated measures being scattered over a range.The best estimate of the measured quantity is the mean of the distributed data; the error is associated with the distribution of values around this mean.Systematic errors cause the measured quantity to be shifted away from the accepted, or predicted value.Measurements where this shift is small (relative to the error) are described as accurate [8,9].
Standard uncertainty or combined standard uncertainty components can be evaluated by two methods [6,7]: • By the statistical analysis of a series of observations.
• Based on assumptions about the possible variation of given uncertainty components (a type of distribution, the variation range), allowing to estimate standard deviation.Uncertainty components are divided into two categories, depending on their calculation method: (A) Uncertainties calculated by statistical methods.(B) Uncertainties estimated by other methods.The standard uncertainty type A, expressed as a standard deviation, is calculated from the probability density function obtained from the observed frequency distribution.The standard uncertainty type B is calculated on the basis of the assumed probability density function, based on the confidence degree of probability of the given event appearance.
The formula commonly used for uncertainty evaluation of measurement results is based on the following equation [6,10,11]: This equation is called "the law of uncertainty propagation" and determines relations between variations of quantities described in probabilistic categories.Quantities xi, i =1, 2,…,N, are measured directly and then, at the base of its estimates, the value of the quantity y is calculated by assuming that the relation between these quantities is known as the function which generally can be written as ) ,..., , ( x x x f y = .Since the measured quantities have errors, it is inevitable that the quantities computed from them will have errors as well.Variances u 2 (xi), i = 1, 2, …, N, in Eq. 9 are defined as the squares of suitable so-called "standard uncertainties" which are in fact standard deviations (or their estimates) of quantities measured directly.Variation u 2 (y) is treated as a square of standard uncertainty u(y) of the quantity measured indirectly.In the above mentioned relationship, it is assumed that quantities xi, i = 1, 2,…,N are independent.An independent variable having a certain value does not depend on the values of any other variable's parameter.
For the direct measurement method, we have the difference between real and measured distances as follows: And the percentage of errors is calculated by: For the indirect method, we calculate the distance and its measurement uncertainty based on other known information.
Consider ABC triangle, we have its sides, angle, and their measurement uncertainties as following: Based on a mathematical model of the indirect method presented above, the distance b is a function of components a, c and α: For multi-variable functions, the total uncertainty is obtained by adding the components from each variable in quadrature (provided variables are independent).The uncertainties in a, c and α are uncorrelated; or in other words, a, c and α are independent variables.From Eq. 9 we have: Therefore, we can calculate the uncertainty of the measurement of distance b as the following equation:

Examples
Based on the results of practical experiments, which were conducted by the research team of the Department of Air Defence Systems measuring the distance to an object in the range from 1 to 6 m using a single camera [1], we have designed Tab. 1 of practical data.
All measurements were performed with a fixed focal length of 35 mm, f-number 29 and without zoom setting or auto-focus so the focal length did not change its value through the process of experiments.These settings made the aberration (lens distortion) become imperceptible and made the image sharp in all the ranges of the experiments (1 m to 6 m).As it was said above, the "direct method" used in this paper is indeed indirect method, therefore, the uncertainty of the distance, which is estimated by Eq. 1, in Tab. 1 is also based on the law of uncertainty propagation Eq. 6. Suppose that all camera parameters are accurate and the measurement uncertainty at each distance only depends on the uncertainty of object's width (±1 mm) and reading the object's size in pixels (±0.5 px).
As it is illustrated in Figs 5 and 6, the object size, which is obtained on the image plane and transformed from pixel into millimetre by using software and the uncertainty of measured distance are inversely proportional to the distance.By using this direct method, the difference between real and measured distances is from 1.5 mm to 141.2 mm, the distance uncertainty is from 5.756 mm to 157.3 mm (Tab.1).
For the indirect method, consider a special case when α = 90° (the purpose is just to simplify Eq. 4 and hence Eq. 12), with a little help from Pythagorean theorem, then cos α = 0, so that we can eliminate component α in Eq. 4. Thus, we have:   In addition, distance uncertainty can be calculated by following equations: Directly measured distances a and c and correspondingly uncertainties ∆a and ∆c have been obtained from the above described practical experiment.High precision is not possible for short distances (smaller than 2 000 mm) because of the distortion of images [1], so that to compare two methods, we eliminate all the cases in which the measured distance was smaller than 2 000 mm.
Indirectly measured distances b calculated by Eq. 13 may not be determined from the same values of distances correspond to the directly measured distances.Moreover, at nearly the same distance, there are some possible values of uncertainties.Hence, we have to use the approximation and interpolation to get the uncertainties of both direct and indirect measurements at the same distances (Tab.2).

Indirect Method Usage of Distance and Error Measurement by Single
Optical Cameras 217 The uncertainties of indirect measurements are assessed in three cases of distances chosen for the approximation and interpolation: • Nearest cases: The distances which are nearest to the directly measured distances.

Fig. 7 Comparison of distance uncertainties of two methods
In both methods and all cases, the measurement uncertainty tends to increase proportionally to the distance.
We can see that the distance uncertainties using the indirect method are smaller than the ones using the direct method.The distance uncertainty ranges from 5.6 mm to

Distance uncertainty [mm]
Indirect Method Usage of Distance and Error Measurement by Single Optical Cameras 219 100.1 mm using the indirect method (best cases) and from 45.1 mm to 137.4 mm using the direct method, as illustrated in Fig. 7 and Tab. 2. Now let us consider the use of more robots to take part in the progress of distance determination.For example, we will calculate the distance from point A1 to point AN from the information provided by other robots located at points A2, A3,…, AN−1 (Fig. 8).We repeat the steps as mentioned above to calculate the distance from point A1 to point A2, and then the distance from point A2 to point A3 and so on.The distance A1AN and its measurement uncertainty can be calculated by means of distances A1A2, A2A3,…, AN−1AN and their measurement uncertainties.

Fig. 8 Model of multiple indirect measurements
In Fig. 9, we can see the results when we apply the indirect method one to 4 times in 3 cases (nearest, best, worst).The results show us that accuracy of measurement has been improved significantly.As it is illustrated in Tab. 3 and Fig. 9, at the distance of about 6 118 mm, the measurement uncertainty decreases from 137.3 mm using the direct method to 100.1 mm using the indirect method once.When we apply the indirect method continuously 4 times to calculate the distance, the measurement uncertainty decreases to only 49.9 mm.

Conclusions
In this paper, we have proposed an indirect method to measure object distance using single visual cameras.The obtained results are relatively accurate in the range up to 6 m.Although there are some problems which limit the measurement results, it can be applied in cooperative swarm robot to improve the measurement accuracy.However, it needs to be carried out with some changes in more various parameters and a number of problems need to be solved in order to evaluate more the validity of the method.Our future work is to evaluate the influence of different focal lengths, camera's resolution and also the rotation of the object model for the distance measurement.
Fig. 2 CCD sensor's size Then, an image taken by this camera in the best resolution 3 008 × 2 000 [px] has its size 23.7 × 15.6 [mm].It means that one pixel in the horizontal plane has a size of 23.7 / 3 008 [mm] and in the vertical plane has a size of 15.6 / 2 000 [mm].After obtaining the object's image, it can be analysed by using a software to calculate the number of pixels which characterize the object's size.The principle of measuring the object's size in pixels is that, assuming that we have the coordinates of two points on the image plane (in pixel): Point 1 (X1, Y1) and point 2 (X2, Y2), thus the distance from point 1 to point 2 will be calculated by this equation: Method Usage of Distance and Error Measurement by

•
Best cases: The distances which are near to the corresponding directly measured distances and have minimal uncertainties.•Worst cases: The distances which are near to the corresponding directly measured distances and have maximal uncertainties.
Bergeon and P. Kutilek Tab. 3 Comparison of distance uncertainties (best cases)