Acessibilidade / Reportar erro

A MONOCULAR CAMERA-BASED ALGORITHM FOR SUGAR BEET CROP ROW EXTRACTION

ABSTRACT

In order to realise automatic row alignment for sugar beet harvesting, and to improve the efficiency of sugar beet combine harvesters, it is essential to be able to detect the positions of sugar beet rows. In this paper, we consider beet harvesting as a scenario, and an extraction algorithm for beet crop rows is proposed based on videos of beets collected with a monocular camera. We focus on the characteristics of the root and stem features, which are relatively difficult to distinguish from the surrounding environment after cutting the tops and beating the leaves of sugar beet, and a crop row extraction algorithm is designed in which threshold segmentation is carried out based on histogram equalisation and MM-Filter (median filtering and minimum area filtering) is applied to remove noise. The proposed algorithm retains more complete feature information and has better denoising effect than the traditional algorithm, and the processing time is only 11.751 ms, a value 6.9% lower than for the alternative approach. Our algorithm is feasible in terms of recognition and extraction, and can provide a theoretical basis for the construction of an automatic row-to-row control system for a sugar beet combine harvester. It can also provide technical support for the design of an automatic sugar beet combine harvester.

monocular vision; crop row recognition; image processing; sugar beet harvester

INTRODUCTION

Sugar beet is a raw material that is essential for sugar production, and is grown in several regions of China, mainly in the northeast, northwest and northern parts of the country, with a small amount of planting in the remaining provinces (Wang et al., 2013Wang SY, Hu ZC, Zhang HJ, Wu HC, Peng BL, Gu FW (2013) Sugar beet production and mecha-nization harvest analysis in domestic and overseas. Journal of Chinese Agricultural Mechanization 34 (3): 20-25. https://doi.org/10.3969/j.issn.2095-5553.2013.03.006
https://doi.org/10.3969/j.issn.2095-5553...
). In order to improve the yield of sugar beets, the main areas for the production of sugar beets are planted mainly by transplanting on ridges. The level of mechanisation for growing beets in China is low, and planting is mostly semi-mechanised; this gives rise to problems such as unequal row spacings for plants, leading to poor straightness of the planted beets and root tubers, which deviate from the centre line of the row (Wang & Zhang, 2015Wang FY, Zhang DX (2015) Parameter optimization and test on auto guide device for disc type sugar beet harvester. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE) 31(8): 27-33. https://doi.org/10.3969/j.issn.1002-6819.2015.08.005
https://doi.org/10.3969/j.issn.1002-6819...
). When digging and harvesting, if the shovel has a deviation in the forward direction, this will result in beets being missed or crushed, and there will be a need to search again manually, representing a significant loss of efficiency (Wang et al., 2020)Wang SY, Hu ZC, CHEN C, Gao XM, Gu FW, Wu HC (2020) Bench test and analysis on performance of autofollow row for traction sugar beet combine harvester. Transactions of the Chinese Society for Agricultural Machinery 51(04):103-112+163. https://doi.org/10.6041/j.issn.1000-1298.2020.04.012
https://doi.org/10.6041/j.issn.1000-1298...
. Automatic row alignment is a method that can help to solve the above problems.

Researchers at Shinshu University in Japan (Mitsuhashi et al., 2019Mitsuhashi T, Chida Y, Tanemura M (2019) Autonomous travel of lettuce harvester using model predictive control. IFAC 52(30):155-162. https://doi.org/10.1016/j.ifacol.2019.12.514
https://doi.org/10.1016/j.ifacol.2019.12...
) have proposed a method of row alignment based on a camera that can be used to obtain the relative positions of lettuces and a harvester for the case of nonlinear lettuce planting. Garcia-Santillan et al. (2018)Garcia-Santillan I, Miguel Guerrero J, Montalvo M, Pajares G (2018) Curved and straight crop row detection by accumulation of green pixels from images in maize fields. Precision Agriculture 19:18-41. https://doi.org/10.1007/s11119-016-9494-1
https://doi.org/10.1007/s11119-016-9494-...
proposed a method of detecting corn rows using a vision system mounted on an agricultural vehicle for field environments with high weed growth through image segmentation, dual-threshold separation of weeds and crops, and least squares linear regression for crop row detection. Zhang et al. (2021)Zhang ZQ, Li SC, Li CY, Cao RY Zhang M, Li H, Li XH (2021) Navigation path detection method for a banana orchard inspection robot based on binocular vision. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE) 37(21):9-15. https://doi.org/10.11975/j.issn.1002-6819.2021.21.002
https://doi.org/10.11975/j.issn.1002-681...
proposed a path extraction method for banana plantations in which binocular vision was used to provide path information for the automatic navigation of inspection robots. Guo & Xu (2021)Guo XY, Xu XY (2021) Extraction of navigation lines for rice seed farming based on machine vision. Journal of Chinese Agricultural Mechanization 42(5): 197-201. https://doi.org/10.13733/j.jcam.issn.2095 5553.2021.05.27
https://doi.org/10.13733/j.jcam.issn.209...
used the colour component difference for image greyscaling, extracted the target rows using the maximum connected area method, and fitted the target datum using the least squares method, and found that their approach could quickly and accurately extract pairs of rows of rice rows. Tan et al. (2022)Tan WH, Sang YY, Hu MY, Shen K, Zhang WQ, Song YY (2022) Design of automatic navigation system for highland gap sprayer based on machine vision. Journal of Agricultural Mechanization Research 44(01):130-136. https://doi.org/10.13427/j.cnki.njyi.2022.01.022
https://doi.org/10.13427/j.cnki.njyi.202...
focused on the problem of automatic row alignment when spraying with an upland gap sprayer, and used a CCD camera to collect images, an on-board calculator to process the images to extract the navigation lines, and a microcontroller to control the alignment lines. Wang et al. (2021a) investigated the real-time detection of multiple corn rows based on machine vision, mainly using the green component enhancement method and a segmentation threshold optimisation method to process the image, and finally using the least squares method to fit the centre lines for crop rows. Machine vision has also been used to extract the positional relationships between the harvester and the crop rows, and for image processing for a variety of algorithms. Today, there are numerous applications for various combinations of algorithms for processing (Xie & Dong, 2021Xie F, Dong MZ (2021) An improved attitude compensation algorithm for SINS/GNS integrated navigation system. Journal of Sensors 2021:1-9. https://doi.org/10.1155/2021/5525481
https://doi.org/10.1155/2021/5525481...
; Zhilenkov et al. 2020)Zhilenkov A, Chernys S, Sokolov S, Nyrkov A (2020) Intelligent autonomous navigation system for UAV in randomly changing environmental conditions. Journal of intelligent & fuzzy systems: Applications in Engineering and Technology 38(5):6619-6625. https://doi.org/10.3233/jifs-179741
https://doi.org/10.3233/jifs-179741...
. Yang et al. (2023)Yang SQ, Lin FS, Xu PH, Wang PF, Wang S, Ning JF (2023) Planting row detection of multi-growth winter wheat field based on UAV remote sensing image. Transactions of the Chinese Society for Agricultural Machinery 54(02):181-188. https://doi.org/10.6041/j.issn.1000-1298.2023.02.017
https://doi.org/10.6041/j.issn.1000-1298...
proposed a multi-fertility wheat row detection method in which they considered visible remote sensing images of winter wheat using UAVs at the tillering and nodulation stages as research data, and applied a combination of deep semantic segmentation and the Hough transform linear detection. Liu et al. (2022)Liu H, Gong JL, Zhang YF (2022) Extraction method of small agricultural AGV navigation baseline based on crop row characteristics. Journal of Jiangsu University (Natural Science Edition) 43(03):296-301. https://doi.org/10.3969/j.issn.1671-7775.2022.03.008
https://doi.org/10.3969/j.issn.1671-7775...
used the ultra-green grey scale method combined with the Otsu method to achieve real-time acquisition of crop information during the period in which maize plants have 3–5 leaves, used a bar box to simulate crop rows to achieve the initial positioning, and achieved the final positioning through a trapezoidal simulation. They then detected the straight lines of maize crop rows using the Hough transform. Han et al. (2022)Han CJ, Zheng K, Zhao XG, Zheng SY, Fu H, Zhai CY (2022) Design and experiment of row identification and row-oriented spray control system for field cabbage crops. Transactions of the Chinese Society for Agricultural Machinery 53(06):89-101. https://doi.org/10.6041/j.issn.1000-1298.2022.06.009
https://doi.org/10.6041/j.issn.1000-1298...
proposed an adaptive ROI positioning method for kale crop rows based on machine vision and a crop row extraction method based on limited threshold vertical projection feature points. Li et al. (2022)Li X, Su JH, Yue ZC, Wang SC, Zho HB (2022) extracting navigation line to detect the maize seedling line using median-point hough transform. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE) 38(5):167-174. https://doi.org/10.11975/j.issn.1002-6819.2022.05.020
https://doi.org/10.11975/j.issn.1002-681...
proposed a Hough transform method for detecting crop rows based on corn seedling columns in the field, improved the 2G-R-B greyscale image algorithm, and then filtered and denoised weeds and other disturbances by combining median filtering with morphological operations. Wang et al. (2021b) achieved effective extraction of crop rows at the seedling stage by using the maximum entropy method, regional growth, mean drift, and least squares; their approach was found to be well adapted to crop row extraction with different crop species, different crop growth backgrounds and different crop row configurations. Li et al. (2021)Li XG, Zhao W, Zhao LL (2021) Extraction Algorithm of the center line of maize row in case of plants lacking. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE) 37(18):203-210. https://doi.org/10.11975/j.issn.1002-6819.2021.18.024
https://doi.org/10.11975/j.issn.1002-681...
proposed an algorithm for the detection and identification of maize crop rows based on a variety of missing plant scenarios, in which they used the HSV space for binarisation and set bar ROIs to achieve the effect of filling crop rows with absent plants. Finally, they extracted the contour with the most significant area within the dynamic ROIs to fit the crop row centreline.

In summary, it can be seen that most of the existing image processing algorithms focus on green leafy crops as the object of study. The characteristics of these are relatively pronounced, meaning that processing of image data can be realised using methods with a high accuracy of segmentation and extraction, such as the super green algorithm. However, the tops of beets need to be cut before harvesting, and the cut tops are then laid out in the field to dry, meaning that the beet rhizomes appear similar to the environmental features and are not easy to distinguish. Hence, research on crop row extraction algorithms for the visual recognition of sugar beet crop rows is still relatively limited. Recognition algorithms that were developed for green leafy crops are not applicable to the recognition and extraction of sugar beet crop rows, as this would lead to the introduction of large amounts of noise. To address this problem, this study presents an algorithm that integrates median filtering and minimum area filtering based on the characteristics of the harvesting period of the sugar beet crop rows, which is found to be better than the traditional algorithm in terms of both noise reduction and recognition results. It provides an approach for the extraction of the navigation lines of crop rows for the automatic row pairing system of a combined sugar beet harvester, which can help researchers to develop an automatic combined sugar beet harvester.

MATERIAL AND METHODS

Image Acquisition

The sugar beet planting field selected for this study is located in Siziwang Banner, Ulanchab City, Inner Mongolia Autonomous Region (Figure 1-A), which has a unique cool climate and suitable land for sugar beet planting. The total area used for sugar beet planting was about 45,000 acres; the planted beets were matured, sown in mid-April 2023, and harvested at the beginning of October. Data on sugar beet plants were collected using a camera mounted at the centre of a tractor's front cover, 60 cm above the ground (Figures 1 B and C). This was a 5-megapixel, 4K-definition CMOS camera (Figure 1 D) that was connected to a mobile phone via WIFI. The collection time was 5:30 pm, and the weather was cloudy with sufficient natural light but no direct sunlight. The field was ploughed in a double row, with a row spacing of 40 cm and a spacing of 100 cm between the ridges (Figure 2). The images collected by the device showed five ridges of sugar beet.

FIGURE 1
Image data acquisition for sugar beets: (A) sugar beet field in Siziwangqi Banner, Inner Mongolia Autonomous Region, China; (B) acquisition scene; (C) location of the data acquisition equipment; (D) data acquisition device and its parameters.

FIGURE 2
Mounting of the camera above the centre of the tractor, with a 40 cm row spacing between sugar beet rows and a 100 cm spacing between ridges.

Algorithm design

In order to provide accurate information on crop rows for the automatic row alignment system of the sugar beet harvester, static images of crops (Figure 3) taken in the field were randomly selected for algorithm testing, and dynamic

FIGURE 3
A randomly selected static image used for detection.

video images were used to verify the feasibility of our scheme when testing was complete. The main steps of the algorithm proposed in this paper include image preprocessing, greyscale transformation, image segmentation, image denoising, edge detection, a Hough linear transformation, and extraction of crop rows (Figure 4).

FIGURE 4
Flowchart for the proposed algorithm.

Image processing

The distinction between the crop foreground and soil background is typically made by extracting green features after greyscale and binarisation; however, in this particular situation, the beet crop needs to be pre-leafed and top-cut during harvest, meaning that the beet crop rows have no green features that can be extracted. The colour features of the beet crop and the soil are also very similar, causing the traditional OTSU adaptive thresholding segmentation method to have a lot of difficulty in removing noise (Figures 5 C and D); hence, accurately separating the pixels representing the sugar beet and soil is a challenging task.

Since it is challenging to extract the crop details accurately in a sugar beet field using the traditional method, we propose a sugar beet crop row recognition algorithm, in which a greyscale histogram equalisation method is used to enhance the sugar beet features, and median filtering is fused with a minimum area filtering algorithm to remove noise.

Preprocessing of images

The aim of image preprocessing is to improve the performance and effectiveness of subsequent computer vision or image processing tasks by improving the image data, suppressing unwanted distortions and enhancing certain image features that are important for post-processing (Jiang et al., 2022Jiang BY, Zhou FC, Chai Y (2022) Application of neuromorphic resistive random access memory in image processing. Acta Physica Sinica 71(14):350-370. https://doi.org/10.7498/aps.71.20220463
https://doi.org/10.7498/aps.71.20220463...
; Li et al., 2023Li XM, Hao SS, Chen SH (2023) Seabed image matching by incorporating prior knowledge. Journal of Computer-Aided Design & Computer Graphics 35(11):1743-1750. https://doi.org/10.3724/SP.J.1089.2023.19749
https://doi.org/10.3724/SP.J.1089.2023.1...
). The preprocessing steps for the image data were as follows:

1) Reading the image files. In order to reduce the amount of computation while preserving the details, each image was converted to the size of 1280×720 pixels (Figure 3).

2) Gaussian filtering. This was performed on each image of the sugar beet crop line, and the image was then smoothed. Gaussian filtering is a commonly used image smoothing method; since most of the noise in an image is Gaussian, this approach is frequently used to remove the noise and detail from the image. It is based on the principle of applying a convolution operation to the image and the region around each pixel with a defined Gaussian kernel to calculate a weighted average, as follows:

O ( x , y ) = 1 2 π σ 2 e ( x 2 u 2 ) + ( y 2 v 2 ) 2 σ 2 I ( x , y ) (1)

Where:

O(x, y) is the pixel value at coordinate (x, y) in the output image;

I(x, y) is the pixel value at coordinate (x, y) in the input image;

u and v are the coordinates of the centre position of the Gaussian kernel;

σ is the standard deviation of the Gaussian kernel.

3) Greyscaling. The Gaussian-filtered RGB image is greyscaled after calculating the region of interest (ROI), which refers to the area of interest within the image. It is necessary to focus on a specific region when carrying out image processing, in order to reduce the number of operations and interference of the results; there are five rows of sugar beet crop rows in the image, and the detection of crop rows in the non-travelling direction will cause interference with the automatic row pairing system. The ROI region was set to one beet crop row in the travelling direction (Figure 5 A).

FIGURE 5
Image preprocessing process: (A) colour ROI image used as input; (B) greyscaled image; (C) binarised image segmented by OTSU adaptive thresholding; (D) image denoised with an opening (morphology) operation.

A greyscale image has only a single channel, and this operation is therefore used to reduce the complexity of the image, enhance the contrast, reduce the amount of computation, remove noise and facilitate feature extraction.

Grey = 0.299 × R + 0.587 × G + 0.114 × B (2)

Where:

Grey is the grey value;

R, G, and B are the red, green, and blue channel values, respectively, at a given pixel point.

The greyscaling operation is generally based on weighted averaging, which is achieved by assigning different weighting coefficients to the three channels. The weighting values in this formula were proposed by Gooch, based on the principle of weighted averaging of RGB channels (Gooch et al., 2005Gooch AA, Olsen CS, Tumblin J, Gooch B (2005) Color-to-grey. ACM Transactions on Graphics (TOG) 24(3):634. https://doi.org/10.1145/1073204.1073241
https://doi.org/10.1145/1073204.1073241...
). The result of greyscaling the ROI region within an image is shown in Figure 5 B.

4) Greyscale histogram equalisation. Greyscale histogram statistics in the image of the grey level distribution, reflecting the image of each grey value and the frequency of occurrence of the relationship between the horizontal coordinate represents the grey level, the vertical coordinate represents the grey level of the number of pixels of all the grey levels, the range of grey values taken for the range of 0–255 a total of 256 grey levels. Greyscale histograms of the image can be intuitively described by the proportion of each grey level, the higher the probability of the occurrence of a particular grey level, the higher the likelihood of occurrence of a particular grey level, the higher the probability of occurrence of a particular grey level in the histogram. The higher the probability of occurrence of a grey level, the higher the "peak" in the histogram, and the lower the probability, the lower the "trough" (Xie et al., 2023Xie QY, Sun WB, Shen ZL, Zhou YC (2023) Photovoltaic infrared hot spot image segmentation method based on grey clustering. Acta Energiae Solaris Sinica 44(09):117-124. https://doi.org/19912/j.0254-0096.tynxb.2022-1809
https://doi.org/19912/j.0254-0096.tynxb....
; Zhang et al., 2024)Zhang H, Zhang TJ, Ji X, Ji B, Ji BN, Pang MK, Pan HY (2024) Characteristics of surface deformation and fracture evolution around the progressive failure of coal samples containing double circular pores. Journal of China Coal Society (2024) 1-16. https://doi.org/10.13225/j.cnki.jccs.2023.0964
https://doi.org/10.13225/j.cnki.jccs.202...
.

The steps in the histogram equalisation process are as follows:

(i) Calculate the histogram for the original ROI grey-scale map pr(rk), where rk is the number of pixels in the kth grey-scale class.

(ii) Calculate the normalised histogram pr(rk):

P r ( r k ) = p r ( r k ) M N (3)

Where:

M and N are the number of rows and columns of the image, respectively;

MN is the total number of pixels.

(iii) Calculate the cumulative distribution function Cr(rk):

C r ( r k ) = j = 0 k P r ( r j ) (4)

Where:

rj is the jth grey level.

(iv) Perform a grey scale transformation for each pixel (x,y):

g ( x , y ) = ( L 1 ) C r ( f ( x , y ) ) (5)

Where:

g(x,y) is the transformed pixel value;

f(x,y) is the original pixel value;

L is the number of grey levels.

Through the grey level histogram equalisation, the number of pixels in each grey level is redistributed, which makes the pixel grey level distribution more uniform (Figure 6 D) and improves the contrast of the image. It can be seen that the image of the main part of the beet to be identified (Figure 6 C) is more visible and has more apparent edges compared to the un-equalised image (Figure 6 A).

FIGURE 6
Comparison of greyscale histogram equalisation: (A) original greyscale map; (B) histogram of the original greyscale map; (C) greyscale map after equalisation; (D) histogram after equalisation.

5) Threshold segmentation. The purpose of threshold segmentation is to convert a greyscale image into a binary image, where the output image has only two grey levels, zero and 255. Image segmentation methods are based on the difference in pixel values between the foreground and background of the image, where target and background segmentation is achieved by setting a suitable threshold to extract helpful information from the image. The most commonly used methods are global threshold segmentation and adaptive threshold segmentation (Tang et al., 2016Tang PW, Tao HM, Xiao SZ, Fang Q (2016) Analytical comparison of adaptivity of several commonly used image segmentation algorithms. Digital Technology & Application 5:140-143. https://doi.org/10.19695/j.cnki.cn12-1369.2016.05.099
https://doi.org/10.19695/j.cnki.cn12-136...
).

The steps in the thresholding process are as follows:

  1. Choose a threshold T;

  2. For each pixel (x,y), compare its grey value f(x,y) with the threshold value T:
    • If f(x,y)≤T, then the pixel (x,y) is classified as background;

    • If f(x,y)>T, the pixel (x,y) is classified as foreground.

  3. After threshold classification, set the background pixels to zero, i.e. pure black, and the foreground pixels to 255, i.e. pure white.

The thresholding results are shown in Figure 7. Through experiments, it was found that when the threshold was set to 200, the foreground pixels of the target beet retained by the threshold segmentation were more complete, and the noise was within an acceptable range; too high a threshold caused the foreground pixel of the target beet to be missing, resulting in the loss of information about the beet, and too low a threshold produced noise that would be difficult to remove.

FIGURE 7
Images binarised with different thresholds: (A) threshold 200; (B) threshold 180; (C) threshold 220.

6) Image denoising. Sugar beet crop row images were found to have noise interference after thresholding, although the target sugar beet foreground pixels were retained, and the noise needed to be removed before subsequent processing. The most commonly used binary image denoising method is morphological processing, i.e. erosion and inflation. The erosion operation changes the shape of the image through a local minimum operation, which causes the foreground image boundary to shrink and removes fine objects and details. It can be used to eliminate noise from the image, separate connected objects, extract boundaries, etc. The expansion operation changes the shape of the image through a local maximum operation, which expands the boundaries of the foreground image. It can be used to fill the voids in the image, connect disconnected objects, expand boundaries and so on. However, after morphological processing and analysis, it was found that the denoising effect was not good, and some significant areas of noise were retained. From observing the binarised image, it was found that there was a high level of randomly distributed salt-and-pepper noise. Hence, a denoising algorithm combining median filtering and minimum area filtering, called MM-Filter, was devised for sugar beet crop fields.

Median filtering is a nonlinear filtering method that removes noise by sorting all the pixel values in the neighbourhood of the pixel, and selecting the centre of these as the value of the current pixel, thus effectively removing isolated noise points without blurring the edges and details of the image.

The minimum area filtering algorithm is a method used to remove small connected areas from an image. The principle of operation involves counting the number of pixels in each corresponding region in the image and achieving a denoising effect by setting a threshold value and marking the connected areas with values lower than this threshold as background. By traversing the foreground pixel contour after median filtering, all contour areas can be calculated and the foreground pixels that are smaller than the threshold area are transformed into background pixels by the screening function. Finally, the holes are filled by an expansion operation to highlight the features in the beet foreground. A comparison of the results is shown in Figure 8. It can be seen that unlike traditional morphological processing denoising (Figure 8 C), a combination of median filtering and minimum area filtering (Figure 8 B) for denoising not only removes most of the noise, but the beet foreground subject part is more rounded and the details of the beet crop are not lost.

FIGURE 8
Denoising effects of different algorithms: (A) original image; (B) median filtering combined with minimum area filtering for denoising; (C) morphological denoising.

Extraction of crop rows

Extraction of the rows of beets is done based on the denoised binary image, and the edges are extracted with the Canny edge detection algorithm. The row of sugar beets is then extracted using the Hough line detection algorithm and the expected straight line is retained by the screening algorithm. A flow chart for the extraction process is shown in Figure 9.

FIGURE 9
Process used to extract crop rows: (A) binarised input image; (B) Canny edge detection; (C) mapping the edges back to the original image; (D) Hough straight line detection; (E) straight line of the crop row after angle screening.

1) Edge detection. This is a commonly used image processing technique that aims to extract significant edge information from an image, which in this case involves the extraction of beet contours. Common edge detection algorithms include the Sobel, Roberts, Canny and Laplacian algorithms. Canny edge detection is a relatively complex process that can effectively extract the edge information from an image through multiple filtering and non-maximum suppression, and can obtain clear edge lines. Compared with alternative algorithms, Canny edge detection is more effective; for example, this process is more accurate (Figure 10 A) than the Sobel method (Figure 10 B) and the Roberts (Figure 10 C) algorithm, with an average time of only 0.00054 ms, whereas the Laplacian algorithm (Figure 10 D) gives similar results but with an average time of 0.00089 ms. The Canny edge detection algorithm is therefore used in this study.

FIGURE 10
Results of edge detection algorithms: (A) Canny algorithm; (B) Sobel operator; (C) Roberts operator; (D) Laplacian operator.

The process of Canny edge detection is as follows:

(i) The denoised binarised sugar beet crop row image is Gaussian filtered to obtain a smoothed image G(x,y);

(ii) The gradient (i.e., rate of change) of each foreground pixel point is calculated with the Sobel operator. This has two convolution kernels: one for calculating the gradient in the horizontal direction, and the other for calculating the gradient in the vertical direction, as follows:

G x = [ 1 0 1 2 0 2 1 0 1 ] I (6)
G y = [ 1 2 1 0 0 0 1 2 1 ] I (7)

Where:

I is the input image obtained using [eq. (1)];

Gx and Gy are the gradients in the horizontal and vertical directions, respectively.

The magnitude and direction of the gradient can be calculated using the following equation:

G = G x 2 + G y 2 (8)
θ = tan 1 G y G x (9)

Where:

G is the magnitude of the gradient;

θ is the direction of the gradient.

(iii) Non-maximum suppression (Neubeck & Gool, 2006Neubeck A, Gool LV (2006) Efficient non-maximum suppression. In: International Conference on Pattern Recognition (ICPR'06). Hong Kong, IEEE, Proceedings... https://doi.org/10.1109/ICPR.2006.479
https://doi.org/10.1109/ICPR.2006.479...
) is carried out, since the gradient amplitude image obtained by gradient computation contains a significant amount of noise and weak edges. Non-maximum suppression can remove useless information from the gradient magnitude image and retain the pixels with local maximum.

(iv) Dual thresholding is then applied. The pixels in the foreground of a gradient amplitude image are classified into three categories: strong edges, weak edges and non-edges. In general, the difference between high and low thresholds is relatively large, and pixels below the low threshold are likely to be noisy, interfering with subsequent processing, and are therefore labelled as non-edges. If the gradient magnitude of a pixel is greater than the high threshold, it is labelled as a strong edge; if the gradient magnitude of a pixel is less than the low threshold, it is labelled as a non-edge; and if the gradient magnitude of a pixel is between the two thresholds, it is labelled as a weak edge.

(v) An edge connection process is then carried out. Through the connectivity of strong edge pixels, weak edge pixels can be transformed into strong edge pixels to form the final edge image. For each strong edge pixel, the algorithm iterates through its eight neighbouring pixels, and if the pixel is a weak edge, it is marked as a strong one.

The above process is repeated until all the weak edge pixels are labelled as strong edges, and the final image obtained is the beet edge detection result (Figure 9 B). The edge detection of the binary image is completed by Canny edge detection and mapped back to the original image to see whether it meets the requirements (Figure 9 C). It can be noticed that although the non-beet portion can still be detected, the effect on the extraction of the sugar beet crop rows was found to be negligible after the test.

2) Straight line fitting. The Hough line detection algorithm is used to fit the results of edge detection to extract crop rows. The main process is as follows:

(i) The Hough transform space is constructed. A curve is built in the Hough transform space for each beet edge pixel to represent the possible straight lines. A straight line can be defined as:

x cos ( θ ) + y sin ( θ ) = r (10)

Where:

x and y are the pixel positions in the image;

r and θ represent the distance from the line to the origin and the angle from the x-axis, respectively.

In the Hough transform space, r and θ as the horizontal and vertical axes respectively respectively, and for each edge pixel, a curve is added to the Hough transform space. If more than one straight line passes through the same point, the counter at that point is incremented.

(ii) Calculation of the straight line parameters. In the Hough transform space, a search is carried out for the point with the largest counter; if the counter at a given point is greater than a predetermined threshold, this indicates that a straight crop line may exist at that point. Based on the values of θ at that point, the parameters of the straight line can be calculated to obtain the position of the line as follows:

x 0 = r cos ( θ ) (11)
y 0 = r sin ( θ ) (12)

Where:

(x0,y0) is a point on a straight line.

By calculating the parameters of the straight line, its position can be determined and displayed on the original image. The threshold for Hough line detection is set, and the result in the form of a detected line is output. It was found that straight lines that met the threshold conditions in all directions were detected (Figure 9 D), so it was necessary to filter the results by angle, to exclude the results that were obviously not realistic (Figure 9 E). The filtered line detection results are mapped back to the original map to complete the extraction of sugar beet crop rows, as shown in Figure 11.

FIGURE 11
Extraction results for a row of sugar beets.

RESULTS AND DISCUSSION

In order to explore the performance and real-time operation of the algorithm, it was compared with the traditional algorithm. Under the condition of dealing with the same task, this algorithm shows better performance than the traditional algorithm. According to the experimental results (Figure 12), the standard deviation for the proposed algorithm is 1.0 ms. In comparison, the standard deviation of the traditional algorithm is 1.328 ms, implying that the present algorithm is more stable in terms of running time and has less fluctuation in the average running time. In addition, the average running time of the present algorithm is 11.751 ms compared to 12.622 ms for the conventional algorithm. The proposed algorithm also improves on the average runtime with respect to the conventional algorithm, reducing the processing time by about 0.871 ms and increasing the computing speed by 6.9%.

FIGURE 12
Running speeds of the present algorithm and the conventional algorithm, with the number of runs shown on the horizontal axis and the running time on the vertical axis: (A) results for the proposed algorithm, with a mean running time of 11.751 ms and a standard deviation of 1.0 ms; (B) results for the conventional algorithm, with a mean running time of 12.622 ms and a standard deviation of 1.328 ms.

At the same time, the 24-frame rate video data was introduced to slice it for processing, and a counter was introduced to record the number of frames and the total number of frames in which the rows of the sugar beet crop were detected. A total of 388 images were processed, and the number of images in which straight lines were detected by the present algorithm was 352; this gave an extraction rate of 90.7%, which was superior to the rate for the traditional algorithm, which was 82.4%.

In summary, the present algorithm is significantly better than the traditional algorithm in terms of performance and real-time operation, with a smaller standard deviation and shorter average running time, while the real-time extraction rate is higher than that of the traditional algorithm, thus providing a more efficient and stable processing capability.

In addition, in the research process of this algorithm, because the sugar beet combine harvester has not been put into use, information such as the travel speed and navigation angle of the combine harvester was not obtained to supplement the navigation line extraction work and experimental verification. Sugar beet crop rows are only extracted by the algorithm and problems in the algorithm will be optimised by the data provided by the improved sugar beet combine.

CONCLUSIONS

The proposed algorithm uses OpenCV to extract the straight lines of sugar beet rows through Gaussian filtering, histogram equalisation, MM-Filter (based on median filtering and minimum area filtering), edge detection and Hough line detection. An extraction algorithm for sugar beet crop rows based on a combination of median filtering and minimum area filtering algorithm has been presented.

Through experiments, we found that the extraction rate of this algorithm for single image to continuous video images reached 90.7%. The previous frame retention algorithm ensured that there were no gaps, and the noise filtering ability was improved by 56.6%. Subject to ensuring the integrity of the target object, the time required for single image processing was only 11.751 ms, a result 6.9% higher than that of the traditional algorithm. Our algorithm therefore satisfies the requirements for real-time navigation line extraction, and is a feasible approach.

The sugar beet crop row extraction algorithm can accurately detect crop rows from an image, and provides reliable information about the crop rows during the harvesting of the sugar beet combine; this enables damage to the crop to be avoided, and provides a new approach to the recognition of the automatic row alignment system of the sugar beet combine based on visual recognition.

In future research, we will optimise the algorithm presented here and apply it to sugar beet in different scenarios, with farming practices, to further improve the robustness of the algorithm and its adaptability to complex agricultural scenarios.

ACKNOWLEDGMENTS

The authors gratefully acknowledge the Inner Mongolia Autonomous Region Key R&D and Achievement Transformation Programme Project (Grant Nos.2022YFHH0122), and would like to thank the editors and reviewers for their valuable comments and constructive suggestions.

REFERENCES

  • Garcia-Santillan I, Miguel Guerrero J, Montalvo M, Pajares G (2018) Curved and straight crop row detection by accumulation of green pixels from images in maize fields. Precision Agriculture 19:18-41. https://doi.org/10.1007/s11119-016-9494-1
    » https://doi.org/10.1007/s11119-016-9494-1
  • Gooch AA, Olsen CS, Tumblin J, Gooch B (2005) Color-to-grey. ACM Transactions on Graphics (TOG) 24(3):634. https://doi.org/10.1145/1073204.1073241
    » https://doi.org/10.1145/1073204.1073241
  • Guo XY, Xu XY (2021) Extraction of navigation lines for rice seed farming based on machine vision. Journal of Chinese Agricultural Mechanization 42(5): 197-201. https://doi.org/10.13733/j.jcam.issn.2095 5553.2021.05.27
    » https://doi.org/10.13733/j.jcam.issn.2095 5553.2021.05.27
  • Han CJ, Zheng K, Zhao XG, Zheng SY, Fu H, Zhai CY (2022) Design and experiment of row identification and row-oriented spray control system for field cabbage crops. Transactions of the Chinese Society for Agricultural Machinery 53(06):89-101. https://doi.org/10.6041/j.issn.1000-1298.2022.06.009
    » https://doi.org/10.6041/j.issn.1000-1298.2022.06.009
  • Jiang BY, Zhou FC, Chai Y (2022) Application of neuromorphic resistive random access memory in image processing. Acta Physica Sinica 71(14):350-370. https://doi.org/10.7498/aps.71.20220463
    » https://doi.org/10.7498/aps.71.20220463
  • Li X, Su JH, Yue ZC, Wang SC, Zho HB (2022) extracting navigation line to detect the maize seedling line using median-point hough transform. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE) 38(5):167-174. https://doi.org/10.11975/j.issn.1002-6819.2022.05.020
    » https://doi.org/10.11975/j.issn.1002-6819.2022.05.020
  • Li XG, Zhao W, Zhao LL (2021) Extraction Algorithm of the center line of maize row in case of plants lacking. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE) 37(18):203-210. https://doi.org/10.11975/j.issn.1002-6819.2021.18.024
    » https://doi.org/10.11975/j.issn.1002-6819.2021.18.024
  • Li XM, Hao SS, Chen SH (2023) Seabed image matching by incorporating prior knowledge. Journal of Computer-Aided Design & Computer Graphics 35(11):1743-1750. https://doi.org/10.3724/SP.J.1089.2023.19749
    » https://doi.org/10.3724/SP.J.1089.2023.19749
  • Liu H, Gong JL, Zhang YF (2022) Extraction method of small agricultural AGV navigation baseline based on crop row characteristics. Journal of Jiangsu University (Natural Science Edition) 43(03):296-301. https://doi.org/10.3969/j.issn.1671-7775.2022.03.008
    » https://doi.org/10.3969/j.issn.1671-7775.2022.03.008
  • Mitsuhashi T, Chida Y, Tanemura M (2019) Autonomous travel of lettuce harvester using model predictive control. IFAC 52(30):155-162. https://doi.org/10.1016/j.ifacol.2019.12.514
    » https://doi.org/10.1016/j.ifacol.2019.12.514
  • Neubeck A, Gool LV (2006) Efficient non-maximum suppression. In: International Conference on Pattern Recognition (ICPR'06). Hong Kong, IEEE, Proceedings... https://doi.org/10.1109/ICPR.2006.479
    » https://doi.org/10.1109/ICPR.2006.479
  • Tan WH, Sang YY, Hu MY, Shen K, Zhang WQ, Song YY (2022) Design of automatic navigation system for highland gap sprayer based on machine vision. Journal of Agricultural Mechanization Research 44(01):130-136. https://doi.org/10.13427/j.cnki.njyi.2022.01.022
    » https://doi.org/10.13427/j.cnki.njyi.2022.01.022
  • Tang PW, Tao HM, Xiao SZ, Fang Q (2016) Analytical comparison of adaptivity of several commonly used image segmentation algorithms. Digital Technology & Application 5:140-143. https://doi.org/10.19695/j.cnki.cn12-1369.2016.05.099
    » https://doi.org/10.19695/j.cnki.cn12-1369.2016.05.099
  • Wang AC, Zhang M, Liu QS, Wang LL, Wei XH (2021b) Seedling crop row extraction method based on regional growth and mean shift clustering. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE) 37(19):202-210. https://doi.org/10.11975/j.issn.1002-6819.2021.19.023
    » https://doi.org/10.11975/j.issn.1002-6819.2021.19.023
  • Wang FY, Zhang DX (2015) Parameter optimization and test on auto guide device for disc type sugar beet harvester. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE) 31(8): 27-33. https://doi.org/10.3969/j.issn.1002-6819.2015.08.005
    » https://doi.org/10.3969/j.issn.1002-6819.2015.08.005
  • Wang Q, Meng ZZ, Fu WQ, Liu H, Zhang ZG (2021a) Detection algorithm of multiple crop row lines based on machine vision in maize seedling stage. Transactions of the Chinese Society for Agricultural Machinery 52(04):208-220. https://doi.org/10.6041/j.issn.1000-1298.2021.04.022
    » https://doi.org/10.6041/j.issn.1000-1298.2021.04.022
  • Wang SY, Hu ZC, CHEN C, Gao XM, Gu FW, Wu HC (2020) Bench test and analysis on performance of autofollow row for traction sugar beet combine harvester. Transactions of the Chinese Society for Agricultural Machinery 51(04):103-112+163. https://doi.org/10.6041/j.issn.1000-1298.2020.04.012
    » https://doi.org/10.6041/j.issn.1000-1298.2020.04.012
  • Wang SY, Hu ZC, Zhang HJ, Wu HC, Peng BL, Gu FW (2013) Sugar beet production and mecha-nization harvest analysis in domestic and overseas. Journal of Chinese Agricultural Mechanization 34 (3): 20-25. https://doi.org/10.3969/j.issn.2095-5553.2013.03.006
    » https://doi.org/10.3969/j.issn.2095-5553.2013.03.006
  • Xie F, Dong MZ (2021) An improved attitude compensation algorithm for SINS/GNS integrated navigation system. Journal of Sensors 2021:1-9. https://doi.org/10.1155/2021/5525481
    » https://doi.org/10.1155/2021/5525481
  • Xie QY, Sun WB, Shen ZL, Zhou YC (2023) Photovoltaic infrared hot spot image segmentation method based on grey clustering. Acta Energiae Solaris Sinica 44(09):117-124. https://doi.org/19912/j.0254-0096.tynxb.2022-1809
    » https://doi.org/19912/j.0254-0096.tynxb.2022-1809
  • Yang SQ, Lin FS, Xu PH, Wang PF, Wang S, Ning JF (2023) Planting row detection of multi-growth winter wheat field based on UAV remote sensing image. Transactions of the Chinese Society for Agricultural Machinery 54(02):181-188. https://doi.org/10.6041/j.issn.1000-1298.2023.02.017
    » https://doi.org/10.6041/j.issn.1000-1298.2023.02.017
  • Zhang H, Zhang TJ, Ji X, Ji B, Ji BN, Pang MK, Pan HY (2024) Characteristics of surface deformation and fracture evolution around the progressive failure of coal samples containing double circular pores. Journal of China Coal Society (2024) 1-16. https://doi.org/10.13225/j.cnki.jccs.2023.0964
    » https://doi.org/10.13225/j.cnki.jccs.2023.0964
  • Zhang ZQ, Li SC, Li CY, Cao RY Zhang M, Li H, Li XH (2021) Navigation path detection method for a banana orchard inspection robot based on binocular vision. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE) 37(21):9-15. https://doi.org/10.11975/j.issn.1002-6819.2021.21.002
    » https://doi.org/10.11975/j.issn.1002-6819.2021.21.002
  • Zhilenkov A, Chernys S, Sokolov S, Nyrkov A (2020) Intelligent autonomous navigation system for UAV in randomly changing environmental conditions. Journal of intelligent & fuzzy systems: Applications in Engineering and Technology 38(5):6619-6625. https://doi.org/10.3233/jifs-179741
    » https://doi.org/10.3233/jifs-179741

Edited by

Area Editor: Fábio Lúcio Santos

Publication Dates

  • Publication in this collection
    19 July 2024
  • Date of issue
    2024

History

  • Received
    03 Mar 2024
  • Accepted
    20 May 2024
Associação Brasileira de Engenharia Agrícola SBEA - Associação Brasileira de Engenharia Agrícola, Departamento de Engenharia e Ciências Exatas FCAV/UNESP, Prof. Paulo Donato Castellane, km 5, 14884.900 | Jaboticabal - SP, Tel./Fax: +55 16 3209 7619 - Jaboticabal - SP - Brazil
E-mail: revistasbea@sbea.org.br