Navigation Algorithm Based on the Boundary Line of New & Old Soil Using Improved Anti-Noise Morphology

: An improved anti-noise morphology vision navigation algorithm is proposed for intelligent tractor tillage in a complex agricultural field environment. Firstly, the two key steps, Guided Filtering and improved anti-noise morphology navigation line extraction, were addressed in detail. Then the experiments were carried out in order to verify the effectiveness and advancement of the presented algorithm. Finally, the optimal template and its application condition were studied for improving the image processing speed. The comparison experiment results show that the YCbCr color space has minimum time consumption, 0.094 s, compared with HSV, HIS and 2R-G-B color spaces. The Guided Filtering method can enhance the new & old soil boundary effectively than any other methods such as Tarel, Multi-scale Retinex, Wavelet-based Retinex and Homomorphic Filtering, meanwhile, has the fastest processing speed of 0.113 s. The extracted soil boundary line of the improved anti-noise morphology algorithm has best precision and speed compared with other operators such as Sobel, Roberts, Prewitt and Log. After comparing different size of image template, the optimal template with the size of 140×260 pixels can meet high precision vision navigation while the course deviation angle is not more than 7.5°. The maximum tractor speed of the optimal template and global template are 51.41 km/h and 27.47 km/h respectively which can meet real-time vision navigation requirement of the smart tractor tillage operation in the field. The experimental vision navigation results demonstrated the feasibility of the autonomous vision navigation for tractor tillage operation in the field using the new & old soil boundary line extracted by the proposed improved anti-noise morphology algorithm which has broad application prospect.


Introduction
Agricultural machinery [1] automatic navigation system is a key part of the smart tractor [2] for implementing precision agriculture which can free drivers from the boring work as well as improve the work quality.Global positioning technique by using GPS or GNSS [3][4][5] is applied to automatic navigation of unmanned tractors during tillage operation in the field to obtain absolute geographic coordinates dynamically, whereas the navigation precision is heavily influenced by the inclination angle of the field surface, meteorological condition and the strength of satellite navigation signal especially in remote areas.Inertial sensors [6,7] which have a large error in long-distance navigation can only be used as compensation for short-range position correction.Therefore, vision navigation [8] as a popular method in autonomous vehicles, mobile robot, and aircraft has been introduced to intelligent agricultural machinery.The Silsoe Research Institute of the United Kingdom focused on machine vision-based automatic navigation technology and established an extended Kalman filter model for field vehicles.The research team in Cemagref University in France proposed the MRF algorithm to deal with the edge recognition problem of harvested crops to identify crop rows from a multi-feature perspective.Nishiwaki Kentaro of Japan used a pattern matching method according to the character of the distribution shape between rice rows to measure vehicle position.Carnegie Mellon University combined a visual odometry system with an aided inertial navigation filter to produce a robust tractor navigation system with the accuracy in meters on the rural and urban roads that does not rely on external infrastructure.Aiming at crop harvest and management operation, China Agricultural University, Nanjing Agricultural University, and Nanjing Forestry University have proposed plant navigation line extraction algorithms such as filtering method based on image scanning, wavelet transform, and optimized Hough transform respectively to improve recognition of plant navigation line.
A local autonomous navigation method by applying the boundary line of new & old soil was presented in this paper while the tractor works in tillage mode inspired by the existed plant line navigation method.Moreover, the fast image processing algorithm using optimized templates combined with Guided Filtering [9][10][11][12], improved anti-noise morphology, and Hough transformation [13,14] was proposed to meet the practical application of agricultural tillage.

Materials and Methods
The intelligent tractor updated from a traditional tractor with the type of AXION 850(CLAAS) by adding a tractor driving robot as shown in Figure 1.The tractor driving robot consists of a steering arm, a gears-shifting arm, a break leg, a clutch leg and an accelerator leg which can operate a tractor imitating a tractor driver.Moreover, a camera (BLUELOVER, resolution 1280×980) and an RTK GPS (X10, Huace Co., China) were installed on the tractor for automated guided operation.
The tillage procedure of the intelligent tractor includes two steps.Firstly, the tractor tills a round line under manual control or teleoperation control to create a boundary of new & old soil.Then the tractor works at autonomous navigation model based on the boundary calculated by using Guided Filtering, improved anti-noise morphology and Hough transformation in sequence in consideration of the severe randomness and ununiform of agricultural filed environment.

Local linear model
The local linear model is mostly used for non-analytic functions which is defined as the adjacent points on a function have a linear relationship with others.The definition shows that a complex function can be represented by multiple adjacent local simple linear functions.Each point value can be obtained by averaging the weights of all the linear functions which including the point.
Denote the input image as  which is the image to be filtered, and the output as .The local linear model of guided filter assumes that  is a linear transform of the  in a window   centered at pixel , so   which is a pixel in  can be expressed as   =     +   , ∀ ∈   (1) Where  and  are the coefficients of the linear function when the window center is located at the pixel index value ,  and  are the index of a pixel.
After gradient operation on both sides of the formula (1), we can get

𝛻𝑞 = 𝑎𝛻𝐼
(2) Where  and  have similar gradients, so the output  maintains the same edge characteristics with .

Local linear model solution
The process of calculating linear function coefficients is called linear regression.Define the true value of the fitting function p, so the difference value between  and the actual output is as below.
(  ,   ) = ∑ ((    +   −   ) 2 +   2 ) ∈ (3) Where  denotes the image to be filtered;  is a parameter used for adjusting filtering effect whose purpose is to prevent the amount of a value from being too large.The filtering effect improves remarkably with the increasement of .Minimizing formula (3) to defines a least square problem within a window   , its solution is given by:   = The process of weighted averaging is a linear translational variation filtering process, and the calculation of the Guided Filtering is based on this process.
The processing process of the guided filter is shown in Figure 2.Among them, the definition of a guiding graph is , and the relationship between  and the original graph  is represented by a local linear model definition.In the figure,  is the linear transformation of the original image  in the window adjacent to a pixel value, and  and  are the coefficients of the linear function of the window center at the pixel value.The output pixel value  is linearly multiplied by the input image , so  has a similar gradient to .The edge characteristics of the original image  are still preserved in the image  after being processed by the Guided Filtering process.

Improved anti-noise morphology algorithm for image navigation line extraction
Introducing the concept of mathematical morphology [15][16][17][18][19] to the image edge detection operator can overcome the shortcomings of the classical operator [20][21][22], and greatly reduce the calculation amount.The paper proposed an improved anti-noise morphology algorithm for image navigation line extraction which selects a pair of smaller-scale structural elements for further antinoise processing to extract image navigation line based on the edge feature.
In the mathematical morphology algorithm, structural elements should be selected according to actual needs.Small-scale structural elements can make the extracted image edges more detailed and coherent, and obtain more accurate edge localization.Whereas large-scale structural elements can reflect the large edge contours in the image and have good noise suppression effect.Therefore, smallscale structural elements were selected for obtaining complete edges in this paper.
The edge of the image is calculated as below: Where  1 and  2 are two different structural elements: is the image after Guided Filtering treatment.The anti-noise morphology edge detection operator is given as follows: The edge image detected by equations ( 7) and ( 8) can obtain the edge details after the minimum operation.For detecting more detailed edges as well as improving the anti-noise ability of   under the condition of equal noise, the noise immunity is defined as  =   +   (10) Where   is {   ,   };   is the edge detected by equation ( 7);   is the edge detected by equation ( 8);   is the edge detected by equation ( 9).
The new & old soil boundary line extracted by using the algorithm mentioned above is shown in Figure 3(c) compared with that extracted by color space conversion followed with threshold processing shown in Figure 3 The tractor needs to turn left if the navigation angle  is not more than 90 degree otherwise it need to turn right whether the boundary line locates at the left or right side of the tractor.The steering adjustment algorithm flowchart is a detailed algorithm flowchart of steering adjustment is shown in Figure 5.

Experiment
In this paper, the computer employed for the new & old soil boundary navigation line extraction is configured as follows: 64-bit Windows 10 operating system, 8G memory, and a 2-core processor Intel(R) Core(TM) i5-4200H CPU @ 2.80 GHz.The first experiment was carried out to verify the effectiveness of the proposed algorithm mentioned above using several tillage images of different farms.Secondly, the navigation algorithm was used for smart tractor tillage in an experimental farm of Nanjing Agricultural University, moreover, the optimal template was studied to improve the efficiency of the algorithm.

Color space selection
The time consumption and each optimal effect component of the YCbCr, HSV, HIS, and 2R-G-B [23][24][25][26] format images converted from the original image are shown in Table 1 and Figure 7, which indicate that the new & old soil boundary in the Cr component in YCbCr format image is clearest among all the gradation component images as well as fastest conversion speed, only 0.094s.Besides, the histogram of the best gradation component in each image, shown in Figure 8, denotes that the frequencies of I and V gradation components are constant to be zero, 2R-G-B gradation component has less obvious threshold segmentation pixel number, Cr gradation component has apparent threshold segmentation point at 15 pixels.So, the Cr component is selected for the identification of new & old soil boundary.

Filtering method selection
For improving the robustness of the algorithm, the images captured in weak and strong light environment, shown in Figure 9, were used for filtering methods selection because the illumination strength in the field is changeable and uncertain.The Homomorphic Filtering [27][28][29][30] method is very popular in image enhancement processing because it can enhance the abrupt component (demarcation line) and suppress the slow variation component at the same time.The two images with weak light intensity and strong light intensity were processed using the Homomorphic Filtering method which processes and results are shown in Figure 10 and Figure 11.The Homomorphic Filtering method is not suitable for the new & old soil boundary line extracting because the slow variation components are more than the abrupt components in the field tillage images.The Homomorphic Filtering (HF) method and any other algorithms such as Tarel [31], Multiscale Retinex [32][33][34], Wavelet-based Retinex [35] and Guided Filtering method were applied in new & old soil boundary enhancement for contrast testing in Figure 12.Tarel algorithm can clarify the soil boundary but intensify the dry straw simultaneously which lead to huge image interference.On the contrary, Multi-scale Retinex algorithm can eliminate the dry straw information but weaken the reflection difference between the new & old soil which results in low discrimination of soil boundary.Both Wavelet-based Retinex algorithm and Homomorphic Filtering algorithm can enhance the soil boundaries but darken or brighten the whole images which make it difficult for them to identify the boundaries using the binarization method.The Guided Filtering algorithm can enhance the contrast between the new & old soil which make it convenient for the boundary extraction.The contrastive calculation time of the filtering algorithms mentioned above is shown in Table 2.Among them, the image processing time of the Guided Filtering algorithm is only 0.113 second.Followed by Multi-scale Retinex, HF, Tarel and Wavelet-based Retinex algorithms which take 0.552,0.867,0.902 and 1.008 second respectively.So, the Guided Filtering algorithm is selected for new & old soil boundary identification considered the image processing speed and the contrast of the new & old soil.

Navigation line extraction using improved anti-noise morphology algorithm
The edge extraction results and the Hough transform results of the image by using traditional morphology and improved anti-noise morphology algorithms are shown in Figure 13 and Figure 14, respectively.The improved anti-noise morphology algorithm can eliminate the soil boundary noise made by the traditional morphology algorithm because of the adopted double structure and minimum operation.The navigation error can decrease from 10° by using the traditional morphology algorithm to 0.5° by using the improved anti-noise morphology.The comparison edge extraction result between the improved anti-noise morphology algorithm and the popular edge extraction algorithms such as Sobel [36][37][38][39][40], Roberts [41,42], Prewitt [43,44] and Log [45] is shown in Figure 15.There are some breakages in the extracted edges by using the later four algorithms which will lead to large error during navigation line identification processing.Moreover, the longest extracted navigation line created by using the improved anti-noise morphology combined with Hough transform method has best precision compared with others, in Figure 16.The time consumption of the above algorithms is shown in Table 3.Among them, the time consumption of the improved anti-noise morphology is minimal, followed by the Sobel operator, the Roberts operator, the Prewitt operator, and the Log operator.The longest line is used as the tractor navigation line to calculate the orientation error for tractor steering adjustment.In order to further improve the real-time vision navigation during tractor linear tillage operation, the appropriate image should be cropped from the whole original image because a larger size picture needs more computer processing time.Tractor tillage operation includes two work mode, i.e. linear mode and turning mode.During the linear mode, the longest line of new & old soil boundary is created using the above-advanced morphology algorithm firstly.Then a rectangle centered at the middle of the longest line is used to crop a part of the original picture for tractor navigation line calculation because the position and the navigation angle of the soil boundary line change a little.During the turning mode, the original image should be adopted for tractor navigation because the position of the soil boundary in the image varies a lot which leads to the boundary information loss in the rectangle.
The optimization template selection scheme is as follows: (1) The original image is grayscale transformed and uniformly scaled to 816×612 pixels.
(2) The middle of the longest line is used as a reference point.
( The experimental results, shown in Figure 17(b), denote that the navigation angle error decreases significantly when the length and width are not less than 260 and 140 pixels respectively.Because the boundary information decreases with the template size shrinking.when the size of the image boundary signal is not more than that of the background noise when the image size of the template is less than 140×260 pixels.And the algorithm processing costs only 47 ms for the template with the size of 140×260 pixels compared with that of the template with 816×612 pixels which time consumption is 520 ms.

Navigation experiment in the field
The vision autonomous navigation experiment using the proposed new & old soil boundary was carried out in the farmland of Nanjing Agricultural University using a tractor (CLAAS AXION 850 model) equipped with the tractor driving robot developed by our team.For comparing the navigation precision, an RTK GPS (X10, Huace Co., China) was applied and the navigation line was used as the reference, as shown in Figure 18.Firstly, the applied condition of the optimal template of 140×260 pixels was studied by changing the deviation angle  e between the tractor longitudinal direction and the new & old soil boundary line.The experimental results indicate that, in Figure 20, the vision navigational prediction error increase dramatically when  e is more than 7.5° which means that the optimal template is suitable for the tractor body course error ranged between  em = [−7.5°,+7.5°].Then the limit of the tillage operational speed of the tractor was studied based on the total processing time of the algorithm  = 0.33 , the maximum permissible deviation angle  em , the physical field size corresponding to the optimal template of 140×260 pixels and the maximum deviation distance  max .So, the ideal maximum working speed of the tractor is 51.41 km/h for vision navigation using an optimized template when  e is 7.5°.The maximum working speed of the tractor increases sharply when  e decrease as shown in Figure 21.Actually, the existing literature shows that the tractor speed is not more than 5.2 km/h while tillage.Based on the above study, the vision navigation method is shown in the flowchart (Figure 22).The optimal template is adopted when the deviation angle  e is less than 7.5°, otherwise, the global template is applied for navigation.

Conclusion
An improved anti-noise morphology vision navigation method was proposed for tractor tillage operation in the complex agricultural field environment of ununiform, uneven illumination, straw disturbance.
The optimal template of 140×260 pixels is applied when the deviation angle  e is less than 7.5°.At this time, the navigation line extracted from the edge information processed by the improved antinoise morphological operator by Hough transform is the most accurate and the fastest, and the time consumption is only 0.047s.The real-time vision navigation of the tractor body can be satisfied when the speed of the tractor is no more than 51.41km/h.Among them, the image processing time of the Guided Filtering algorithm is only 0.113 second.Followed by Multi-scale Retinex, HF, Tarel and Wavelet-based Retinex algorithms which take 0.552, 0.867, 0.902 and 1.008 second respectively.And the time consumption of the improved anti-noise morphology is minimal, followed by the Sobel operator, the Roberts operator, the Prewitt operator, and the Log operator.Whereas the global template is used to satisfy the real-time visual navigation of the vehicle body when the course deviation is greater than 7.5° and the speed of the tractor is no more than 27.47 km/h.The experiment results show that the navigation line extraction algorithm in this paper takes less time and has a good effect in the complex farmland environment.Therefore, the fast navigation line extraction method based on improved anti-noise morphology has the advantages of short time consumption and high precision and can meet the requirements of real-time vision navigation in the field tillage of intelligent tractor, which has important practical application value.

Preprints
(www.preprints.org)| NOT PEER-REVIEWED | Posted: 23 July 2019 Preprints (www.preprints.org)| NOT PEER-REVIEWED | Posted: 23 July 2019 doi:10.20944/preprints201907.0248.v1 are the variance and mean of  in   ,   is the average value of the image  to be filtered in the window, || denotes the number of pixels contained in the window.In view of the fact that a pixel can be described by multiple linear functions, all linear function values containing the point are weighted averaged when calculating the output value of the point in the formula below.

Table 2 .
The testing data to the different filtering methods.

Table 3 .
Time consumption contrast of different edge operators.