Crop row center line extraction method based on regional feature point clustering
Through the clustering method of regional feature point, the DBSCAN algorithm and median point extraction technology are used to solve the problem of low crop row recognition accuracy in automatic navigation of agricultural machinery, and efficient and accurate crop row centerline extraction is achieved, reducing cost and calculation complexity.
Patent Information
- Application Number
- CN202411373536.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-28
AI Technical Summary
The existing agricultural machinery automatic navigation technology has problems such as low accuracy, high cost, and susceptible to light and weather when identifying crop row characteristic information. Especially in complex field environments, the recognition ability is limited, resulting in misguiding or inability to identify crop rows.
The method of clustering of feature points by region is adopted, and the fields are taken through cameras installed on agricultural machinery, pre-processing and feature extraction are performed. The crop feature points are clustered using the DBSCAN algorithm, and the feature point clustering diagram is then divided into horizontal strip areas, and the median point extraction and linear fitting are performed to obtain the center line of the crop row.
It realizes high-precision identification of crop row center lines, reduces calculation complexity and cost, improves navigation accuracy and reliability, and is suitable for a variety of crop row structures, significantly reduces running time, and enhances the application value of agricultural automation and intelligent agricultural machinery systems.
Smart Images

Figure CN119540572A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of crop row centerline extraction methods, and in particular to a crop row centerline extraction method based on regional feature point clustering. Background Art
[0002] With the rapid development of smart agriculture and precision agriculture, agricultural machinery automatic navigation technology has become one of the key technologies in the agricultural field. It is not only widely used in various agricultural production activities such as ploughing, weeding, sowing, spraying, fertilizing, and harvesting, but also continues to expand its application scope. Smart agriculture uses high-tech technologies such as the Internet of Things, big data, and artificial intelligence to achieve intelligent, information-based, and precise management of agricultural production, improve production efficiency, respond to challenges such as climate change and resource shortages, and promote sustainable agricultural development. As an important part of smart agriculture, agricultural machinery automatic navigation technology improves operating efficiency, reduces labor intensity and production costs, and improves operating quality and consistency through precise positioning and path planning.
[0003] At present, the main navigation technologies used include satellite navigation and machine vision. Satellite navigation often uses the differential global navigation satellite system (GNSS) to achieve centimeter-level positioning. However, the high-precision differential global navigation satellite system equipment is relatively expensive. For small farms and individual farmers, the initial investment is large, and it is easily blocked by trees and cannot perceive the characteristic information of the current crop rows.
[0004] Visual navigation also has drawbacks in the automatic navigation of agricultural machinery. It is sensitive to lighting and weather conditions and is easily affected by insufficient light and bad weather, resulting in reduced navigation accuracy. In addition, when the visual system captures, processes and responds to changes in crop rows in real time, it requires high-speed data processing capabilities and fast algorithm execution to ensure the real-time and response speed of the system. These factors limit its widespread adoption and reliability in efficient automatic navigation applications, especially in complex field environments with limited recognition capabilities, such as areas with dense trees, shadows and weeds, and often cause problems with misnavigation or failure to recognize crop rows. Summary of the invention
[0005] The purpose of the present invention is to provide a crop row centerline extraction method based on regional feature point clustering, which has the characteristics of high recognition accuracy, short calculation time and low cost, and avoids the problem of agricultural machinery mis-navigation or failure to recognize crop rows.
[0006] The technical solution adopted by the present invention to solve the above technical problems is: a method for extracting the center line of a crop row by clustering regional feature points, which is suitable for fields where multiple rows of crops are planted in parallel and spaced apart. By extracting the center line of the crop row, agricultural machinery is navigated so that the agricultural machinery can move between two adjacent rows of crops, comprising the following steps: Step 1: When the agricultural machinery approaches the field along the length direction of the crop row, the field is photographed by a camera installed on the agricultural machinery, and then the image is preprocessed and feature extracted to obtain a crop feature point map; Step 2: Cluster crop feature points using the DBSCAN algorithm First, randomly select a feature point, take the distance threshold epsilon as the neighborhood radius, calculate the number of other feature points in the neighborhood of the feature point, when the number of points is less than the threshold number min_samples, mark the feature point as a noise point, when the number of points is not less than the threshold number min_samples, mark the feature point as a core point, and add other feature points in the neighborhood to the feature point cluster of the core point; Then the feature point cluster is expanded, and the number of points in the neighborhood range of other added feature points is calculated respectively. When the number of points is not less than the threshold number min_samples, the feature points in the newly calculated neighborhood range are added to the feature point cluster, and the number of points in the neighborhood range of the newly added feature points is continued to be calculated until the number of points in the neighborhood range of all newly added feature points in the feature point cluster is less than the threshold number min_samples, then the expansion of the feature point cluster is stopped; A feature point that does not belong to a feature point cluster and is not marked as a noise point is randomly selected again, and the above process is repeated until all feature points belong to a feature point cluster or are marked as noise points, thereby obtaining multiple feature point clusters corresponding to multiple crop rows, and marking the multiple feature point clusters with different colors to obtain a feature point clustering diagram; Step 3: Divide the feature point clustering map into multiple horizontal strip areas connected in sequence along the height direction, scan all horizontal strip areas respectively, identify the feature points belonging to different feature point clusters in the horizontal strip areas by color, and then extract the median points of the feature points belonging to the same feature point cluster, take the feature point at the center of the same color range in the horizontal strip area as the median point, and discard other feature points except the median point; Step 4: Match the median points on all horizontal strip areas by color, and then use the least squares method to perform straight line fitting on the median points of the same color to obtain the center lines of all crop rows within the camera's shooting range.
[0007] Preferably, in step 2, when there are multiple types of crops, the crop types are first identified, and different distance thresholds epsilon and threshold numbers min_samples are allocated to different types of crops.
[0008] According to the above technical solution, the beneficial effects of the present invention are: The present invention adopts the DBSCAN algorithm for clustering, and does not need to know the number of crop rows in advance, and automatically identifies crop rows through cluster analysis. This method not only reduces complexity, but is also easier to implement. At the same time, the DBSCAN algorithm has strong robustness and adaptability, can maintain high reliability in the case of noise and uneven data density, is more flexible in the implementation process, and can provide stable and accurate navigation effects, further enhancing the application value of agricultural automation and intelligent agricultural machinery systems. The present invention can effectively improve the recognition accuracy, make the extracted crop row center line more accurate and reliable, optimize the calculation process, significantly reduce the running time, thereby improving the overall efficiency, and meet the high efficiency requirements in practical applications. In addition, the method of the present invention is applicable to a variety of different types of crop row structures, has wide adaptability and versatility, and has important application value and prospects in the fields of agricultural automation, intelligent agricultural machinery systems, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 is a flow chart of the method of the present invention; Figure 2 It is the feature point clustering diagram obtained in step 2; Figure 3 Schematic diagram of dividing the horizontal strip area and extracting the median point in step 3; Figure 4 This is the effect diagram after the median point is extracted; Figure 5 The crop row centerline effect diagram is obtained after performing straight line fitting on the median point; Figure 6 This is a comparison chart of the centerline extraction effects of the method of the present invention and the Hough transform method on four types of crops. DETAILED DESCRIPTION
[0010] A crop row centerline extraction method based on regional feature point clustering is suitable for fields where multiple rows of crops are planted in parallel and at intervals. Agricultural machinery is navigated by extracting the crop row centerline so that the agricultural machinery can move between two adjacent rows of crops.
[0011] The process of this method is as follows Figure 1 As shown, the specific steps include: Step 1: When the agricultural machinery approaches the field along the length direction of the crop row, the field is photographed by a camera installed on the agricultural machinery, and then the image is preprocessed and feature extracted to obtain a crop feature point map.
[0012] Step 2: Cluster crop feature points using the DBSCAN algorithm First, a feature point is randomly selected, and the distance threshold epsilon is used as the neighborhood radius. The number of other feature points in the neighborhood of the feature point is calculated. When the number of points is less than the threshold number min_samples, the feature point is marked as a noise point. When the number of points is not less than the threshold number min_samples, the feature point is marked as a core point, and other feature points in the neighborhood are added to the feature point cluster of the core point. When there are multiple types of crops, the crop types are first identified, and different distance thresholds epsilon and thresholds min_samples are assigned to different types of crops.
[0013] Then the feature point cluster is expanded, and the number of points in the neighborhood range of other added feature points is calculated respectively. When the number of points is not less than the threshold number min_samples, the newly calculated feature points in the neighborhood range are added to the feature point cluster, and the number of points in the neighborhood range of the newly added feature points is continued to be calculated until the number of points in the neighborhood range of all newly added feature points in the feature point cluster is less than the threshold number min_samples, then the expansion of the feature point cluster is stopped.
[0014] A feature point that does not belong to a feature point cluster and is not marked as a noise point is randomly selected again, and the above process is repeated until all feature points belong to a feature point cluster or are marked as noise points. Multiple feature point clusters corresponding to multiple crop rows are obtained, and different colors are marked on the multiple feature point clusters to obtain a feature point clustering diagram, such as Figure 2 shown.
[0015] Step 3: Divide the feature point clustering map into multiple horizontal strip areas connected in sequence along the height direction, scan all horizontal strip areas separately, identify the feature points belonging to different feature point clusters in the horizontal strip areas by color, and then extract the median points of the feature points belonging to the same feature point cluster, take the feature point at the center of the same color range in the horizontal strip area as the median point, and discard other feature points except the median point.
[0016] like Figure 3As shown, within the same horizontal strip area, starting from the original photographed image in the first row, the second row is the preprocessed image, the third row is the crop feature point map after feature extraction, the fourth row is the clustered and color-marked feature point cluster map, which is a horizontal strip area actually divided in step three, and the fifth row is the median points of four different colors obtained after median point extraction of feature points in different color ranges in the horizontal strip area.
[0017] Step 4: Match the median points on all horizontal strip areas by color to obtain Figure 4 Then, the least square method is used to fit the median points of the same color to obtain the center lines of all crop rows within the camera shooting range, as shown in Figure 5 As shown in the line segments of different colors, the agricultural machinery can avoid the crop rows and realize the navigation of the agricultural machinery by moving along the middle position of the two line segments.
[0018] The method of the present invention and the traditional Hough transform method were used to extract the centerline of crops from 120 images in four scenes. The average recognition rate of crop rows of the present invention was 98.33%, which was higher than the 70.77% of the Hough transform method. Figure 6 As shown, the first column is the original photographed images, the second column is the preprocessed images, the third column is the median point extraction image of the present invention, the fourth column is the final crop row extraction effect of the present invention, and the fifth row is the final crop row extraction effect of the Hough transform method. The crops in the first row are sweet potatoes, the crops in the second row are mint, the crops in the third row are corn, and the crops in the fourth row are peanuts.
[0019] In the sweet potato image, since the sweet potato grows vigorously, the row spacing is small, and the leaves easily overlap each other, the difficulty of crop row extraction is increased. The Hough transform method is very dependent on the cumulative threshold for the recognition of the number of rows, and the calculation time is long. The row recognition rate is 66.67%, and the average error angle is 6.60°. The method of the present invention can completely extract all visible crop rows in the sweet potato image, including the areas with dense crops on both sides. The row recognition rate reaches 100%, and the average error angle is only 0.76°. In the extraction of mint crop rows, except for the crop rows with unclear color features at the edge, the method of the present invention can accurately identify all crop rows that can be binarized; in contrast, due to the image perspective, some crop rows in the image are short and do not penetrate the image. The Hough transform only identifies the crop rows with weak image perspective in the middle area, and the row recognition rate is only 65.00%, and the average error angle is higher than that of the present invention. Due to the lack of corn seedlings and the large spacing between corn plants in the corn image, the crops are discontinuous in the binary image, and the crop rows extracted by Hough transform are significantly different from the reference crop rows, with an average error angle of 3.31°. In contrast, the method of the present invention relies on continuously expanding the search radius during the clustering process to ensure that the crops are effectively clustered, with an average error angle of 1.05°.
[0020] Based on the crop row extraction results of four crops, the method of the present invention is superior to the traditional Hough transform in terms of row recognition rate, average error angle and average processing time. The average row recognition rate reaches 98.33%, the average error angle is 0.95°, and the average processing time for crop row extraction of each image is 136.14 ms, which is much lower than the average processing time of Hough transform of 205.36 ms. It can effectively improve the recognition accuracy and significantly reduce the running time, thereby improving the overall efficiency. It is suitable for a variety of different types of crop row structures, has wide adaptability and versatility, and has important application value and prospects in the fields of agricultural automation, intelligent agricultural machinery systems, etc.
Claims
1. A method for extracting the center line of a crop row by clustering regional feature points, which is suitable for fields where multiple rows of crops are planted in parallel and spaced apart. By extracting the center line of the crop row, agricultural machinery is navigated so that the agricultural machinery can move between two adjacent rows of crops. The method is characterized in that: The following steps are involved: Step 1: When the agricultural machinery approaches the field along the length direction of the crop row, the field is photographed by a camera installed on the agricultural machinery, and then the image is preprocessed and feature extracted to obtain a crop feature point map; Step 2: Cluster crop feature points using the DBSCAN algorithm First, randomly select a feature point, take the distance threshold epsilon as the neighborhood radius, calculate the number of other feature points in the neighborhood of the feature point, when the number of points is less than the threshold number min_samples, mark the feature point as a noise point, when the number of points is not less than the threshold number min_samples, mark the feature point as a core point, and add other feature points in the neighborhood to the feature point cluster of the core point; Then the feature point cluster is expanded, and the number of points in the neighborhood range of other added feature points is calculated respectively. When the number of points is not less than the threshold number min_samples, the feature points in the newly calculated neighborhood range are added to the feature point cluster, and the number of points in the neighborhood range of the newly added feature points is continued to be calculated until the number of points in the neighborhood range of all newly added feature points in the feature point cluster is less than the threshold number min_samples, then the expansion of the feature point cluster is stopped; A feature point that does not belong to a feature point cluster and is not marked as a noise point is randomly selected again, and the above process is repeated until all feature points belong to a feature point cluster or are marked as noise points, thereby obtaining multiple feature point clusters corresponding to multiple crop rows, and marking the multiple feature point clusters with different colors to obtain a feature point clustering diagram; Step 3: Divide the feature point clustering map into multiple horizontal strip areas connected in sequence along the height direction, scan all horizontal strip areas respectively, identify the feature points belonging to different feature point clusters in the horizontal strip areas by color, and then extract the median points of the feature points belonging to the same feature point cluster, take the feature point at the center of the same color range in the horizontal strip area as the median point, and discard other feature points except the median point; Step 4: Match the median points on all horizontal strip areas by color, and then use the least squares method to perform straight line fitting on the median points of the same color to obtain the center lines of all crop rows within the camera's shooting range.
2. The method for extracting the centerline of a crop row by clustering regional feature points according to claim 1, characterized in that: In step 2, when there are multiple types of crops, the crop types are first identified, and different distance thresholds epsilon and threshold numbers min_samples are assigned to different types of crops.