The Extraction Algorithm of Crop Rows Line Based on Machine Vision

: The accuracy of crop rows line extraction is the key to the automatic navigation of agricultural machinery. In the paper, an improved algorithm is proposed to solve the problem of poor connectivity, single pixel and redundant pixels. Firstly, image pre-processing operations is used in order to obtain a binary image, then the binary image is thinned. In the refinement process, the connectivity of the skeleton is maintained by the introduction of Euclidean distance. Experimental results show that the proposed method has good adaptability to the row crop, and the skeleton lines that are extracted is more accurate. Compared with the traditional algorithms, the error of the navigation line is relatively small by using this algorithm, which could meet the needs of the practical application.


Introduction
Agricultural machine vision navigation plays a key role in automatic picking, irrigation, fertilization and visual navigation is the basis of crop recognition.Precision pesticide technology is a mainstream trend in the development of modern precision agriculture.Its main idea is using an image acquisition device to analyze and process these images.Then a series of processes were used to extract the navigation line of crop to control agricultural machinery for walking.
In the early 20th century, Marchant and Brivot Silsoe research center [1] and the Swedish expert Bjorn Astrand [2] had made a contribution to vision navigation algorithm research respectively and achieved some results.Ollis [3] used color camera to obtain the field map of crops and the edge of the harvest crop is extracted.Søgaard [4] proposed a algorithm with respect to the extraction of crop line based on the Hough transform.Yutaka Kaizua, Long Qi [5] extracted the characteristics of seedling through analysing the spectral characteristics of seedling and the extraction of seedling target line was achieved.In recent years, the domestic also appeared a lot of researches in this aspect.Zhang Zhibin [6][7] who had combined hough transform and Fisher criterion overcame the insufficiency of the traditional hough transform and made a model of multiple ridge line.Luo Xiwen [8] set up a mobile platform for agricultural intelligent operation.Zhao Ruijiao [9] put forward a kind of improvement algorithm based on vertical histogram projection and combined the projection and hough transform method to detect crop rows.Although these algorithms are valuable, the application of precision pesticide machinery is difficult to achieve because of poor adaptability.
The improved super green algorithm was used greatly reduce the effect of noise.Hough transform reduced the operation time and improved the accuracy.At the same time, an experimental platform was built to conduct different images and a good reconstrucyion result was obtained, which had good adaptation and accuracy and satisfied the needs of practical application.

Acquisition of Crop Rows Image
The rows of chinese chives were taked as research object in the experiment.The model of industrial digital camera is MV-VD030SM/SC that was produced by Shanxi Dimensional Image Technology Co., LTD and the model of industrial lens is AFT-0641MP that was produced by AI Feite Photoelectric Technology Co., LTD, which was used to acquire leek images.The output was 8 bit RGB color images.The original image of chinese chives was shown in fig. 1.

Gray Processing
Leek images usually contain much color information.It was found that these color information was not wery well for the following process.However, RGB color image was converted to grayscale image had more advantages than using color information processing.Gray processing is the basis of image analysis.The image of leek crop rows taken in farmland had obvious characteristics of green (as shown in fig.1).In other words, the G component was higher than the soil background.In order to distinguish crop rows and background better, the traditional super green gray algorithm (2G-R-B) [10] was used to process this image and the effect was shown in fig.2a.It was seen that the background noise of the traditional super green gray algorithm was obvious from fig. 2a, which is not conducive to the follow processing.Therefore, the super green gray algorithm was improved.The improved super green algorithm was as below: From fig. 2b, it could be seen that the background noise of chinese chives crop rows were greatly reduced and the crop lines profile were also obvious.

Filtering Denoising
The crop rows after gray processing were still exist noise.In order to get the target of low noise, the grayscale image need to further denoise.The method of combining 3x3 Gaussian template and 3x3 median filter window was used to filter operation.The image after two filtering times was shown in fig. 3.After filtering, crop rows had been separated clearly.In order to further extract the row target, the image was processed by two value operation.The two main meathods of two value had threshold and the biggest variance.The threshold of threshold method was determined according to experiment and experience, but the brightness of different pictures or the same picture were different, which maked the application of the method inconvenient.In order to extract the target region, OTSU algorithm was used to process the image automatically.In addition, it was not disturbed by the brightness information and had good treatment result.The binary image was shown in fig. 4.

Morphological Processing
As there were still many small noise in the crop row image after binarization processing.These noise that was compared with the crop row area was small, so morphological algorithm was used to remove these noise.The main morphological method is erosion and dilation.The crop rows towarded its center gradually and removed the holes that was smaller than structural element by erosion.While, the dilation had the opposite effect, which could filled the void and increased crop line width.In order not to change and eliminate the useful information of crop row, the morphological processing template that would be used must be appropriate.The structure elements of 3*3 template was used in this paper.The times was determined by experiment.The chinese chives lines contour were shown in fig. 5.

The Skeleton Extraction of Crop Rows
As the navigation path [11][12][13][14][15] is a linear structure, the skeleton of crop rows should be single pixel width.The outline image after morphological processing could not meet the requirements of machine vision navigation line.Then in order to extract the skeleton information of crop row, thinning algorithm was used(as shown in fig.6a).At the same time, the crop rows that were most closely to the center were remained and the redundant skeleton lines was removed to reduce calculation and increase accuracy.The extracted result of the central crop rows was shown in fig.6b.

Trunk Line Fitting
The skeleton of central crop rows does not reflect the navigation line.In precision spraying, the skeleton line should be fitted a straight line to realize path planning [16].The random hough transform [17] was used to fit the crop rows in this paper.The traditional hough transform put the data points of image space map into the parameter space.This was a dispersed mapping of one to many.The random Hough transform improved the velocity of calculation.The result was shown in fig. 7.

The Effect of Extraction of other Images
In order to verify the algorithm that had been proposed in this paper has a good adaptability to the chinese chives crop rows, the corn crop rows were also carried out the same behavior.The results were shown in fig.8. From the figure, it can be seen that the goal lines of the corn crop rows can be extracted clearly, and the skeleton contain less redundant branches.It provided a basis for the analysis of precision pesticide system.

Deviation Calculation
The deviation that is compared by center line of crop rows after fitting and the actual crop lines was the key technology of precision spraying.In this paper, the deviation of the above two kinds of crop rows were analysed, and it was shown in Table 1.From Table 1, we can see that the algorithm could meet the demand of precision spraying technology in the field.4 Conclusions (1)The method of gray processing was improved for background segmentation, which had better result and adaptability than before.The median filtering algorithm could reduce the noise effectively.
(2)In this paper, the morphological processing and thinning on binary image were used.The navigation offset was got according to deviation and position information and realized the automatic navigation of agricultural machinery.
(3)The information of corresponding deviation that was got through experiment proved that this method had improved accuracy and adaptability greatly, which achieved desired results on chinese chives.It had certain reference value to the follow-up study.

Fig. 3
Fig.3 Median filtering image Fig.4 Binary image 2.4 Two Value Processing

Fig. 6a
Fig.6a Thinning process Fig.6bThe skeleton of the center row

Fig. 8a
Fig.8a Original corn crop rows image Fig.8bThe skeleton image Fig.8c Center line fitting image Fig.8 The extraction images of cron crop rows

Table 1
Comparison table of deviation