Keywords

1 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 Astrand and Baerveldt [2] had made a contribution to vision navigation algorithm research respectively and achieved some results. Ollis and Stentz [3] used color camera to obtain the field map of crops and the edge of the harvest crop is extracted. Søgaard and Olsen [4] proposed a algorithm with respect to the extraction of crop line based on the Hough transform. Kaizua and Imoub [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. Zhibin et al. [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 et al. [8] set up a mobile platform for agricultural intelligent operation. Zhao et al. [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 reconstructions result was obtained, which had good adaptation and accuracy and satisfied the needs of practical application.

2 Segmentation of Crop Rows

2.1 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.

Fig. 1.
figure 1

Original Chinese chives image

2.2 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:

Fig. 2.
figure 2

a. Common gray image b. Improved gray image

$$ G{\text{r}} = \left\{ {\begin{array}{*{20}c} {1.8G - R - B} & {G > R\,\,or\,\,G > B} \\ {255} & {\text{others}} \\ \end{array} } \right. $$
(1)

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.

2.3 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 3 × 3 Gaussian template and 3 × 3 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.

Fig. 3.
figure 3

Median filtering image

2.4 Two Value Processing

In order to further extract the row target, the image was processed by two value operation. The two main methods 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 made 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.

Fig. 4.
figure 4

Binary image

3 The Detection of Crop Rows

3.1 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.

Fig. 5.
figure 5

Morphological processing image

3.2 The Skeleton Extraction of Crop Rows

As the navigation path [11–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.

Fig. 6.
figure 6

a. Thinning process b. The skeleton of the center row

3.3 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.

Fig. 7.
figure 7

Center line image

3.4 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.

Fig. 8.
figure 8

The extraction images of corn crop rows

3.5 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.

Table 1. Comparison table of deviation

4 Conclusions

  1. (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. (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. (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.