The vision guidance and image processing of AGV

Firstly, the principle of AGV vision guidance is introduced and the deviation and deflection angle are measured by image coordinate system. The visual guidance image processing platform is introduced. In view of the fact that the AGV guidance image contains more noise, the image has already been smoothed by a statistical sorting. By using AGV sampling way to obtain image guidance, because the image has the best and different threshold segmentation points. In view of this situation, the method of two-dimensional maximum entropy image segmentation is used to solve the problem. We extract the foreground image in the target band by calculating the contour area method and obtain the centre line with the least square fitting algorithm. With the help of image and physical coordinates, we can obtain the guidance information.


Introduction
Visual navigation technology is a kind of advanced guidance mode, it has the advantages of intelligence, high reliability and flexibility. It can capture around more complete information, so it has wide application prospect in AGV navigation system. At present, the more common application is to install the camera on the AGV and use the partial vision navigation method. Through the on-board computer, the high-level decision-making tasks such as path identification and tracking control are completed. The production workshop of vision navigation AGV has less illumination change and better flatness of ground. In this condition, stability and real-time are two main performance indexes of vision system. Therefore, the faster the image processing speed is, the shorter the AGV will obtain the path information. Therefore, to improve the performance of AGV, it is necessary to establish an efficient image processing system.

Principle of Visual Navigation Technology
AGV vision guidance uptake the pavement images by the dynamic guiding camera. The pavement image collection is three-dimensional scene in a 2D space perspective [1]. It needs the inverse process to identify the information of the path in the process of machine vision and realize the measurement of partial difference and deflection angle. At present, the AGV vision system usually uses the corresponding point calibration method to obtain the path information of the image. The image coordinate system is one level of coordinates of the vision system [2]: It is divided into image pixel coordinate system and image physical coordinate system. The image pixel coordinate system is fixed on the image in pixels of the Cartesian coordinates, the origin is located at the upper left corner of the image. The unit of the image physical coordinates is millimetre and its origin is the intersection point and the image plane of the camera axis.
Firstly, we establish the image pixel coordinate system of μ-ο-V and image physics coordinate system of x-c-y image pixel coordinate system and the reference coordinate system is as shown in Figure 1. AGV travels along the Y axis negative direction, its trajectory is divided into straight line and arc segments. It is because that the ribbon width is 6cm, the camera view height is about 15cm and the arc track radius is larger than 1m, so the camera view range is relatively small. In order to simplify the problem, we can take the arc in the field of view as a straight line approximately. The deviation е is the abscissa value of the intersection point between the fitted line and the X axis and the angle of departure  is the angle between the fitted line and the positive axis of the Y axis.

Two-dimensional Maximum Threshold Segmentation.
The two-dimensional maximum entropy threshold [3] method introduces the concept of entropy of the information theory. The image can be regarded as a two-dimensional gray function, which contains N × N pixels and the gray value of pixel is divided into L grades. Firstly, the region gray of the original image is obtained and the target pixel and its adjacent pixels are used as the template. In the original image, the corresponding coordinate of the gray value of the pixel and its region gray mean constitute the data pair (i, j).We set ni, j as the number of pixels of the point gray i and the region gray j and pi,j is the probability density. Therefore, we can have the Formula (1) as follow: As shown in Figure 2, we take the point gray value and the region gray mean value as the coordinate axis to establish the two dimensional image of gray distribution [4] . If the segmentation threshold is located (s, t), the two-dimensional image can be divided into four regions, in which the target pixels are distributed in the A region, the background pixels are distributed in the B region. The C region contains the boundary pixel points and the D region contains the noise signals. Therefore, in order to make the image target and background have good segmentation effect, the best entropy threshold should be determined by two-dimensional maximum entropy method in A and B regions. In order to make the partition entropy more additive, the posterior probabilities of A and B regions are normalized respectively: , 1, 2, , ; 1, 2, , The discrete two-dimensional entropy is defined as the Formula (4) as follow: Then the two-dimensional entropy of the A region and the B region are respectively shown in the Formula (5).
The final HB is shown in Equation (8) The discriminant function of entropy is defined as: The best threshold is shown in Equation (12): According to the above algorithm, the two-dimensional maximum entropy segmentation results are shown in Figure 3.
(a)The image before segmentation (b) the result after entropy threshold segmentation

Figure 3. Threshold segmentation image
It can be seen that the two-dimensional maximum entropy threshold segmentation algorithm is more accurate for the calculation of the optimal threshold and it is suitable for processing the image in this paper. So, the foreground and the background of the image are separated completely and clearly.

Edge Detection Based on Canny Algorithm
After threshold segmentation, the guiding image hope that through an edge detection algorithm [5] to extract the image edge features of the guiding ribbon and sundries in the foreground object. The edge of the image corresponds to the local maximum of the first derivative and the detection of the weak edge of the image is easily disturbed by the noise signal. Therefore, we introduce canny edge detection [6] which uses double thresholds to detect strong edges and weak edges respectively.
The original input image is f (x, y). Firstly, the quasi Gauss function is used as a smoothing operation and the gradient of the smoothed g (x, y) is shown in Equation (13).
( , ) Edge features are smoothed by the Gauss function and paid a fuzzy price. The width of the detected edge is increased and the fuzzy edge of the image is sharpened by NMS (Non-Maxima Suppression, NMS) [7].The NMS method compares the gradient amplitudes of adjacent pixels to each other in the direction perpendicular to the edge and removes the gradient magnitude, which is smaller than the neighbourhood. According to this operation, the non-maxima of the gradient amplitude are removed and the edges become thin. The NMS method suppresses the amplitude image and still contains many false edges caused by noise and fine texture, which can be removed by double threshold algorithm. Double threshold algorithm uses dual threshold T1 and T2 and T2 = 2T1 on non-maximum suppression amplitude image. Two double threshold edge images G1 [i, j] and G2 [i, j] are obtained. The algorithm will constantly collect edges in G1 [i, j] until all the gaps in the G2 [i, j] are joined. Based on the above algorithm, canny edge detection results are obtained as shown in Figure 4.

Information Extraction of Path Guidance
According to the definition of the guidance parameters e and θ and the fitting line L of the guidance path can reflect the path information more accurately. Therefore, the extraction of navigation information is realized by the aid of the image physics coordinate system and the equation of the fitting line in the image physical coordinate system is obtained. The least square method is used in the line fitting algorithm and the linear equation of the fitting line L in the image physical coordinate system is assumed to be shown [8]: The formula contains two undetermined parameters, a represents the intercept and b represents the slope. In this paper, 320 sets of data (xi, yi), i=1,2,3……,320 are obtained by averaging the coordinates of each row of pixels in the outline of the guided ribbon and the least squares method requires the weighted sum of squares of the deviation of the observed value yi to be minimum: By solving the equation set, the best estimate of the parameters a and b of the fitted line can be obtained: The results of path guidance information extraction are shown in Figure 5.

Conclusion
Through the establishment of vision guided image processing platform, the camera provides original visual information. In the process of image processing, two-dimensional maximum threshold segmentation method, edge detection method and Canny least squares method make the original trajectory guidance information can be more clear and the deviation and deviation angle of the processing results more effective. It can effectively solve the problem of unstable operation and AGV track caused by other guidance. In general, we can determine the location of AGV, eliminate the error and improve the system stability and can effectively solve the actual operation of AGV. It can solve practical problems of the AGV.