A method, device, equipment and storage medium for identifying navigation lines between crop rows
By obtaining the depth map and two-dimensional point cloud of crop rows, fitting the inter-row navigation route, the problem of poor recognition effect in traditional technology when branches and leaves are lush and weeds is large, and high-precision inter-row navigation route recognition is achieved .
Patent Information
- Application Number
- CN202411336544.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The current inter-row navigation line recognition technology has poor recognition effect when branches and leaves are lush and weeds are high, and the navigation line cannot even be recognized.
By obtaining the depth map for rows between rows, determine the two-dimensional point cloud that constitutes the crop rows on both sides of rows, and fit the row lines to obtain the inter-row navigation route. This method uses point cloud information from the depth map to identify the overall characteristics of crop rows without relying on obstructed tree roots.
In the case of more weeds and branches and leaves, high-precision recognition of inter-row navigation lines can be achieved, solving the problem of poor recognition effect of traditional visual routes.
Smart Images

Figure CN118857306B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural machinery, and in particular to a method, device, equipment and storage medium for identifying navigation lines between crop rows. Background Art
[0002] Traditional crop planting management relies heavily on manual operations, which are labor-intensive and inefficient. In recent years, with the development of inter-row navigation line recognition technology, agricultural machinery can automatically identify inter-row navigation lines and perform precise operations, reducing labor intensity and manpower requirements, improving operation speed and crop management accuracy, and facilitating the automation and unmanned operation of agricultural operations.
[0003] Current inter-row navigation mainly relies on Real Time Kinematic (RTK) technology. However, when blocked by high obstacles such as tree canopies, the RTK signal may become unstable or even unavailable. To solve this problem, perception technology is usually used to identify and track navigation routes as an alternative when the RTK signal is unstable. Perception technology currently mainly uses visual routes to identify navigation lines. Visual routes are currently based on deep learning, and deep learning has poor recognition effects when there are lush branches and leaves and a lot of weeds, and may even fail to identify the navigation line. Therefore, the current inter-row navigation line recognition technology still has certain drawbacks. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method, device, equipment and storage medium for identifying navigation lines between crop rows to solve the above technical problems.
[0005] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: a method for identifying navigation lines between crop rows, comprising: obtaining a depth map for the row space; determining a two-dimensional point cloud of crop rows located on both sides of the row space based on the depth map, the crop rows representing rows formed by crops planted on the same ridge; fitting row lines of the crop rows located on both sides of the row space based on the two-dimensional point cloud; fitting row navigation lines based on the row lines of the crop rows located on both sides of the row space.
[0006] The beneficial effects of the present invention are as follows: the method processes the depth map to screen out effective points for crop row positioning, and draws inter-row navigation lines accordingly. The method obtains inter-row navigation lines by identifying the point cloud information of the entire crop row, and does not rely on tree roots blocked by branches and leaves, weeds, so that in situations with more weeds and branches and leaves, high-precision identification of inter-row navigation lines can still be achieved.
[0007] Based on the above technical solution, the present invention can also be improved as follows.
[0008] Furthermore, the method also includes: for each pixel in the depth map, determining whether the depth value corresponding to the pixel is greater than a preset first value, and when the depth value corresponding to the pixel is greater than the first value, removing the pixel from the depth map.
[0009] The beneficial effect of adopting the above further solution is that the depth information error of distant points is relatively large, so the pixel points with large depth values are removed to improve the accuracy of subsequent calculations.
[0010] Furthermore, the method of determining a two-dimensional point cloud constituting crop rows located on both sides of the row space based on the depth map comprises: converting each pixel point in the depth map into a world coordinate system to generate a point cloud; the world coordinate system takes the projection point on the ground of the initial position of the camera that takes the depth map as the origin, the longitudinal axis of the world coordinate system is parallel to the orientation of the body of the agricultural machinery on which the camera is installed, and the transverse axis of the world coordinate system is located on the same horizontal plane as the longitudinal axis of the world coordinate system; projecting each point in the point cloud onto a two-dimensional plane formed by the transverse axis and the longitudinal axis to generate a two-dimensional plane map; and clustering each point in the two-dimensional plane map to obtain a two-dimensional point cloud constituting crop rows located on both sides of the row space.
[0011] Furthermore, the method also includes: for each point in the point cloud, determining whether the horizontal axis coordinate value of the point is within a preset first interval and whether the vertical axis coordinate value of the point is within a preset second interval; if the horizontal axis coordinate value of the point is not within the first interval or the vertical axis coordinate value of the point is not within the second interval, removing the point from the point cloud.
[0012] Furthermore, clustering the points in the two-dimensional plane map to obtain a two-dimensional point cloud constituting the crop rows located on both sides of the row space includes:
[0013] S101, among all points with positive horizontal axis coordinate values in the two-dimensional plane graph, the position of the point closest to the origin is taken as the starting point of the first cluster;
[0014] S102, determining a first range with the first cluster starting point as the center and a preset second value as the radius;
[0015] S103, taking the position of the point farthest from the origin among all the points within the first range as a new first clustering starting point, and intercepting and saving all the points within the first range in the two-dimensional plane map;
[0016] S104, taking the new first cluster starting point as the center and the preset second value as the radius to determine a new first range, and judging whether the new first range does not contain any point, if so, executing S105, otherwise, taking the new first range as the first range in S103, and executing S103;
[0017] S105, using all the saved points as a two-dimensional point cloud constituting a crop row located on one side of the row space;
[0018] S106, among all points with negative horizontal axis coordinate values in the two-dimensional plane graph, the position of the point closest to the origin is taken as the starting point of the second clustering;
[0019] S107, determining a second range with the second cluster starting point as the center and a preset second value as the radius;
[0020] S108, taking the position of the point farthest from the origin among all the points within the second range as a new second clustering starting point, and intercepting and saving all the points within the second range in the two-dimensional plane map;
[0021] S109, determining a new second range with the new second cluster starting point as the center and the preset second value as the radius, and determining whether the new second range does not contain any point, if so, executing S110, otherwise, taking the new second range as the second range in S108, and executing S108;
[0022] S110, using all the saved points as a two-dimensional point cloud constituting the crop row located on the other side of the row space.
[0023] Furthermore, fitting the row lines of the crop rows located on both sides of the row space respectively according to the two-dimensional point cloud includes: fitting the row lines of the crop rows located on both sides of the row space respectively according to the two-dimensional point cloud by using a RANSAC algorithm.
[0024] In order to solve the above technical problems, the present invention also provides a device for identifying navigation lines between crop rows, comprising:
[0025] An image acquisition module, used to acquire a depth map for a row;
[0026] A screening module, for determining, based on the depth map, a two-dimensional point cloud constituting crop rows located on both sides of the row interval, wherein the crop rows represent rows formed by crops planted on the same ridge;
[0027] A row line fitting module is used to fit the row lines of the crop rows located on both sides of the row space according to the two-dimensional point cloud;
[0028] The inter-row navigation line fitting module is used to fit the inter-row navigation line according to the row lines of the crop rows located on both sides of the inter-row space.
[0029] Furthermore, the device also includes: a preprocessing module, which is used to determine, for each pixel in the depth map, whether the depth value corresponding to the pixel is greater than a preset first value, and when the depth value corresponding to the pixel is greater than the first value, remove the pixel from the depth map.
[0030] In order to solve the above technical problems, the present invention also provides an electronic device, including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for identifying navigation lines between crop rows as described above is implemented.
[0031] In order to solve the above technical problems, the present invention also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute a method for identifying navigation lines between crop rows as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a schematic diagram of the RTK positioning method;
[0033] Figure 2 This is a schematic diagram of the results of using the deep learning model to predict the navigation lines between rows;
[0034] Figure 3 This is a schematic diagram of a vineyard with weeds and lush branches and leaves;
[0035] Figure 4 This is a flow chart of a method for identifying navigation lines between crop rows according to the present invention;
[0036] Figure 5 A depth map of a method for identifying navigation lines between crop rows according to the present invention;
[0037] Figure 6 A schematic diagram of the installation of a depth camera for a method for identifying navigation lines between crop rows according to the present invention;
[0038] Figure 7 A point cloud schematic diagram of a method for identifying navigation lines between crop rows according to the present invention;
[0039] Figure 8 A two-dimensional plane diagram of a method for identifying navigation lines between crop rows according to the present invention;
[0040] Fig. 9 A schematic diagram of a neighbor clustering algorithm for a method for identifying navigation lines between crop rows according to the present invention;
[0041] Fig.10 It is a schematic diagram of laying true value ribbons of a method for identifying navigation lines between crop rows of the present invention;
[0042] Fig.11 A comparison diagram of the fitting results and the true value of a method for identifying navigation lines between crop rows according to the present invention;
[0043] Fig.12 The present invention is a schematic diagram of a device for identifying navigation lines between crop rows.
[0044] In the accompanying drawings, the components represented by the reference numerals are listed as follows:
[0045] 1. Depth camera; 2. Bracket; 3. Sunshade. DETAILED DESCRIPTION
[0046] The principles and features of the present invention are described below. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0047] Embodiment 1
[0048] like Figure 1 As shown in the figure, current line-to-line navigation mainly relies on RTK technology. In the case where the RTK signal may become unstable or even no signal, perception technology is usually used to identify and track the navigation line as an alternative when the RTK signal is unstable. Perception technology currently mainly identifies the navigation line through visual routes, and visual routes are currently mainly based on deep learning.
[0049] Taking grape trees as an example, the principle of the deep learning method currently used is: first anchor the contact points between the trunk of each grape tree and the ground in the image, and then connect these points into a straight line as a navigation line, such as Figure 2 However, the visual method is essentially an estimation, so the identified navigation line has a large error and low accuracy. In addition, this method is greatly affected by environmental interference and has poor robustness, such as Figure 3 As shown, when the grapevine grows leaves, the leaves or weeds will cover the contact point between the trunk and the ground, thus affecting the accuracy of the navigation line.
[0050] Based on this, Figure 4 As shown, this embodiment mainly aims at the problem that the deep learning model has poor navigation line recognition effect when there are lush branches and leaves and many weeds between crop rows, and provides a method for identifying navigation lines between crop rows, including: obtaining a depth map for the row space; according to the depth map, determining a two-dimensional point cloud of crop rows located on both sides of the row space, the crop rows representing rows formed by crops planted on the same ridge; according to the two-dimensional point cloud, respectively fitting the row lines of the crop rows located on both sides of the row space; according to the row lines of the crop rows located on both sides of the row space, fitting the row navigation lines.
[0051] The depth map is obtained by taking a picture with the depth camera 1, such as Figure 5 As shown in FIG. 1 , compared with the laser radar point cloud, the point cloud data converted from the depth map is denser, and in the depth map, the density of pixels in the grape row area is the highest, which is conducive to screening out the two-dimensional point cloud of the crop rows located on both sides of the row. The depth camera 1 can be a ZED 2i camera. Taking a tractor as an example, Figure 6 As shown, a special bracket 2 is designed for the ZED 2i camera, and the ZED 2i camera is mounted on the bracket 2, and the angle is adjustable. A sunshade 3 is set above the camera to avoid strong light interference. The bracket 2 is fixed to the bracket mounting plate reserved in the center of the front of the tractor roof by bolts. In practical applications, the depth camera 1 can be shared with the perception and obstacle avoidance system, thereby reducing hardware costs.
[0052] This method processes the depth map to screen out valid points for locating crop rows, and draws navigation lines between rows based on them. This method obtains navigation lines between rows by identifying the point cloud information of the entire crop row, without relying on tree roots blocked by branches and weeds. Therefore, in situations with more weeds and branches, high-precision recognition of navigation lines between rows can still be achieved.
[0053] Optionally, in an embodiment, the method further includes: for each pixel in the depth map, determining whether the depth value corresponding to the pixel is greater than a preset first value, and when the depth value corresponding to the pixel is greater than the first value, removing the pixel from the depth map.
[0054] After obtaining the depth map for the row, the depth map is preprocessed. The depth information error of distant points is large, so the pixels with large depth values are removed to improve the accuracy of subsequent calculations and reduce the amount of calculations. The first value can be set according to the actual situation. For grapevines, the first value can be set to 10 meters.
[0055] Optionally, in an embodiment, determining the two-dimensional point cloud constituting the crop rows located on both sides of the row space according to the depth map includes: converting each pixel point in the depth map into a world coordinate system to generate a point cloud, such as Figure 7 As shown; the world coordinate system takes the projection point of the initial position of the camera that shoots the depth map on the ground as the origin, the longitudinal axis of the world coordinate system is parallel to the direction of the body of the agricultural machinery on which the camera is installed, and the transverse axis of the world coordinate system is located on the same horizontal plane as the longitudinal axis of the world coordinate system; each point in the point cloud is projected onto the two-dimensional plane formed by the transverse axis and the longitudinal axis to generate a two-dimensional plane diagram, as shown Figure 8As shown; clustering is performed on each point in the two-dimensional plane map to obtain a two-dimensional point cloud constituting the crop rows located on both sides of the row space.
[0056] Optionally, in an embodiment, the method also includes: for each point in the point cloud, determining whether the horizontal axis coordinate value of the point is within a preset first interval and whether the vertical axis coordinate value of the point is within a preset second interval; if the horizontal axis coordinate value of the point is not within the first interval or the vertical axis coordinate value of the point is not within the second interval, removing the point from the point cloud.
[0057] For coordinate transformation and filtering processing, specifically: first load the depth map and apply a mask to exclude invalid or unnecessary depth values. In this way, only the data in the valid area can be processed. The camera's intrinsic parameters include: optical center camera_cx, camera_cy and focal length camera_fx, camera_fy. The camera's intrinsic parameters are used to convert the image coordinate system (pixel coordinate system) into the camera coordinate system. The camera coordinate system takes the optical center of the camera as its origin, the horizontal axis of the camera coordinate system is parallel to the horizontal axis of the depth map, the vertical axis of the camera coordinate system is parallel to the vertical axis of the depth map, and the vertical axis of the camera coordinate system coincides with the optical axis of the camera.
[0058] The horizontal axis coordinate is:
[0059] x=(xa-camera_cx)×depth / camera_fx, where xa is the horizontal coordinate of each pixel and depth is the depth value of each pixel.
[0060] The external parameters include the camera's installation angle camera_angle and installation height camera_height, which are used to convert the camera coordinate system to the world coordinate system. First, convert the angle from degrees to radians. Then, through a simple rotation matrix, the coordinates are converted from the camera coordinate system to the world coordinate system on the horizontal ground:
[0061] The vertical axis coordinates are:
[0062] y=y_temp×cos(camera_angle)+z_temp×sin(camera_angle) represents the horizontal distance from the camera to the ground.
[0063] Among them, y_temp is directly equal to the depth value depth, because in the camera coordinate system, the y-axis represents the depth of the object directly from the camera.
[0064] z_temp is calculated by z_temp=(camera_cy-ya)×depth / camera_fy, where ya is the vertical coordinate of each pixel.
[0065] The vertical axis coordinate is: z=z_temp×cos(camera_angle)-y_temp×sin(camera_angle)+camera_height, which represents the vertical distance from the ground to the camera.
[0066] Finally, by applying an additional mask mask_next, the result is limited to a specific x and z coordinate range, which helps to exclude unnecessary data points and retain only the coordinate information of the area of interest. The specific values of the first interval and the second interval are set according to the actual usage. For example, for grapevines, the first interval is set to -3000mm to 3000mm, so that the points with coordinate values outside -3000mm to 3000mm in the x-axis direction are filtered out; the second interval is set to 500mm to 1500mm, so that the points with coordinate values outside 500mm to 1500mm in the z-axis direction are filtered out. In this way, through the comprehensive application of internal and external parameters, the conversion to the world coordinate system and the screening of data are realized.
[0067] For projection processing, all points in the point cloud are projected onto the plane z=0, specifically: the vertical axis coordinate value z of each point in the point cloud is set to 0; or the horizontal axis coordinate value x and the vertical axis coordinate value y of each point in the point cloud are directly taken.
[0068] Optionally, in an embodiment, clustering the points in the two-dimensional plane map to obtain a two-dimensional point cloud constituting the crop rows located on both sides of the row space includes:
[0069] S101, among all points with positive horizontal axis coordinate values in the two-dimensional plane graph, the position of the point closest to the origin is taken as the starting point of the first cluster;
[0070] S102, determining a first range with the first cluster starting point as the center and a preset second value as the radius;
[0071] S103, taking the position of the point farthest from the origin among all the points within the first range as a new first clustering starting point, and intercepting and saving all the points within the first range in the two-dimensional plane map;
[0072] S104, taking the new first cluster starting point as the center and the preset second value as the radius to determine a new first range, and judging whether the new first range does not contain any point, if so, executing S105, otherwise, taking the new first range as the first range in S103, and executing S103;
[0073] S105, using all the saved points as a two-dimensional point cloud constituting a crop row located on one side of the row space;
[0074] S106, among all points with negative horizontal axis coordinate values in the two-dimensional plane graph, the position of the point closest to the origin is taken as the starting point of the second clustering;
[0075] S107, determining a second range with the second cluster starting point as the center and a preset second value as the radius;
[0076] S108, taking the position of the point farthest from the origin among all the points within the second range as a new second clustering starting point, and intercepting and saving all the points within the second range in the two-dimensional plane map;
[0077] S109, determining a new second range with the new second cluster starting point as the center and the preset second value as the radius, and determining whether the new second range does not contain any point, if so, executing S110, otherwise, taking the new second range as the second range in S108, and executing S108;
[0078] S110, using all the saved points as a two-dimensional point cloud constituting the crop row located on the other side of the row space.
[0079] like Fig. 9 As shown in the figure, all points in the two-dimensional plane map are divided into two parts by the positive and negative values of the horizontal axis coordinates of each point in the two-dimensional plane map. The adjacent clustering method is used to process the two parts of points respectively, and the effective points of the crops in the left and right rows between the rows are selected.
[0080] Optionally, in an embodiment, the two-dimensional point cloud respectively fits the row lines of the crop rows located on both sides of the row space, including: fitting the row lines of the crop rows located on both sides of the row space respectively through the RANSAC algorithm based on the two-dimensional point cloud.
[0081] For scenes with lush branches and weeds, there is more input noise. The main advantage of the RANSAC algorithm in fitting a straight line is its high robustness to noise and outliers, which enables it to estimate accurate model parameters even when there are a large number of outliers in the data set. Through iterative random sampling and classification of inliers and outliers, the RANSAC algorithm can effectively identify and use the inliers in the data set to build a model, while ignoring those outliers that do not conform to the model. In addition, the RANSAC algorithm has a certain degree of probability, and the possibility of finding the best model can be increased by increasing the number of iterations. The RANSAC algorithm is widely used in the fields of computer vision and image processing due to its reliability and effectiveness in processing complex data sets.
[0082] The principle of the random sample consensus algorithm (RANSAC) is to estimate the model by randomly selecting a small number of points, and then evaluate the fit of the model to the entire data set. In each iteration, the algorithm randomly selects two points to define a straight line, and calculates the distance from all points to this line. Points whose distances are within the set threshold are considered as inliers to form a consistent set. The algorithm iterates continuously, each time trying to find the largest consistent set, and refit the line with the points in this set to improve the accuracy of the line. Eventually, the algorithm converges to the straight line with the largest consistent set, which is the row line, which can accurately reflect the layout of the crop rows.
[0083] Taking grape vines as an example, this method uses the point cloud data of depth camera 1 for visual navigation development. The anchors are grape vine leaves (when the grape vine has no leaves, the anchors are branches with higher heights). The core idea is to select the pixel points of the two rows of grape vines between the rows in the depth map, and fit the navigation line between the rows through the coordinates corresponding to these pixel points. Fig.10 As shown in , a true value ribbon is laid between the rows to compare with the navigation line between the rows fitted by this method. Fig.11 As shown in the figure, the dotted line Navigation Line is the navigation line between rows fitted by this method, and the solid line Truth Line is the artificially laid true value ribbon drawn on the two-dimensional plane displayed at the end. By comparison, it can be seen that the fitted navigation line between rows is almost consistent with the actual true value line, and the recognition accuracy is also very high in the scene with many leaves and weeds.
[0084] In summary, the input of this method is not the traditional RGB image information, but the point cloud information obtained by scanning the depth camera 1. During the movement of agricultural machinery, the depth map collected by the depth camera 1 is obtained in real time. The inter-row navigation line is obtained through preprocessing, filtering and denoising, adjacent clustering, RANSAC fitting and other steps. This method is not affected by branches and weeds, has high robustness, good recognition effect, small algorithm calculation amount and good real-time performance. And it does not need to collect data, make training data, train models, etc., so the development speed is very fast and the development cost is low. This method uses the depth information of the point cloud to identify and fit the rows of crops, abandons the traditional machine learning scheme that requires strict conditions and thresholds, and bypasses the detection scheme based on deep learning that is widely used in various industries. It does not need to consider the large-scale data set required for deep learning training, does not need a large computing power server for model training, and avoids the influence of large deviations in the recognition effect of deep learning algorithms under different growth states of crop branches and leaves. This method is particularly suitable for the recognition of inter-row navigation lines of grapevines, and does not need to consider the influence of the state of grape leaves at different growth stages and growth cycles on the recognition effect. It is not only applicable to the situation of lush branches and leaves, but also to the situation of leafless or few leaves. It can also achieve the purpose of detecting navigation lines between vineyard rows by adjusting the collection height of the point cloud and modifying the adjacent clustering algorithm.
[0085] Embodiment 2
[0086] like Fig.12 As shown, this embodiment provides a device for identifying navigation lines between crop rows, including:
[0087] An image acquisition module, used to acquire a depth map for a row;
[0088] A screening module, for determining, based on the depth map, a two-dimensional point cloud constituting crop rows located on both sides of the row interval, wherein the crop rows represent rows formed by crops planted on the same ridge;
[0089] A row line fitting module is used to fit the row lines of the crop rows located on both sides of the row space according to the two-dimensional point cloud;
[0090] The inter-row navigation line fitting module is used to fit the inter-row navigation line according to the row lines of the crop rows located on both sides of the inter-row space.
[0091] Optionally, in an embodiment, the device also includes: a preprocessing module, used to determine, for each pixel point in the depth map, whether the depth value corresponding to the pixel point is greater than a preset first value, and when the depth value corresponding to the pixel point is greater than the first value, remove the pixel point from the depth map.
[0092] Optionally, in an embodiment, the screening module includes: a coordinate conversion unit, used to convert each pixel point in the depth map into a world coordinate system to generate a point cloud; the world coordinate system takes the projection point of the initial position of the camera that shoots the depth map on the ground as the origin, the longitudinal axis of the world coordinate system is parallel to the orientation of the body of the agricultural machinery on which the camera is installed, and the horizontal axis of the world coordinate system is located on the same horizontal plane as the longitudinal axis of the world coordinate system; a projection unit, used to project each point in the point cloud onto a two-dimensional plane formed by the horizontal axis and the longitudinal axis to generate a two-dimensional plane map; a clustering unit, used to perform clustering processing on each point in the two-dimensional plane map to obtain a two-dimensional point cloud constituting the crop rows located on both sides of the row space.
[0093] Optionally, in an embodiment, the screening module also includes: a filtering unit, used to determine, for each point in the point cloud, whether the horizontal axis coordinate value of the point is within a preset first interval and whether the vertical axis coordinate value of the point is within a preset second interval; if the horizontal axis coordinate value of the point is not within the first interval or the vertical axis coordinate value of the point is not within the second interval, the point is removed from the point cloud.
[0094] Optionally, in an embodiment, clustering the points in the two-dimensional plane map to obtain a two-dimensional point cloud constituting the crop rows located on both sides of the row space includes:
[0095] S101, among all points with positive horizontal axis coordinate values in the two-dimensional plane graph, the position of the point closest to the origin is taken as the starting point of the first cluster;
[0096] S102, determining a first range with the first cluster starting point as the center and a preset second value as the radius;
[0097] S103, taking the position of the point farthest from the origin among all the points within the first range as a new first clustering starting point, and intercepting and saving all the points within the first range in the two-dimensional plane map;
[0098] S104, taking the new first cluster starting point as the center and the preset second value as the radius to determine a new first range, and judging whether the new first range does not contain any point, if so, executing S105, otherwise, taking the new first range as the first range in S103, and executing S103;
[0099] S105, using all the saved points as a two-dimensional point cloud constituting a crop row located on one side of the row space;
[0100] S106, among all points with negative horizontal axis coordinate values in the two-dimensional plane graph, the position of the point closest to the origin is taken as the starting point of the second clustering;
[0101] S107, determining a second range with the second cluster starting point as the center and a preset second value as the radius;
[0102] S108, taking the position of the point farthest from the origin among all the points within the second range as a new second clustering starting point, and intercepting and saving all the points within the second range in the two-dimensional plane map;
[0103] S109, determining a new second range with the new second cluster starting point as the center and the preset second value as the radius, and determining whether the new second range does not contain any point, if so, executing S110, otherwise, taking the new second range as the second range in S108, and executing S108;
[0104] S110, using all the saved points as a two-dimensional point cloud constituting the crop row located on the other side of the row space.
[0105] Optionally, in an embodiment, fitting the row lines of the crop rows located on both sides of the row space respectively according to the two-dimensional point cloud includes: fitting the row lines of the crop rows located on both sides of the row space respectively according to the two-dimensional point cloud by using a RANSAC algorithm.
[0106] Embodiment 3
[0107] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a method for identifying navigation lines between crop rows as described in Embodiment 1 is implemented.
[0108] Embodiment 4
[0109] This embodiment provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute a method for identifying navigation lines between crop rows as described in Embodiment 1.
[0110] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0111] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0112] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0113] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0114] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0115] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for identifying navigation lines between crop rows, characterized in that: include: Get the depth map for the row progress; Determine, based on the depth map, a two-dimensional point cloud constituting crop rows located on both sides of the row interval, wherein the crop rows represent rows formed by crops planted on the same ridge; According to the two-dimensional point cloud, respectively fitting the row lines of the crop rows located on both sides of the row space; Fitting an inter-row navigation line according to the row lines of the crop rows located on both sides of the inter-row space; Wherein, determining, according to the depth map, a two-dimensional point cloud constituting the crop rows located on both sides of the row space includes: Each pixel point in the depth map is converted into a world coordinate system to generate a point cloud; the world coordinate system takes the projection point on the ground of the initial position of the camera that shoots the depth map as the origin, the longitudinal axis of the world coordinate system is parallel to the orientation of the body of the agricultural machinery on which the camera is installed, and the horizontal axis of the world coordinate system is located on the same horizontal plane as the longitudinal axis of the world coordinate system; Projecting each point in the point cloud onto a two-dimensional plane formed by the horizontal axis and the vertical axis to generate a two-dimensional plane graph; Clustering is performed on each point in the two-dimensional plane map to obtain a two-dimensional point cloud constituting the crop rows located on both sides of the row space.
2. A method for identifying navigation lines between crop rows according to claim 1, characterized in that: Also includes: For each pixel in the depth map, it is determined whether the depth value corresponding to the pixel is greater than a preset first value, and when the depth value corresponding to the pixel is greater than the first value, the pixel is removed from the depth map.
3. The method for identifying navigation lines between crop rows according to claim 1, characterized in that: Also includes: For each point in the point cloud, determine whether the horizontal axis coordinate value of the point is within a preset first interval and whether the vertical axis coordinate value of the point is within a preset second interval. If the horizontal axis coordinate value of the point is not within the first interval or the vertical axis coordinate value of the point is not within the second interval, remove the point from the point cloud.
4. The method for identifying navigation lines between crop rows according to claim 1, characterized in that: The clustering process is performed on each point in the two-dimensional plane map to obtain a two-dimensional point cloud constituting the crop rows located on both sides of the row space, including: S101, among all points with positive horizontal axis coordinate values in the two-dimensional plane graph, the position of the point closest to the origin is taken as the starting point of the first cluster; S102, determining a first range with the first cluster starting point as the center and a preset second value as the radius; S103, taking the position of the point farthest from the origin among all the points within the first range as a new first clustering starting point, and intercepting and saving all the points within the first range in the two-dimensional plane map; S104, taking the new first cluster starting point as the center and the preset second value as the radius to determine a new first range, and judging whether the new first range does not contain any point, if so, executing S105, otherwise, taking the new first range as the first range in S103, and executing S103; S105, using all the saved points as a two-dimensional point cloud constituting a crop row located on one side of the row space; S106, among all points with negative horizontal axis coordinate values in the two-dimensional plane graph, the position of the point closest to the origin is taken as the starting point of the second clustering; S107, determining a second range with the second cluster starting point as the center and a preset second value as the radius; S108, taking the position of the point farthest from the origin among all the points within the second range as a new second clustering starting point, and intercepting and saving all the points within the second range in the two-dimensional plane map; S109, determining a new second range with the new second cluster starting point as the center and the preset second value as the radius, and determining whether the new second range does not contain any point, if so, executing S110, otherwise, taking the new second range as the second range in S108, and executing S108; S110, using all the saved points as a two-dimensional point cloud constituting the crop row located on the other side of the row space.
5. The method for identifying navigation lines between crop rows according to claim 1, characterized in that: The step of fitting the row lines of the crop rows located on both sides of the row space according to the two-dimensional point cloud comprises: According to the two-dimensional point cloud, the row lines of the crop rows located on both sides of the row space are respectively fitted using the RANSAC algorithm.
6. A device for identifying navigation lines between crop rows, characterized in that: include: An image acquisition module, used to acquire a depth map for a row; A screening module, for determining, based on the depth map, a two-dimensional point cloud constituting crop rows located on both sides of the row interval, wherein the crop rows represent rows formed by crops planted on the same ridge; A row line fitting module is used to fit the row lines of the crop rows located on both sides of the row space according to the two-dimensional point cloud; An inter-row navigation line fitting module is used to fit the inter-row navigation line according to the row lines of the crop rows located on both sides of the inter-row space; Among them, the screening module includes: a coordinate conversion unit, which is used to convert each pixel point in the depth map into a world coordinate system to generate a point cloud; the world coordinate system takes the projection point of the initial position of the camera that shoots the depth map on the ground as the origin, the longitudinal axis of the world coordinate system is parallel to the orientation of the body of the agricultural machinery on which the camera is installed, and the horizontal axis of the world coordinate system is located on the same horizontal plane as the longitudinal axis of the world coordinate system; a projection unit, which is used to project each point in the point cloud onto a two-dimensional plane formed by the horizontal axis and the longitudinal axis to generate a two-dimensional plane map; a clustering unit, which is used to perform clustering processing on each point in the two-dimensional plane map to obtain a two-dimensional point cloud that constitutes the crop rows located on both sides of the row space.
7. The crop row navigation line identification device according to claim 6, characterized in that: Also includes: The preprocessing module is used to determine, for each pixel in the depth map, whether the depth value corresponding to the pixel is greater than a preset first value, and when the depth value corresponding to the pixel is greater than the first value, remove the pixel from the depth map.
8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a method for identifying navigation lines between crop rows as claimed in any one of claims 1 to 5 is implemented.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute a method for identifying navigation lines between crop rows as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Corn data acquisition robot crop inter-row navigation path identification method, computer equipment and medium
CN116576863A