A VISION-BASED TRAVELLED DISTANCE ESTIMATION ALGORITHM IN AN INDOOR ENVIRONMENT USING A MOBILE ROBOT

Autonomous navigation for a mobile robot still remains as a challenging area to be explored. In an indoor environment, while GPS is unavailable and wheel encoder suffer from error accumulation due to wheel slips, vision-based travelled distance estimation can be considered as an alternative approach for more accurate measurements. This study presents a new algorithm to estimate travelled distance of the mobile robot in an indoor environment. Using a downward looking camera, features points are detected from the floor texture and tracked with the Lucas-Kanade optical flow technique. The measurement accuracy of this algorithm will be put through several experiments on real scenarios which involve comparing the proposed techniques, running the algorithm on different type of indoor surface at different speed and different trajectories.


INTRODUCTION
In autonomous navigation, the accuracy of robot travelled distance measurement is required in order to reach a target. Ground-based mobile robots often encounter wheel slips while moving over extreme terrain surfaces (such as gravel, grass, sand) (Song et al., 2007). Since the travelled distance of the mobile robot is measured based on the number of round produced by the wheels, theirs slips tend to generate errors that are accumulated during time and end up in providing wrong positioning and localization. To overcome this issue, alternative approaches have been proposed to measure the slips and compensate accordingly with the actual measurement for a more accurate positioning.
Traditionally, Global Positioning System (GPS) and Inertial Measurement Unit (IMU) have been used to measure vehicles' speed and their trajectory. However, GPS suffers from low update rates, signal losses (in an indoor environment) and position errors in order of meters. Whereas low-cost IMUs, they suffers from errors accumulation over time and they are very sensitive to magnetic interferences (especially in an indoor environment) and low speed motions (Chhaniyara et al., 2008;Song et al., 2008).
Over the past decade, visual odometry has become a promising option to estimate robot velocity. Using stereo cameras on a rough terrain, (Chilian and Hirschmuller, 2009) developed a visual odometry algorithm able to estimate travelled distance with an estimation error of less 1.4% within 8.4 meter average distance. (Konolige et al., 2011) developed a more precise localization visual system, in rough outdoor terrain, able to estimate 9 km of trajectory with less than 0.1% of error. Stereo cameras can help to recover motion with good accuracy but their use comes with some considerable limitations. Accuracy using stereo highly depends on inter-camera calibration, which can be hard

JCS
to realize and the baseline (distance between cameras) which defines the depth range within which, the observed features or object has to be in order to get a correct estimation. Plus, the use of stereo cameras also reduces the field of view because only features that lie in the intersection of the field of view of two cameras can be used. Compared to a monocular camera, stereo cameras present higher computational cost and more complex component setting and synchronization (Zhang et al., 2014). Using a downward looking single camera, (Chhaniyara et al., 2008;Song et al., 2007) have developed velocity estimation techniques based on optical flow. Their experimental studies, using a test rig moving at a velocity not more than 50 mm/sec during a maximum time of 8 seconds, are able to provide measurements of velocity and travelled distance with estimation errors less than 1.5%. Song et al. (2008) further improved and extended his techniques to 2-D by estimating both linear and angular slip. Experimental studies using a mobile robot showed velocity estimation errors less than 1% with 0.65 meters distance range. A recent monocular system, proposed by (Zhang et al., 2014), is able to recover motion (with non-holonomic constraint in 3DOF rotation and 1DOF translation) with a mean relative error of 0.83% over 5 km of overall driving distance.
However, recent research regarding visual odometry for travelled distance and wheel slip measurement appeared to be implemented, mostly, on outdoor environments. Usually, features points detected in outdoor environments are far enough to be traced after significant time interval (computation time) (Konolige et al., 2011;Zhang et al., 2014). Moreover, ground textures of outdoor type of terrain are coarse enough to detect large number of salient features (Chhaniyara et al., 2008;Song et al., 2007;2008). Visual odometry, using a single camera, has been well implemented in outdoor type of environment (real or simulated). Instead, its feasibility in an indoor environment (where it is more needed) is yet to be explored in a larger scale (distance range) with different type of surfaces (usually smooth, flat) and texture.
This study presents two methods for estimating travelled distance estimation using vision. The developed algorithm, combined with a calibrated single camera oriented to the floor, uses the displacements of feature points matched with optical flow techniques, to estimate the travelled distance of a mobile robot. The robustness and accuracy of this algorithm is evaluated through several experiments using a mobile robot, travelling on large distance (linear and non-linear), over different speeds and different types of indoor surfaces.

Algorithm Description
This algorithm makes use of existing features, in an image, as principal information to estimate travelled distance. Given a live or recorded video, features are detected from each captured frame (image). Those features identify small windows of pixels (regions) which are evaluated in terms of their traceability (Shi and Tomasi, 1994;Chhaniyara et al., 2008;Song et al., 2010). The traceability of the features depends on the uniqueness of their regions' texture and their intensity (Fraundorfer and Scaramuzza, 2012). Once traceable features are selected, optical flow is used to track them in between frames.
Optical flow or image velocity can be defined as the relative motion of features, edges objects, surfaces or image intensity patterns from one scene to another. Several optical flow techniques have been developed over these last decades (Campbell et al., 2004). Based on experiments realized by (Barron et al., 1994), the one that stand out to be more reliable and robust than the others is the Lucas-Kanade method.
This algorithm is the real-time implementation of the feature detection method by (Shi and Tomasi, 1994), together with iterative Lucas-Kanade method with pyramids by (Bouguet, 2001), to track distinctive features between pairs of images and estimate travelled distance (Fig. 1). The travelled distance estimation is realized by implementing either one of the two proposed techniques using the downward-looking camera.

Camera Model and Calibration
Two types of information are needed, from the camera specifications, to estimate travelled distance: The Field Of View (FOV) and the image resolution in pixel (height and width). The field of view is the extent of the observable scene that is seen through a camera. It is a value expressed in degrees and can have the same or different value on the height (y-axis) or width (x-axis) of the image, depending on the type of camera. With the chosen image resolution of the camera, the FOV is obtained either from the camera specification or by performing a calibration. The camera calibration, to obtain the field of view, makes use of a protractor, a motorized rotator or the compass attached to the camera. As illustrated in Fig. 2, it is performed by identifying one

JCS
object, edge or point from one extremity of the captured scene, then rotate the camera until the same feature is located to the opposite extremity from its initial position. Once the vertical FOV for a specific resolution is obtained, the camera is mounted to a mobile robot to track features and estimate travelled distance based on their displacement.

Travelled Distance Estimation Techniques
In this study, two techniques in estimating the travelled distance of a mobile robot are proposed. Each of these techniques makes use of a camera with prescribed height with respect to ground field of view. These techniques involve the camera being positioned either downwardfacing to the ground where (z-axis) is perpendicular to the ground, or downward tilting to the ground where the image baseline (x, y = height of the image) of the FOV is perpendicular to the ground ( Fig. 3 and 4).

Travelled Distance Estimation Using a Downward-Facing Camera to the Ground
With downward-facing camera to the ground, the travelled distance estimate will require information (Fig. 5) including the vertical Field Of View FOV in (FOV based on y-axis in degree), the height of the image resolution H (in pixel), the height of the camera to the ground Z (in centimeter) and the camera focal length F (in pixel). From the FOV, the focal Length F is formulated in Equation 1: Given pairs of identic features (Γp, Γc), between a previous image (p) and a current image (c), the magnitude ∆Γ y (in Pixel) of the features' displacement based on the y-axis is formulated in Equation 2: By correlation with the magnitude of pairs of features from the image, the travelled distance TD of a mobile robot in between images is formulated in Equation 3 to 5:

Travelled Distance Estimation using a Downward-Tilting Camera to the Ground
With downward-tilting camera to the ground, estimating the travelled distance of a mobile robot requires information (Fig. 6) including the vertical field of view (FOV based on y-axis in degree) and the camera height (Z) from the ground.
As illustrated in Fig. 6, the height of the camera (Z) is perpendicular to the Height of the image (H) are intersecting at the point I (on the baseline of the image).
Given a pairs of identic features (Γp, Γc), the travelled distance TD of mobile robot I between successive images is formulated in Equation 6: where, ||IΓ c || represents the distance between the point I and Γc and ||IΓ p || represents the distance between the point I and Γp.
The distance ||IΓ c || and ||IΓ p || are calculated using respectively Equation 7 and 8: || || 180 where, Z is the distance of the camera to the ground, θ c is the angle c ICΓ and θ p is the angle c ICΓ (Fig. 6).
The angle θ c and θ p are calculated using Equation   9 and 10: .

JCS
where, FOV is the field of view of the camera (also the angle ICO ) and H is the height of the image. IΓ p and IΓ c are the magnitudes (in pixel) of Γp and Γc features, from the point I, based on the y-axis in the image (Fig. 6) Where I y = H = the height of the image.

Experimental Setup
In this section, the travelled distance algorithm is put under several experiments in order to test its robustness and accuracy. The experiments are conducted in an indoor environment with two different types of surfaces: Tiled-type floor and cement type floor ( Fig. 7 and 8).
The equipment used for the experiments consisted of the PIONEER P3-AT from Adept Mobile Robot along with a logitech camera HD c920 and a laptop on top of it. The camera is mounted on a Height Z = 20 cm to the ground, capturing image at 30 frames per second with a resolution of 320×240 (width × height) and a FOV of 52°. The algorithm is developed on visual C++ with OpenCV library. The data provided from the travelled distance estimation are updated after every captured image (within 3 milliseconds) and displayed on a Graphical User Interface (GUI) developed in visual basic.

Results and Analysis
The experiments consist of putting the algorithm to run under two different indoor surface textures, with different speed, different trajectory and distance. They will be divided in 3 phases, through which the best of the proposed techniques, performing on the best floor at the most convenient speed will be chosen to run on a larger scale trajectory.

Comparison of the Travelled Distance Estimation Techniques
In the first experiment, the travelled distance estimation techniques (downward-tilting and downward-facing camera) are compared with the distance measurement and robot wheel encoder. The mobile robot travelled five times on a cement floor, within 1 meter distance at 50 millimeters per second. The results obtained from this experiment are shown in Fig. 9 and 10.
Based on the results shown in Fig. 9 and 10, travelled distance obtained from proposed techniques appears to be more accurate than the wheel odometry. In 5 runs, the downward-facing camera technique generates 0.76% of errors and the downward-tilting camera technique generates 1.46% of errors within 1 meter distance. In the meantime the wheel odometry generate 7.27 and 7.74% for respectively the downward-tilting and the downward-facing camera technique. Since the travelled distance values, generated by the downward facing camera technique, happen to be closer to real travelled distance measurement, this technique is going to be used on the next parts of our experiments.

Comparison of the Speeds and Terrain Types for Travelled Distance Estimation
In this experiment, different speeds on different indoor terrain types are compared. The mobile robot travelled 3 times an approximate distance of 2 and 3 meters at 50 and 100 millimeters per second speed, on tiled and cement-type floor. The results of this experiment are displayed in Fig. 11 to 13.
Based on the results obtained from this experiment, it appears that travelled distances, estimated on a tiled floor, is closer to the real measurement compared to the ones obtained on cement floor. At a speed of 50 millimeters per second, the algorithm generates errors up to 0.47 and 0.64% when the robot travelled respectively around 2 and 3 meters on a tiled floor; against 1.07 and 1.98% for respectively around 2 and 3 meters travelled distance on a cement floor. At a speed of 100 millimeters per second, a higher error scale is observed on both types of surface. Thus the visual odometry generates errors up to 1.74 and 2.12% when the robot travelled respectively around 2 and 3 meters on a tiled floor; against 17.49 and 16.29% for respectively around 2 and 3 meters travelled distance on a cement floor. Since the travelled distance estimation algorithm seems to be more accurate on tiled floor, when the robot is travelling at 50 millimeters per second, this setup will be used to perform to next experiment which involves linear and angular motions.

Comparison of the Estimated Travelled Distance with Different Trajectories
In this experiment, the travelled distance estimation algorithm is put under larger distance. Travelling at 50 millimeter per second speed, the robot will run 3 times 3 different trajectories that involve linear motions and 90° degrees rotations as shown in Fig. 14. Results from this experiment are shown in Fig. 15 and 16.
In this final experiment the mobile the algorithm generates 1.6% of errors when it travel a 3 meters distance involving 2 rotations of 90 degrees. At 4 meters distance with 4 rotations of 90 degrees, the robot generates 1.51%. For the last trajectory with a distance of 12 meters and 4 rotations, a 2.06% of errors are generated.

RESULTS AND DISCUSSION
The experiments realized in papers were able highlight the strengths and some weaknesses of the travelled distance estimation algorithm. Based on those

Science Publications
JCS experiments, it can be concluded that a good of the travelled distance measurement highly depend on the camera setup, the features to track and the robot speed.
By camera setup, it means to set the camera accurately according to the chosen technique, calibrate it and estimate its height to ground with precision. The difference in errors generated between the proposed techniques (experiment from the section 3.2.1) can be tight with the camera setting. Indeed, making the camera attached parallel to the floor (downward-facing technique) robot happens to be easier and more convenient to be implemented with the available equipment (mobile robot, camera). Making the camera tilting (with downward-tilting technique), while the base of the view is perpendicular to the floor, can be quite difficult to implement in this situation; and a small inclination of the camera in both techniques, from their right disposition, could generate errors that are accumulating over time.
This developed algorithm, also, highly rely on features to track. Those features, in this context of type, are identified around observable edges on floor. In this algorithm, up to 100 good features can be selected and tracked between images. From the magnitude value of each features, the average of the most common ones is consider to right magnitude to calculate the travelled distance. Therefore the more features there are on the more accurate will be the measurement. That explain the better accurate measurement obtained on a tiled floor (experiment performed in section 3.2.2) since it has more observable edges and traceable features, compare to the cement floor which is uniform ( Fig. 7 and 8).
Another factor that impacts the travelled distance measurement is the speed of the mobile robot. The speed of the robot usually shows the limitations of the implemented camera. Depending on the camera, higher motion speeds generate blurrier image frame, which caused feature losses and tracking errors. That would explain higher errors scale, when the robot travelled at 100 millimeters per second, on the experiment performed in section 3.2.2. The measurement errors at such speed become more important on cement floor than a tiled because features identified on the cement have a lower gradient (less visible), therefore more sensitive to blurred, compare to the ones on a tiled floor.
Beside weaknesses of this algorithm, based on the camera limitations, it cannot perform well on some extreme lighting situations on a uniform type of floor, where lighting environment is high until reflecting on the floor and over shadow observable edges, or too low until no edges can be observed.

CONCLUSION
This study presented a new vision-based travelled distance estimation algorithm in an indoor environment using the mobile robot. This algorithm is able to measurement the distance travelled by the robot in an indoor environment using features identified on the floor. The experiments performed in this study, prove this algorithm to be accurate and robust on smooth types of surfaces (with uniform texture) which are categorized as extreme since there are not much of traceable features. Because of the better accuracy that the algorithm provides over the robot wheel encoder in some situations, it can be considered as an alternative approach for motion sensing technology, which is low cost and perform in real time. In further studies, this algorithm could be tried out with outdoor type of surfaces since more edges and shapes could be observed. Moreover, combined other motion sensing devices or algorithms capable to estimate orientations (specially yaw rotation), this algorithm could estimate and generate full path (or trajectory) taken by a ground-based mobile robot from its initial to its current position.

ACKNOWLEDGEMENT
Authors would like to thank all CRSST (Center of Remote Sensing and Surveillance Technology) members for their support through the realisation of this project.

Funding Information
This project is funded by TM research and development.

Author's Contributions
From the algorithm design to this paper draft Mamadou Diop: However, significant contributions were brought all the way through its realization by Chot Hun Lim: Emphasizing on the algorithm implementation and data acquisition.
Tien Sze Lim: Emphasizing on algorithm the paper writing and reviews.
Lee-Yeng Ong: Emphasizing on the algorithm design and development.

Ethics
This article is original and contains unpublished material. The corresponding author confirms that all of

Science Publications
JCS the other authors have read and approved the manuscript and no ethical issues involved.