Vehicle autonomous localization in local area of coal mine tunnel based on vision sensors and ultrasonic sensors

This paper presents a vehicle autonomous localization method in local area of coal mine tunnel based on vision sensors and ultrasonic sensors. Barcode tags are deployed in pairs on both sides of the tunnel walls at certain intervals as artificial landmarks. The barcode coding is designed based on UPC-A code. The global coordinates of the upper left inner corner point of the feature frame of each barcode tag deployed in the tunnel are uniquely represented by the barcode. Two on-board vision sensors are used to recognize each pair of barcode tags on both sides of the tunnel walls. The distance between the upper left inner corner point of the feature frame of each barcode tag and the vehicle center point can be determined by using a visual distance projection model. The on-board ultrasonic sensors are used to measure the distance from the vehicle center point to the left side of the tunnel walls. Once the spatial geometric relationship between the barcode tags and the vehicle center point is established, the 3D coordinates of the vehicle center point in the tunnel’s global coordinate system can be calculated. Experiments on a straight corridor and an underground tunnel have shown that the proposed vehicle autonomous localization method is not only able to quickly recognize the barcode tags affixed to the tunnel walls, but also has relatively small average localization errors in the vehicle center point’s plane and vertical coordinates to meet autonomous unmanned vehicle positioning requirements in local area of coal mine tunnel.


Introduction
Safe mining production is moving towards having few or no people working within the coal mines [1]. Autonomous driving of various vehicles in local areaof coal mine tunnels are important to achieve this goal [2][3][4]. To achieve autonomous driving, vehicles in local areaof coal mine tunnels require independent localization capability. Large-scale wireless sensor networks can be deployed in underground tunnels, which enable a vehicle to measure the distances to surrounding anchor nodes by using an on-board wireless sensor node, and then locates itself a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 by using a triangulation algorithm [5,6]. The accuracy of this method is greatly affected by the geometry of the triangle. Due to a limited strip-shaped space of the underground tunnel, most locating triangles are flat, leading to relatively high localization errors. In addition, the energy consumption required by wireless sensor nodes prevents them from being used continuously for a long time [7][8][9][10]. Therefore, it is difficult to adopt this method in practice.
Vision sensors and relative image process technology are widely used in mobile object positioning due to their advantages such as accurate, low cost, easy usage and a relatively small environmental influence [11][12][13][14][15][16]. Currently, researches on autonomous positioning in a limited space based on vision sensors, mainly install sensors on the objects which require locating, e.g. the wheel robots. Some researchers concentrated on SLAM (simultaneous localization and mapping) algorithm and its improved algorithm. These algorithms realized the localization by collecting information of surrounding environment and building maps based on vision sensors [17][18][19][20]. The MCL(Monte Carlo localization) method, which locates robot position by using recursive estimation, is the most common localization algorithm used in SLAM. Thrun et al [21] proposed the Mixture-MCL, a robust algorithm based on the MCL, which integrates two complimentary ways of generating samples in the estimation. Some other researchers applied vision sensors to recognize landmarks real-timely and matched these landmarks with an on-board database to locate the object [22][23][24]. E Olson [25] proposed AprilTags Visual Fiducial System and it locates camera's position by recognizing the AprilTags which were deployed in advance. However, the environments of local area for underground coal mine such as fully mechanized coal mining face may change frequently [26][27][28]. So, problems such as high complexity and low update rate of map exist for SLAM method. And the method of database landmark is limited by the need to build a huge database in advance.
We propose an autonomous localization method for coal mine vehicle that uses double vision sensors to recognize barcode tags on both sides of the tunnel walls with the help of ultrasonic sensors. Two cameras are fixed to the top center of the vehicle as the vision sensors, and the ultrasonic sensors are mounted below the cameras. Barcode tags containing their own position information in coal mine tunnel are affixed to the walls at both sides of the underground tunnel in pairs. When a vehicle travels in the tunnel, the on-board cameras collect the images of barcode tags on the walls at both sides of the tunnel, and get the barcode tags' local area position information by recognizing the barcode on images. The distance from the upper left inner corner point of the feature frame of barcode tags on the walls at both sides of the tunnel to the center of cameras, i.e., the center of the vehicle, can be calculated from the ratio between the actual barcode tag width and its width in the CMOS (Complementary Metal Oxide Semiconductor) imaging plane [29]. Since ultrasonic sensors have some advantages such as small size, simple hardware, high accuracy of distance estimation and good performance in complex electromagnetic environment [30], the distance from the vehicle center point to the left tunnel wall is measured by the ultrasonic sensors which are mounted below the cameras. Finally, the 3D coordinates of the vehicle center point in the tunnel's global coordinate system can be obtained based on the positional relationship between the projection of the upper left inner corner point on the camera CMOS imaging plane and the image center point. The localization method of vehicle autonomous localization in local area of coal mine tunnel based on vision sensors and ultrasonic sensors is a kind of geometric localization. Its calculation complex is much lower than the method of SLAM and it needs not to establish a landmark database in advance, which leads to a good positioning performance in real time.
The rest of this paper is organized as follows: a barcode tag that is suitable for autonomous localization in local area of a mine tunnel vehicle is designed, and a barcode locating and recognition algorithm is proposed in Section 2; a local area mine tunnel vehicle autonomous localization model and a localization algorithm are proposed based on a dual camera distance measurement and ultrasonic sensor distance measurement in Section 3; the proposed vehicle autonomous localization method in local area of coal mine tunnel is tested and evaluated in Section 4; and the relevant conclusion is presented in Section 5. Fig 1 shows an underground tunnel barcode tag deployment. It should be assumed that the tunnel walls are vertical on both sides, and the width of the tunnel which is represented by W T is unchanged along underground tunnels in the local area of coal mine. The plane barcode tags are placed in pairs on the walls at both sides of the tunnel at interval distances of W B . θ is the angle between the lines from any barcode vertex to the two vertexes of the barcode tag of the corresponding pair on the wall on the opposite side of the tunnel, where the line between vertexes on the same side is perpendicular to the tunnel wall. A global coordinate system o w x w y w z w is established in the tunnel as shown in Fig 1, where the transverse, longitudinal and vertical directions of the straight tunnel segment 1 are respectively the x w , y w and z w axes of the global coordinate system o w x w y w z w . Due to weak light in the underground tunnel, images collected by ordinary cameras are usually blurred. To effectively recognize the barcode tags affixed to the walls, infrared cameras are installed to ensure effective recognition of barcodes even when there is very weak visible light.

Barcode tag design
UPC-A code (Universal Product Code-A) is a continuous barcode used to represent digital information and it can express a large amount of information. UPC-A code is mature, simple and easy to recognize. The barcode tags that are affixed to the tunnel walls use UPC-A code to represent their position coordinates in the global coordinate system. The barcode tag position coordinates are taken as the coordinates of upper left inner corner point of the feature frame of barcode tag. Fig 2 shows a barcode tag designed based on UPC-A code. The background of the barcode tag is a white rectangle of length L (m) and width H (m). The pattern on the white rectangle is divided into two parts. The first part is the feature frame C, a black frame with lengths of outer sides of L C and H C respectively and lengths of inner sides of L CI and H CI respectively. As shown in Fig 2, the feature frame C contrasts strongly with the white background, which makes it easy to be extracted by cameras from the white background. In addition, the white color both inside and outside of the frame C increases the accuracy of extraction under usually gloomy light conditions in the coal mine tunnels. In Fig 2, the red arrows mark the upper left inner corner point P, the lower left inner corner point Q, and the upper right inner corner F of the feature frame C.
The second part, G, is the main part of the barcode tag, i.e., the part from the leftmost black bar to the rightmost black bar surrounded by C, which consists of 59 black and white bars. The leftmost three bars (two black bars with a single white bar in between) are the start symbol, while the rightmost three bars are the end symbol, as shown in Fig 2. The five bars in the middle of G form the separation symbol, which is composed of three white bars with two black bars in between. The 24 bars between the start symbol and the separation symbol and the 24 bars between the separation symbol and the end symbol represent a 12-digit number, i.e., each digit is represented by four bars. In Fig 2, each digit represented by four bars has a width of 7b (b is module width), since each bar in the start symbol, the end symbol and the separation symbol has a width of b. Thus the width of the G is 95b. The first four digits, the middle four digits and the last three digits indicate the coordinates of the upper left inner corner point P of the feature frame C along the x w , y w and z w axes respectively in the global coordinate system o w x w y w z w . The last digit is a check digit which is the remainder of the sum of the first 11 digits divided by 10. This digit is used to check whether the coordinates of P recognized by the camera are correct. The global coordinates of P are encoded as a barcode using the coding rules of UPC-A barcode listed in Table 1. In the coding rules of UPC-A barcode, each digit of the 4-digit number in the encoding column indicates a single bar whose value is the multiple of the module width b. The different combination of 4 bars indicates different number, for example, "3211" indicates number "0" according to the coding rules of UPC-A barcode. During barcode recognition of an image captured by a camera, the same rules are used for decoding.  Locating and recognition of barcode tags When a vehicle is traveling in the tunnel as shown in Fig 1, the on-board cameras capture the barcode tags affixed to the walls on both sides of the tunnel and images of some of the surrounding walls. If it is assumed that the resolution of the captured image on the CMOS imaging plane is m × n, i.e., the image pixels are arranged in n rows and m columns, then the pixel at row i(1 i n) and column j(1 j m) in the image can be represented by p(i, j). If it is assumed that the actual physical size of the image on the CMOS imaging plane is M × N, then each pixel has an actual side length M / N. Fig 3 shows the original image I 0 including a barcode tag that is captured by a camera with a resolution of 1280×960. In this figure, a pixel coordinate system with the upper left corner point as the coordinate origin is established. In this pixel coordinate system, the positive direction of the X-axis is from the image's left side to its right side, and the positive direction of the Y-axis is from the image's upper side to its lower side, thus the pixel coordinates of p(i, j) will be X = j, Y = i. After the original image I 0 is obtained, the inner outline of the barcode tag feature frame C in the CMOS imaging plane can be extracted to locate the pattern of C within I 0 . Then the barcode tag recognition can be realized by scanning the barcode within the feature frame C.
A. Locating of the barcode feature frame C pattern. Fig 3 shows the original color image I 0 . Only black and white colors are useful to recognize C, so the color image I 0 should be transformed to a gray scale image I 1 firstly, as shown in Fig 4. Each pixel in I 1 can only have a pixel value corresponding to a brightness level from 0 to 255. A value of zero is used to indicate the lowest brightness (black color), while 255 represents the highest brightness (white color).
After obtaining the gray scale image I 1 , a binary image I 2 containing only black and white pixels is generated using a binarization process. In image I 2 , the pixel values 0 and 1 represent the black pixels and the white pixels respectively. For the binarization process from a gray scale image I 1 to a binary image I 2 , a threshold t is used to determine the pixel value in I 2 . A value 0 (black color) is given to pixel values less than t, and a value 1 (white color) is given to pixel values greater than or equal to t. To select the threshold value, OTSU algorithm [31][32][33][34][35] is used to maximize the variance of pixel values between different classes. Let n w (t) and n b (t) be the number of pixels that have values greater than or equal to the threshold t, or less than the threshold t, respectively, proportional to the total amount of pixels in I 1 . Let μ w (t) and μ b (t) be the average pixel values of the group of pixel values that are greater than or equal to the threshold t and the group of pixel values less than the threshold t, respectively. Let μ(t) be the overall average pixel value in I 1 , and g(t) be the variance between these two classes of pixel values. Then The threshold t is given a value from 0 to 255 in turn, and the value of t that gives the max (g(t)) is selected as the threshold t. The binary image I 2 after the binarization process of I 1 is shown in Fig 5, where threshold t is given a value of 153 based on the OTSU algorithm.
As can be seen from Fig 5, after binarization, noise patterns such as the wall texture in the gray scale image I 1 appear as a vast amount of tiny white porphyritic noise in the binary image I 2 . These noise patterns may misdirect the camera when locating the pattern of the barcode tag feature frame C and increase the required computation to extract inner outline of C. For this reason, an opening operation is used to eliminate small noise patterns in image I 2 based on erosion followed by dilation. The erosion operation shrinks the boundaries of all white patterns in the image I 2 , thus eliminating small white noise patterns such as the wall texture. The dilation operation can then recover the remaining eroded boundaries of the white patterns in I 2 . When erosion and dilation are performed in the experiment, a 3 × 3 structure A is first created which can be considered as a binary image with 9 pixels of value 1. A is moved across image I 2 and compared to each pixel p(i,j) and its 8 neighboring pixels N 8 (p), i.e. the 8 pixels around p(i,j) which are shown by the yellow area in Fig 6. During the erosion process, if p(i,j) and N 8 (p) all have the same value of 1 as A, then pixel p(i,j) is set to value 1; otherwise it is set to 0. During the dilation process, if any element of p(i,j) and N 8 (p) has a value of 1, then p(i,j) is set to value 1; otherwise it is set to 0.  erosion and dilation. As can be seen from this figure, the opening operation eliminates most of the small white noise patterns such as the wall texture in image I 2 .
After obtaining image I 3 with most of the white noise patterns eliminated, the outlines of all the remaining white patterns can be extracted. During this extraction, for each white pixel p w (i, j), a check is performed on whether its 8 neighboring pixels N 8 (p) are all white. If any of 8 neighboring pixels is not white, then p w (i,j) is a boundary pixel. If all 8 neighboring pixels are white, then p w (i,j) is not a boundary pixel. The extraction is completed once the pixel Within the CMOS imaging plane, the projection points of the upper left inner corner point P and the lower left inner corner point Q of C are denoted by P 0 and Q 0 , respectively. The length of P 0 Q 0 is used to calculate the distance from P to the camera center point, i.e., the center point of the vehicle in the camera projection model. After the pattern of the barcode feature frame C has been located, the pixel coordinates of P 0 and Q 0 need to be determined to calculate the length of P 0 Q 0 in the pixel coordinate system. P 0 is determined to be the point that has the minimum sum of X and Y pixel coordinates out of all the points on the inner outline of the C pattern, while Q 0 is the point with the largest ratio of the difference between its Y pixel coordinate to Y pixel coordinate of P 0 and its X pixel coordinate. The pixel coordinates of P 0 and Q 0 can be calculated using the following formulas (3) and (4) where, x i and y i are the X and Y pixel coordinates of a point on the inner outline of the C pattern, respectively. In Fig 8, a green circle and a green cross are used to indicate projection points P 0 and Q 0 in the CMOS imaging plane, respectively. Fig 9 presents the locating process of the barcode tag feature frame C pattern. B. Recognition of barcode information. After the pattern of C is located in the images obtained by the cameras, progressive scanning is used to recognize the barcode within the pattern C in image I 2 . In the binary image I 2 , let the leftmost and the rightmost two pixels on the i th row of the inner outline of the C pattern be p(i, s) and p(i, r). Then the coordinate values on the X axis of the pixels on the i th row between p(i, s) and p(i, r) are within the range s < j < r. If Vehicle Autonomous Localization Based on Vision and Ultrasonic Sensors any pixel p(i, j) and its neighboring pixel p(i, j + 1) have different values (0 or 1), these two pixels are the boundary points of the black and white bars. All boundary points on the i th row can be determined in the same way. With these boundaries, the width B u of each of the 59 black or white bars can be calculated. The total width of the 59 barcode bars is where, u is the number of barcode bars. The module width is b = S B / 95. Each bar has a width of c = B u / b module width. With the exception of the start symbol on the left, the end symbol on the right and the separation symbol in the middle, each set of 4 bars from the left to the right of the remaining bars are grouped together, and then match with predefined encoding rules to obtain the corresponding digital information. Progressive scanning of the content surrounded by the C pattern gives the coordinates of P(0.3m, 3m, 0.6m). Fig 10 shows the recognition process of the encoded barcode information. Vehicle Autonomous Localization Based on Vision and Ultrasonic Sensors angle for each ultrasonic sensor is 40˚. The measurement angle of the three ultrasonic sensors can reach almost 120˚, which ensures accurate measurement of the distance even when vehicle is turning left or right. When the vehicle is traveling, the image capturing area of the camera is approximately a quadrangular pyramid. When the quadrangular pyramid completely covers a barcode tag on the wall, the camera can locate and recognize the barcode tag using the above locating and recognition algorithm. It can be assumed that when coal mine vehicleat a measurement point, the recognized upper left inner corner points P 1 and P 2 of feature frames of barcode tags affixed to the walls on both sides of the tunnel have global coordinates of P 1 (x w1 , y w1 , z w1 ) and P 2 (x w2 , y w2 , z w2 ), z w1 = z w2 = H p , respectively.

Distance measurement
For autonomous localization within the local area of tunnel, a traveling vehicle needs to measure the distances D 1 and D 2 from O to the upper left inner corner points P of C on the walls Vehicle Autonomous Localization Based on Vision and Ultrasonic Sensors on both sides of the tunnel. Fig 12 shows the projection model of feature frame C of the barcode tag affixed to a tunnel wall in a camera CMOS imaging plane [36,37]. In this figure, the blue rectangle is a CMOS imaging plane and PQ is the inner side of C with an actual length of H CI . The actual physical length of line segment from P 0 (the projection point of P) to Q 0 (the projection point of Q) on the CMOS imaging plane is where, d pq is the distance between P 0 and Q 0 in the CMOS imaging plane pixel coordinate system. Due to the camera internal structure, the projection point S of the camera center O on the CMOS imaging plane is also the center point of the CMOS imaging plane. OS is the focal length of the camera with a length f. SP 0 is the line segment between the projection point P 0 and the center point S. Its actual physical length is where, d sp is the distance between S and P 0 in the CMOS imaging plane pixel coordinate system.
Since OS ? SP 0 , the length of OP 0 can be calculated as shown below Since the triangle OP 0 Q 0 and triangle OPQ are similar, we obtain Then the distance D between P and O can be calculated using formulas (6), (8) and (9) Localization After obtaining the distances D 1 and D 2 , the vehicle center point O is within the intersection circle e (with center point E) of the two spheres that have P 1 and P 2 as their centers and D 1 and D 2 as their radii, as shown in Fig 13. To determine the position of the vehicle center point O within e, the relevant spatial geometric relationships within the tunnel are drawn as shown in Fig 14. In this figure, o w x w y w z w is the global coordinate system of the tunnel. Since the barcode tags on the left and the right sides are symmetric, and F is the right upper inner corner point of C, P 1 F with length W T , is therefore perpendicular to the tunnel wall. Choosing the minimum distance of all distances between the vehicle center point O and left wall, which were measured respectively by the three ultrasonic sensors at the same time, as d. Do plane V at distance d from the wall on the left side. The plane V intersects with the circle e at points T and T 0 , which are the two candidates for the vehicle center point O. If P 0 is above the CMOS imaging plane center S, i.e., the pixel coordinate y p >n / 2, then the vehicle center point O is T; otherwise, the center point is T 0 . R is the midpoint of TT 0 in V. In Fig 14, the coordinate system o p1 x p1 y p1 z p1 is established with P 1 as its origin, where the x p1 axis is perpendicular to the tunnel wall, the y p1 axis is along the longitudinal direction of the tunnel, and the z p1 axis is along the vertical direction of the tunnel. The coordinate system o e x e y e z e is established with the center point E of the circle e as its origin, where the x e axis is along the horizontal direction of the tunnel ground, the y e axis is perpendicular to the plane of e, and the z e axis is along the vertical direction of the tunnel.
The coordinates of T and T 0 are firstly calculated on the z w axis in the global coordinate system o w x w y w z w . In Fig 14, the equation for the plane V in the coordinate system o p1 x p1 y p1 z p1 is x p1 = d. The two points K(x kp , y kp , z kp ) and J(x jp , y jp , z jp ) can be selected on V. They are the intersection points of P 1 P 2 and P 1 F with V, respectively. Therefore, their coordinates in the coordinate system o p1 x p1 y p1 z p1 are (d,−dtanθ,0) and (d,0,0), respectively. The transformation relationship from the coordinate system o p1 x p1 y p1 z p1 to the coordinate system o e x e y e z e is: where, R p1e is the rotation matrix from the coordinate system o p1 x p1 y p1 z p1 to the coordinate Therefore, the coordinates of K and J in the coordinate system o e x e y e z e can be calculated using formula (11) x ke y ke z ke After obtaining the coordinates of K and J in the coordinate system o e x e y e z e , the equation of V in o e x e y e z e can be calculated as follow where, a = P 1 E − (d cos θ + d sin θ tan θ). In the coordinate system o e x e y e z e , the equation for circle e is where, r is the radius of e, and r 2 ¼ D 2 1 À P 1 E 2 . Therefore, the coordinates of T and T 0 in the coordinate system o e x e y e z e can be calculated using formulas (14) and (15) Since the z w axis of the global coordinate system o w x w y w z w is in the same direction as the z e axis of the coordinate system o e x e y e z e , and the upper left inner corner point P of feature frame C in the global coordinate system o w x w y w z w has a coordinate value H p on the z w axis, the coordinate values on the z w axis of T and T 0 in the global coordinate system are After obtaining these coordinate values, the coordinate value of z wo on the z w axis of the vehicle center point O in the global coordinate system o w x w y w z w can be calculated based on the relationship between pixel coordinate y p of P 0 and n / 2.
In Fig 14, R is the midpoint of TT 0 . The coordinate values of R on the x w and y w axis in the global coordinate system share the same coordinate values as T or T 0 on the x w axis and y w axis, respectively. The x e of R in the coordinate system o e x e y e z e is −a / tan θ, so the length of ER is −a / tan θ. Since ER ? P 1 P 2 , the lengths of P 1 R and P 2 R respectively are where, the two plane coordinate values (x tw ,y tw ) and (x tw 0 ,y tw 0 ), where y tw < y tw 0 , of T and T 0 in the global coordinate system o w x w y w z w can be calculated based on formulas (22) and (23). As the camera is placed obliquely forward on the center of the vehicle, the coordinates (x tw ,y tw ) that have a smaller value on the y w axis are the coordinates of T or T 0 in the global coordinate system o w x w y w z w , according to the geometric relationship shown in Fig 14, i.e., the plane coordinates of the vehicle center point O in the global coordinate system is (x wo ,y wo ).

Tests and performance evaluation Tests in a straight corridor
In order to evaluate the performance of the proposed autonomous localization method for coal mine vehiclein local area using double vision sensors to recognize barcode tags on both sides of tunnel walls with the help of ultrasonic sensors, this method was first tested in a straight corridor that simulates a straight tunnel. The corridor under test had a length of 10m, a width W T of 1.9m, and a height of 3m, as shown in Fig 15. The global coordinate system o w x w y w z w was established with the x w axis, y w axis and z w axis along the longitudinal, horizontal and vertical directions of the corridor respectively. Eight pairs of barcode tags were affixed to the walls on both sides of the corridor. The interval distance W B between any two neighboring barcode tags on the same side was 0.4m. The length L and width H of the tested barcode tags were 0.4m and 0.3m respectively. The actual physical lengths of the inner sides L CI and H CI of the feature frame C were 0.343m and 0.168m respectively. The upper left inner corner point P of the frame C was 0.4m high from the ground. The angle θ between the line from the upper left inner corner point P to the corner point P of the adjacent barcode on the opposite side of the wall and the line which is perpendicular to the corridor wall is 10.2˚.
The vehicle used in the experiments was a lithium-battery powered crawler car that could be manipulated by mobile phones through WIFI. The car was capable of spinning on the spot, as shown in Fig 16. Two TY803-130 infrared cameras were installed on the test car. The angles α between the optical axes of the two cameras and the perpendicular line to the corridor wall were both 35˚. The relevant parameters of the infrared camera are shown in Table 2. The height of the vehicle center point O from the ground was 0.24m. Three JSN-SR04T ultrasonic Vehicle Autonomous Localization Based on Vision and Ultrasonic Sensors sensors r 1 , r 2 and r 3 were mounted on the pillar beneath the left camera. Their data was read using an Arduino DUE development board. Ultrasonic sensors were used to transmit ultrasonic signals to measure the distance every 200ms. The relevant parameters are shown in Table 3.  (1,5). From Fig 19, we can see that the proposed algorithm can effectively locate the pattern of the feature frame C of the barcode tags. A progressive scanning method was then used to recognize the barcode and obtain the coordinates of the upper left inner corner point P in the global coordinate system.
After the feature frame pattern was located and the barcode was recognized, the pixel coordinates of the projection points P 0 and Q 0 of the upper left inner corner point P and the lower left inner corner point Q on the CMOS imaging plane could be calculated for each pair of barcode tags. The distances D 1 and D 2 from the two upper left inner corner points P of each pair of barcode tags to the vehicle center point O was calculated using formulas (6), (7) and (10). The coordinates of O, (x wo , y wo , z wo ), in the global coordinate system were computed based on formulas (18), (19), (22) and (23), with the distance d, from O to the left wall, measured by the ultrasonic sensors. To evaluate the accuracy of the localization of O using the proposed localization algorithm, the error of z w axis localization in the global coordinate system was defined as where, z o (i) is the calculated coordinate of O on the z w axis at the i th measurement point and Vehicle Autonomous Localization Based on Vision and Ultrasonic Sensors z r (i) is the actual coordinate of O on the z w axis. Therefore, the average error of z w axis localization is where, x o (i) and y o (i) are the calculated coordinates of O on the x w and y w axis respectively at the i th measurement point, while x r (i) and y r (i) are the actual coordinates respectively. For U measurement points, the average error of plane coordinate localization for O is Table 4 shows the coordinates of the upper left inner corner points P 1 and P 2 of C in pairsrecognized at each of the ten measurement points in the global coordinate system o w x w y w z w , and their localization results and errors using the proposed algorithm.
The localization results of the vehicle center point O on the z w axis in Table 4 are plotted in Fig 20. From Fig 20, it can be seen that the proposed localization algorithm can effectively compute the coordinates of O on the z w axis. The average error E z on the z w axis for the ten measurement points is 0.083m, calculated using formula (25). This shows that the proposed algorithm can quite accurately locate the z w coordinate of the vehicle center O in a straight corridor. Fig 21 shows the localization results of the plane coordinates of the vehicle center point, based on the results in Table 4. As can be seen from Fig 21, the proposed algorithm can also effectively compute the plane coordinates at each measurement point. Fig 22 shows the error surface of the plane coordinate localization, where E p is the plane coordinate localization error of O at each measurement point. As shown in Fig 22, the localization error varies from 0.021m to 0.270m. When the values on the axes x w and y w reach 0.5m and 1m respectively, the error E p reaches the maximum value which is 0.2695m. When the values on the axes x w and y w reach 1m and 4m respectively, the error E p reaches the minimum value which is 0.021m. This is because when the experimental vehicle is at the coordinates (0.5, 0.5), the distance between the camera and the barcode tag on the right wall is minimum. Consequently the length of P 0 Q 0 gets its maximum value, leading to a maximum error of distance D. In a similar way, when the experimental vehicle is at the coordinates (1.1, 4.0), the distances between the cameras and the barcode tag on the both sides of walls are relatively long. Consequently, the length of P 0 Q 0 gets its minimum value, leading to a minimum error of distance D.  The average error E p is calculated as 0.142m using formula (27). This result shows the accuracy of the proposed algorithm for locating the plane coordinates of the vehicle center point O.

Tests in a curved tunnel
The curved tunnel test site was the underground tunnel at the Research Center of Tunnel and Underground Engineering of Beijing Jiaotong University. The actual environment of tunnel was as shown in Fig 23(a) and 23(b). The cross-sectional shape of the tunnel was horseshoeshaped with a width of 4m. Fig 23(b) shows six pairs of barcode tags symmetrically deployed on both sides of the tunnel. Since there were pipelines on the right tunnel wall, the barcode tags were affixed to the pipelines 0.2m from the right wall, so the actual tunnel width W T was 3.8m. The length L and width H of the barcode tags in this experiment were 0.8m and 0.43m respectively. The lengths of the inner sides L CI and H CI of the feature frame C were 0.665m and 0.325m respectively. The upper left inner corner point P of C was at a height of 0.6m from the ground, and the angle θ between the line between the two upper left inner corner points and the line perpendicular to the tunnel wall was 9.93˚.
In the curved tunnel test, the height H o of the vehicle center point O from the ground was 0.35m; and the angle between the optical axis of the two cameras and the line perpendicular to the wall was 30˚. The parameters of the cameras and the ultrasonic sensors are the same as the previous straight corridor experiment. In this test, the vehicle started from the entrance coordinates (2,1), and traveled along the green track until coordinates (9,11). Twelve pictures were captured when passing the six     (25), the average error of z w axis localization of vehicle center point O for the six measurement points was 0.151m. Fig 28 shows the localization results of the plane coordinates for the six measurement points using the proposed algorithm. Using formula (27), the average error of plane coordinate localization was 0.381m. Therefore, the proposed localization algorithm is quite accurate and feasible in curved tunnels for both locating the vehicle center point on the z w axis and locating the plane coordinates.

Conclusions
For autonomous vehicles to travel in local area of a coal mine tunnel, a self-localization capability is required. We propose an autonomous localization method in local area of coal mine tunnel that uses on-board vision sensors to recognize barcode tags affixed to the tunnel walls in pairs and ultrasonic sensors to measure the distance to the tunnel walls.
1. Using the proposed barcode tag locating and recognition algorithm, the vehicle vision sensors effectively located the feature frame from the collected images containing barcode tags affixed to the tunnel walls on both sides and were able to recognize the barcode tags.
2. The spatial geometric relationship between the vehicle center point and the barcode tags was established based on the distance between the vision sensors and the upper left inner corner points of the barcode tag feature frame in pairs and the distance from the vehicle center point to the left side tunnel wall. The 3D coordinates of the vehicle center point could then be calculated in the tunnel's global coordinate system.
3. For evaluation of the proposed algorithm, experimental results in a straight corridor have shown that average error of z w axis localization is 0.08m for locating the vehicle center point and average error of plane coordinate localization is 0.142m for locating the vehicle center point. Experimental results in the curved underground tunnel have shown that error of z w axis localization is 0.151m for locating the vehicle center point and average error of plane coordinate localization is 0.381m for locating the vehicle center point.