Encirclement boundary point processing method for agricultural machinery navigation
By using Douglas-Pokker algorithm, constriction processing, feature fitting and tri-uniform B-spline fitting in agricultural machinery navigation technology, the encirclement boundary points in agricultural machinery navigation are solved in the existing technology outliers The path planning failure problem caused by points and closed loops has achieved efficient and high-quality boundary point processing.
Patent Information
- Application Number
- CN202411483413.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-07
AI Technical Summary
In the existing agricultural machinery navigation technology, the boundary point processing method fails to effectively deal with possible outliers and closed loops in the point set, resulting in the failure of subsequent global path planning algorithms or the poor quality of path solutions.
A boundary point processing method for agricultural machinery navigation is adopted. The boundary points are compressed by the Douglas-Puk algorithm, and the constriction processing and feature fit are performed to eliminate outliers, traversal and eliminate closed loop points, and based on three uniform B Spline polygon fitting is processed, and secondary compression is finally performed to obtain a high-quality set of circle boundary points.
It effectively improves the quality and efficiency of boundary processing, provides high-quality input volume, and provides favorable conditions for the calculation and output of subsequent global path planning algorithms.
Smart Images

Figure CN119394305A_ABST
Abstract
Description
Background Art
[0002] In recent years, smart agriculture has developed in full swing. Unmanned operation of agricultural machinery has freed farmers' hands, improved agricultural operation efficiency, and increased crop yields. It has become a hot research direction for major agricultural machinery manufacturers and university research institutes.
[0003] Before starting unmanned operations, users need to use devices such as dotting devices to obtain the boundary points of the working field, and input them into the intelligent terminal device to obtain the global planning path of the field. Boundary point processing is a prerequisite for the unmanned process, so its processing efficiency and quality determine the quality of the subsequent path planning algorithm.
[0004] There are relatively few patent applications for boundary point processing methods in agricultural machinery navigation technology. The invention patent with the authorization number CN 114485664B is named "Boundary Simplification Method, Path Planning Method, Device, Equipment and System". This patent is based on the simplification idea of the Douglas-Peucker algorithm and only takes into account the compression of boundary point data, which improves the boundary processing speed to a certain extent. However, this patent does not take into account the outliers that may exist in the point set, leading to the appearance of cusps, closed loops and other characteristics, which may cause the subsequent global path planning algorithm to fail or the quality of the path solution to be poor. Summary of the invention
[0005] The technical problem to be solved by the present invention is to address the deficiencies of the prior art and specifically provide a method for processing enclosure boundary points for agricultural machinery navigation, which is as follows:
[0006] 1) In the first aspect, the present invention provides a method for processing enclosure boundary points for agricultural machinery navigation, and the specific technical solution is as follows:
[0007] S1, obtaining a set of enclosure boundary points for agricultural machinery navigation, and compressing the set of enclosure boundary points by using the Douglas-Peucker algorithm to obtain a compressed skeleton point set;
[0008] S2, performing an indentation process on the skeleton point set to obtain an indentation point set, performing feature fitting on the starting segment and the ending segment of the enclosure boundary, and removing outliers from the indentation point set according to the fitting result to obtain a first boundary point set after removing the indentation points;
[0009] S3, traversing the elements in the first boundary point set after removing the indentation points, and removing the closed loop points, to obtain a second boundary point set after removing the closed loop points;
[0010] S4, performing a cubic uniform B-spline curve polygon fitting process on the second boundary point set to obtain a third boundary point set;
[0011] S5, compressing the third boundary point set again to obtain a final enclosure boundary point set.
[0012] The beneficial effects of the enclosure boundary point processing method for agricultural machinery navigation provided by the present invention are as follows:
[0013] The present invention takes into account the low processing efficiency caused by the large number of enclosure points and the unfavorable features such as sharp points or closed loops caused by the randomness of enclosure, and adds shrinkage and fitting processing to the boundary feature loss that may be caused in the boundary processing, thereby obtaining high-quality input for subsequent global path planning, which is beneficial to the calculation of the global path.
[0014] Based on the above solution, the present invention can also be improved as follows.
[0015] Furthermore, the Douglas-Peucker algorithm is used to compress the enclosure boundary point set to obtain the compressed skeleton point set. The specific process is:
[0016] S11, determining a first endpoint and an end point in the enclosure boundary point set, and connecting the first endpoint with the end point to obtain a first reference line, and determining a first distance value between all elements in the enclosure boundary point set excluding the first endpoint and the end point and the first reference line;
[0017] S12, determining a maximum value among all the first distance values, and when the maximum value is greater than a preset distance value, taking an element corresponding to the maximum value as a demarcation point, dividing the enclosure boundary point set into two parts, the first part being a first set starting from the head end point and terminating at the demarcation point, and the second part being a second set starting from the demarcation point and terminating at the end point;
[0018] S13, using the first set and the second set as the enclosure boundary point set in S11 to repeat S11 and S12, storing the boundary points in each repetition process into the initial skeleton point set, until the number of elements in the initial skeleton point set no longer increases after a preset number of repetitions, and using the initial skeleton point set as the skeleton point set.
[0019] Further, the skeleton point set is subjected to indentation processing to obtain the indentation point set. Specifically, the process is as follows:
[0020] In the skeleton point set, any three adjacent elements are selected, the angles of two vectors formed by the three elements are subtracted, and all subtraction results are counted to determine the encircling rotation direction of the skeleton point set;
[0021] According to a preset threshold and the enclosure rotation direction, all elements in the skeleton point set are sequentially translated to obtain a translated element corresponding to each element, and all translated elements are integrated to obtain an indented point set.
[0022] Further, according to the fitting result, the process of removing outliers from the indentation point set to obtain the first boundary point set after removing the indentation points is specifically as follows:
[0023] Determine a line between the first endpoint in the indented point set and the first endpoint in the enclosure boundary point set to obtain a second reference line, determine a second distance value between the first endpoint in the indented point set and the second reference line, and determine a third distance value between the first endpoint in the indented point set and the end point in the indented point set;
[0024] When the second distance value and the third distance value meet the preset condition, taking the first endpoint and the end point in the indentation point set as the starting point, respectively selecting the first fixed length to obtain the first segment point set and the second segment point set, respectively establishing linear regression models for the first segment point set and the second segment point set, and determining the optimal point set in the first segment point set and the second segment point set based on the ordinary R-square value corresponding to each linear regression model;
[0025] Reversely arrange the elements in the indentation point set to obtain a reverse indentation point set, take the first endpoint in the reverse indentation point set as the starting point, select a second fixed length to obtain a third segment point set, determine a fourth distance value between each element in the third segment point set and the end point in the reverse indentation point set, and determine a first index value corresponding to the minimum value of the fourth distance values;
[0026] Determine a line segment between an end point in the reverse indentation point set and an element adjacent to the end point to obtain a third reference line, determine fifth distance values between all elements in the third segment point set and the third reference line, and determine a second index value corresponding to a minimum value in the fifth distance values;
[0027] A final index value is determined according to the first index value and the second index value, and elements corresponding to the final index value are removed from the indentation point set to generate a first boundary point set after removing the indentation points.
[0028] Further, the process of traversing the elements in the first boundary point set after removing the indentation points and removing the closed loop points to obtain the second boundary point set after removing the closed loop points specifically includes:
[0029] In the first boundary point set after removing the indented points, a middle point is randomly selected, and according to the middle point, the first boundary point set after removing the indented points is divided into a front segment and a rear segment, and the intersection of a line segment composed of any two adjacent points in the front segment and a line segment composed of any two adjacent points in the rear segment is calculated, and it is determined whether the position of the intersection meets the position condition. If the position condition is met, elements other than the index value corresponding to the intersection are removed, and a second boundary point set after removing the closed loop points is generated with the intersection as the first endpoint.
[0030] Further, the second boundary point set is subjected to a cubic uniform B-spline curve polygon fitting process to obtain a third boundary point set in the following specific process:
[0031] A type value point is determined in advance, and a cubic uniform B-spline curve corresponding to the type value point is determined by an assumption method. According to the first and last endpoints of the cubic uniform B-spline curve, combined with the matrix of the cubic uniform B-spline curve, a third boundary point set is determined.
[0032] 2) In the second aspect, the present invention also provides a system for processing enclosure boundary points for agricultural machinery navigation, and the specific technical solution is as follows:
[0033] The acquisition module is used to: acquire a set of enclosure boundary points for agricultural machinery navigation, and compress the set of enclosure boundary points by using the Douglas-Peucker algorithm to obtain a compressed skeleton point set;
[0034] The first fitting module is used to: perform indentation processing on the skeleton point set to obtain an indentation point set, perform feature fitting on the starting segment and the ending segment of the enclosure boundary, and remove outliers from the indentation point set according to the fitting result to obtain a first boundary point set after removing the indentation points;
[0035] The elimination module is used to: traverse the elements in the first boundary point set after eliminating the indentation points, and eliminate the closed loop points to obtain the second boundary point set after eliminating the closed loop points;
[0036] The second fitting module is used to: perform a cubic uniform B-spline curve polygon fitting process on the second boundary point set to obtain a third boundary point set;
[0037] The processing module is used to: perform compression processing on the third boundary point set again to obtain a final enclosure boundary point set.
[0038] 3) In a third aspect, the present invention further provides an electronic device, comprising a processor, wherein the processor is coupled to a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the electronic device implements any of the above methods.
[0039] 4) In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor so that a computer implements any of the above methods.
[0040] 5) In a fifth aspect, the present invention further provides an agricultural machine, which includes the above-mentioned electronic device.
[0041] It should be noted that the beneficial effects achieved by the technical solutions of the second to fifth aspects of the present invention and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0043] Figure 1 A schematic flow chart of a method for processing enclosure boundary points for agricultural machinery navigation according to an embodiment of the present invention;
[0044] Figure 2 A schematic diagram of closed simulation of a method for processing enclosure boundary points for agricultural machinery navigation according to an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of a simulation of a cusp processing method for processing enclosure boundary points for agricultural machinery navigation according to an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of processing efficiency of a method for processing enclosure boundary points for agricultural machinery navigation according to an embodiment of the present invention;
[0047] Figure 5 The present invention is a structural framework diagram of an electronic device. DETAILED DESCRIPTION
[0048] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0049] like Figure 1 As shown, a method for processing enclosure boundary points for agricultural machinery navigation according to an embodiment of the present invention comprises the following steps:
[0050] S1, obtaining a set of enclosure boundary points for agricultural machinery navigation, and compressing the set of enclosure boundary points by using the Douglas-Peucker algorithm to obtain a compressed skeleton point set;
[0051] S2, performing an indentation process on the skeleton point set to obtain an indentation point set, performing feature fitting on the starting segment and the ending segment of the enclosure boundary, and removing outliers from the indentation point set according to the fitting result to obtain a first boundary point set after removing the indentation points;
[0052] S3, traversing the elements in the first boundary point set after removing the indentation points, and removing the closed loop points, to obtain a second boundary point set after removing the closed loop points;
[0053] S4, performing a cubic uniform B-spline curve polygon fitting process on the second boundary point set to obtain a third boundary point set;
[0054] S5, compressing the third boundary point set again to obtain a final enclosure boundary point set.
[0055] The beneficial effects of the enclosure boundary point processing method for agricultural machinery navigation provided by the present invention are as follows:
[0056] The present invention takes into account the low processing efficiency caused by the large number of enclosure points and the unfavorable features such as sharp points or closed loops caused by the randomness of enclosure, and adds shrinkage and fitting processing to the boundary feature loss that may be caused in the boundary processing, thereby obtaining high-quality input for subsequent global path planning, which is beneficial to the calculation of the global path.
[0057] S1, obtaining a set of boundary points of the enclosure for agricultural machinery navigation, and compressing the set of boundary points of the enclosure by using the Douglas-Peucker algorithm to obtain a compressed skeleton point set.
[0058] It should be noted that the boundary point set of the enclosure in this solution is the boundary point set Λ1(x i ,y i )i=0,2,3,...,num-1, num is the number of circle locations.
[0059] The specific process of obtaining the compressed skeleton point set is:
[0060] S11, connect the first and last points of the obtained boundary points, calculate the distance from all boundary points to the straight line, and compare the maximum distance with the set threshold δ1. If it is less than the threshold, then keep the first and last points and delete all other points, otherwise enter S12.
[0061] S12. The boundary point corresponding to the maximum distance is retained, and the boundary point is used as the boundary to divide the system into two parts: from the starting boundary point to the boundary point with the maximum distance and from the boundary point with the maximum distance to the end boundary point.
[0062] S13, performing steps S11 and S12 on the two parts of boundary points in S12 respectively, and looping through all boundary points in this way to finally obtain the skeleton point set Λ2 of the boundary curve, that is, the compressed skeleton point set.
[0063] S2, performing indentation processing on the skeleton point set to obtain an indentation point set, performing feature fitting on the starting segment and the ending segment of the enclosure boundary, and removing outliers from the indentation point set according to the fitting results to obtain a first boundary point set after removing the indentation points. Wherein:
[0064] In order to reduce the loss of boundary features caused by compression, the points in the set Λ2 are shrunk. Specifically:
[0065] S21. Detect the rotation direction of the obtained data points, that is, clockwise or counterclockwise. Specifically, the positive or negative angle difference between the two vectors formed by the three adjacent points is used to determine the direction. The positive angle is taken as clockwise and the negative angle is taken as counterclockwise. All boundary points are looped and counted. The direction with the highest count is taken as the rotation direction of the entire boundary.
[0066] S22, a threshold ε is given to shrink the boundary points, and a point set Λ3 after shrinking is obtained by point translation operation. If the rotation direction is clockwise, the threshold is ε, and if the rotation direction is counterclockwise, the threshold is -ε. This ensures that the points are indented within the boundary instead of expanding.
[0067] After obtaining the indented point set in the above steps, the randomness of the user's point marking may cause outliers to appear in the starting and ending segments of the point set, thereby causing unfavorable features such as sharp points in the polygon of the plot. The present invention adopts feature fitting of the point set of the starting and ending segments to identify outliers and delete them from the boundary point set. Specifically:
[0068] S23, determine whether the cusp exists:
[0069] Calculate the perpendicular distance d1 from the end point to the straight line formed by the two initial points, and calculate the distance d2 from the end point to the starting point. If d1<d2 and d1<3ω, where ω is the operating width of the agricultural machinery, it is determined that a cusp exists, and then enter the S24-S27 processing steps.
[0070] S24, for each segment before and after the set Λ3, the present invention takes a 1 / 8 ratio, and establishes a linear regression model for the two segments of data points, because the common R square value represents the data difference ratio, and the larger the value, the better the fit, and the more it can represent the prediction accuracy of future data. Therefore, the present invention takes the common R square value in the model for fitting analysis. The common R square values of the starting segment and the ending segment are rsquared1 and rsquared2 respectively. If the following relationship is satisfied:
[0071]
[0072] This indicates that the previous data points are more representative of the data trend, so the previous data points are not processed. The process continues with S25.
[0073] S25, reversely arrange the point set in set Λ3 to obtain set Λ4, take 1 / 10 of the front data points in set Λ4, calculate the distance from the front data points to the end point in turn, and record the index value index1 corresponding to the minimum distance. Each point corresponds to a serial number, which is called an index value. Find the point corresponding to the minimum distance value, and naturally get the index value of the point.
[0074] S26. To further increase the robustness of the algorithm, take the last two points from the terminal segment of the set Λ4 and connect them into a straight line. Then calculate the distances from the previous data points to the straight line respectively, and record the index index2 corresponding to the minimum distance of this step.
[0075] S27. Use the result of index=min(index1, index2) as the final index value, remove the front points with the points corresponding to the index value as the boundary, and finally obtain the boundary point set Λ5, that is, the first boundary point set after removing the indentation points.
[0076] S3, traverse the elements in the first boundary point set after removing the indentation points, and remove the closed loop points to obtain the second boundary point set after removing the closed loop points.
[0077] The above steps include removing unfavorable features such as closed loops. In order to ensure the stability of the removal algorithm, the present invention further removes the closed loop point set from a geometric perspective by traversing the point set Λ5 to determine whether an intersection exists. Specifically:
[0078] Add the starting point of point set Λ5 to the end of the point set. Select a certain middle point (it should be noted that the selection of the middle point should ensure that the number of elements in the front and back segments obtained by segmentation is the same or similar, such as 50:50 or 40:60), and use this point as the segmentation point to divide the point set into the front and back segments. Circularly calculate the intersection of the line segment composed of the adjacent points of the front segment and the line segment composed of the adjacent points of the back segment. If the intersection is within the two segments, it means that a closed loop exists. Eliminate the points outside the corresponding index value of the segment, and use the intersection as the starting point of the processed point set to obtain point set Λ6.
[0079] Randomly determine any two elements in the front segment to form a front segment line segment, and randomly determine any two elements in the back segment to form a back segment line segment, and judge whether there is an intersection between the front segment and the back segment. If not, replace at least one of the front segment or the back segment line segment, and repeat the judgment of whether there is an intersection. When there is an intersection, the element in the front segment line segment farthest from the first endpoint of the point set Λ5 is used as the new first endpoint, and the element in the back segment line segment farthest from the end point of the point set Λ5 is used as the new end point, and the elements between the new first endpoint and the new end point and the intersection together form the point set Λ6.
[0080] S4, performing a cubic uniform B-spline curve polygon fitting process on the second boundary point set to obtain a third boundary point set.
[0081] In order to retain the boundary features to the greatest extent, considering the advantages of B-spline curves in terms of flexible construction, fast convergence, and segmented adjustment, the present invention performs boundary point fitting processing on the Λ6 point set based on a uniform cubic uniform B-spline curve, specifically:
[0082] Assume that there are n+1 ordered spatial points P0, P1, ..., P n , if we put the adjacent k+1 points P in order i , P i+1 , P i+2 ,…,P i+k (i=0,1,2,…,nk) linear combination constructs k-order curve:
[0083]
[0084] Among them, B j,k (u) The i-th k-order B-spline function basis. When i is given, C i (u) is a k-order Bezier curve segment, so there are n+1-k curve segments in total. Connect these n+1-k curve segments end to end and ensure k-1 order continuity at the connection point to form a complete k-order B-spline curve.
[0085] Basis functions of uniform cubic uniform B-spline curves:
[0086]
[0087] Combining equation (2) and equation (3) we can get the matrix expression of uniform cubic uniform B-spline curve:
[0088]
[0089] The cubic B-spline function is used to construct the curve, that is, according to n known points Q i(i=0,1,2,…,n-1), construct a cubic B-spline function curve passing through these n points. At this time, Q i is a point on the B-spline curve, called a type value point. If these n points are directly used as control points to construct a B-spline curve, the repetition degree at the node must be at least 3 so that the constructed curve can pass through these points. However, this reduces the continuity of the curve at each connection point and cannot meet the path requirements. Therefore, it is usually adopted to pass through the type value point Q i Inversely find the control point P of the B-spline curve i Then the curve is constructed by the control points. The B-spline curve constructed in this way must pass through the type value point Q i .
[0090] Assume that the cubic uniform B-spline curve type value point Q is known i (i=0,1,2,…,n-1), then the curve segment C i-1 (u) The end point and C i (u) The first and last endpoints are both Q i ,Right now:
[0091] C i-1 (1) = C i (0) = 6Q i (i=0,1,2,…,n-1) (5)
[0092] Combining (4) and (5) we can get the linear equation system:
[0093] P i +4P i+1 +P i+2 =6Q i (i=0,1,2,…,n-1) (6)
[0094] The equation group (6) has n+2 unknowns and only n equations. For an open curve, we only need to add the first and last endpoint conditions:
[0095]
[0096] The simultaneous equations (6) and (7) can be used to obtain the n+2 control points of the interpolation curve. Substituting these control points into equation (4) can obtain the interpolation closed polygonal curve, corresponding to the point set Λ7, which is the third boundary point set.
[0097] S5, compressing the third boundary point set again to obtain a final enclosure boundary point set.
[0098] For the point set Λ7, the Douglas-Peucker algorithm described in S1 is used again to perform secondary compression of the boundary points. The compression threshold is δ2. In the present invention, δ1<δ2 is taken to obtain the final enclosure boundary point set Λ8. The output result of this step can be directly used as the input of the subsequent agricultural machinery global path planning module.
[0099] also, Figure 2 and Figure 3 The results of the closed and sharp point processing in the display and control terminal system are shown respectively. The processing efficiency is as follows Figure 4 As shown, the processing speed can be guaranteed to be in the millisecond level, and the numbers on the figure are the calculated point numbers.
[0100] Through the above scheme, the effects that can be achieved by the present invention are:
[0101] (1) In order to address the problem of too many existing circle points resulting in low efficiency in boundary processing, the present invention adopts a point compression strategy based on the Douglas Peucker algorithm twice, which greatly improves the boundary processing speed and saves time for the subsequent path planning algorithm.
[0102] (2) In order to cope with the randomness of boundary points caused by different users' different marking habits, the present invention adds a elimination strategy for unfavorable features such as closed loops and sharp points that may appear in the starting and ending segments when processing boundary points, thereby providing high-quality input for the subsequent path planning algorithm and facilitating the calculation and output of the planning algorithm.
[0103] (3) Based on the acquired boundary points, the present invention adds a fitting step of a uniform cubic uniform B-spline curve, so that the enclosure polygon finally obtained retains more of its original features and is more in line with the actual situation.
[0104] Further, the skeleton point set is subjected to indentation processing to obtain the indentation point set. Specifically, the process is as follows:
[0105] In the skeleton point set, any three adjacent elements are selected, the angles of two vectors formed by the three elements are subtracted, and all subtraction results are counted to determine the encircling rotation direction of the skeleton point set;
[0106] According to a preset threshold and the enclosure rotation direction, all elements in the skeleton point set are sequentially translated to obtain a translated element corresponding to each element, and all translated elements are integrated to obtain an indented point set.
[0107] Further, according to the fitting result, the process of removing outliers from the indentation point set to obtain the first boundary point set after removing the indentation points is specifically as follows:
[0108] Determine a line between the first endpoint in the indented point set and the first endpoint in the enclosure boundary point set to obtain a second reference line, determine a second distance value between the first endpoint in the indented point set and the second reference line, and determine a third distance value between the first endpoint in the indented point set and the end point in the indented point set;
[0109] When the second distance value and the third distance value meet the preset condition, taking the first endpoint and the end point in the indentation point set as the starting point, respectively selecting the first fixed length to obtain the first segment point set and the second segment point set, respectively establishing linear regression models for the first segment point set and the second segment point set, and determining the optimal point set in the first segment point set and the second segment point set based on the ordinary R-square value corresponding to each linear regression model;
[0110] Reversely arrange the elements in the indentation point set to obtain a reverse indentation point set, take the first endpoint in the reverse indentation point set as the starting point, select a second fixed length to obtain a third segment point set, determine a fourth distance value between each element in the third segment point set and the end point in the reverse indentation point set, and determine a first index value corresponding to the minimum value of the fourth distance values;
[0111] Determine a line segment between an end point in the reverse indentation point set and an element adjacent to the end point to obtain a third reference line, determine fifth distance values between all elements in the third segment point set and the third reference line, and determine a second index value corresponding to a minimum value in the fifth distance values;
[0112] A final index value is determined according to the first index value and the second index value, and elements corresponding to the final index value are removed from the indentation point set to generate a first boundary point set after removing the indentation points.
[0113] Further, the process of traversing the elements in the first boundary point set after removing the indentation points and removing the closed loop points to obtain the second boundary point set after removing the closed loop points specifically includes:
[0114] In the first boundary point set after removing the indented points, a middle point is randomly selected, and according to the middle point, the first boundary point set after removing the indented points is divided into a front segment and a rear segment, and the intersection of a line segment composed of any two adjacent points in the front segment and a line segment composed of any two adjacent points in the rear segment is calculated, and it is determined whether the position of the intersection meets the position condition. If the position condition is met, elements other than the index value corresponding to the intersection are removed, and a second boundary point set after removing the closed loop points is generated with the intersection as the first endpoint.
[0115] Further, the second boundary point set is subjected to a cubic uniform B-spline curve polygon fitting process to obtain a third boundary point set in the following specific process:
[0116] A type value point is determined in advance, and a cubic uniform B-spline curve corresponding to the type value point is determined by an assumption method. According to the first and last endpoints of the cubic uniform B-spline curve, combined with the matrix of the cubic uniform B-spline curve, a third boundary point set is determined.
[0117] In the above embodiments, although the steps are numbered S1, S2, etc., these are only specific embodiments given by the present invention. Those skilled in the art may adjust the execution order of S1, S2, etc. according to actual conditions, which is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.
[0118] The present invention also provides a system for processing enclosure boundary points for agricultural machinery navigation, and the specific technical solution is as follows:
[0119] The acquisition module is used to: acquire a set of enclosure boundary points for agricultural machinery navigation, and compress the set of enclosure boundary points by using the Douglas-Peucker algorithm to obtain a compressed skeleton point set;
[0120] The first fitting module is used to: perform indentation processing on the skeleton point set to obtain an indentation point set, perform feature fitting on the starting segment and the ending segment of the enclosure boundary, and remove outliers from the indentation point set according to the fitting result to obtain a first boundary point set after removing the indentation points;
[0121] The elimination module is used to: traverse the elements in the first boundary point set after eliminating the indentation points, and eliminate the closed loop points to obtain the second boundary point set after eliminating the closed loop points;
[0122] The second fitting module is used to: perform a cubic uniform B-spline curve polygon fitting process on the second boundary point set to obtain a third boundary point set;
[0123] The processing module is used to: perform compression processing on the third boundary point set again to obtain a final enclosure boundary point set.
[0124] It should be noted that the beneficial effects of the enclosure boundary point processing system for agricultural machinery navigation provided by the above embodiment are the same as the beneficial effects of the enclosure boundary point processing method for agricultural machinery navigation, which will not be repeated here. In addition, when the system provided by the above embodiment realizes its functions, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to actual conditions to complete all or part of the functions described above. In addition, the system and method embodiments provided by the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0125] like Figure 5 As shown, an electronic device 300 according to an embodiment of the present invention includes a processor 320, the processor 320 is coupled to a memory 310, and the memory 310 stores at least one computer program 330, and the at least one computer program 330 is loaded and executed by the processor 320, so that the electronic device 300 implements any of the above methods, specifically:
[0126] The electronic device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein at least one computer program 330 is stored in the one or more memories 310, and the at least one computer program 330 is loaded and executed by the one or more processors 320, so that the electronic device 300 implements a method for processing enclosure boundary points for agricultural machinery navigation provided in the above embodiment. Of course, the electronic device 300 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the electronic device 300 may also include other components for realizing device functions, which will not be repeated here.
[0127] A computer-readable storage medium according to an embodiment of the present invention stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements any one of the above methods.
[0128] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0129] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs any of the above methods.
[0130] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.
[0131] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.
[0132] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0133] 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 processing enclosure boundary points for agricultural machinery navigation, characterized in that: include: S1, obtaining a set of enclosure boundary points for agricultural machinery navigation, and compressing the set of enclosure boundary points by using the Douglas-Peucker algorithm to obtain a compressed skeleton point set; S2, performing an indentation process on the skeleton point set to obtain an indentation point set, performing feature fitting on the starting segment and the ending segment of the enclosure boundary, and removing outliers from the indentation point set according to the fitting result to obtain a first boundary point set after removing the indentation points; S3, traversing the elements in the first boundary point set after removing the indentation points, and removing the closed loop points, to obtain a second boundary point set after removing the closed loop points; S4, performing a cubic uniform B-spline curve polygon fitting process on the second boundary point set to obtain a third boundary point set; S5, compressing the third boundary point set again to obtain a final enclosure boundary point set.
2. A method for processing enclosure boundary points for agricultural machinery navigation according to claim 1, characterized in that: The specific process of compressing the enclosure boundary point set by Douglas-Peucker algorithm to obtain the compressed skeleton point set is as follows: S11, determining a first endpoint and an end point in the enclosure boundary point set, and connecting the first endpoint with the end point to obtain a first reference line, and determining a first distance value between all elements in the enclosure boundary point set excluding the first endpoint and the end point and the first reference line; S12, determining a maximum value among all the first distance values, and when the maximum value is greater than a preset distance value, taking an element corresponding to the maximum value as a demarcation point, dividing the enclosure boundary point set into two parts, the first part being a first set starting from the head end point and terminating at the demarcation point, and the second part being a second set starting from the demarcation point and terminating at the end point; S13, using the first set and the second set as the enclosure boundary point set in S11 to repeat S11 and S12, storing the boundary points in each repetition process into the initial skeleton point set, until the number of elements in the initial skeleton point set no longer increases after a preset number of repetitions, and using the initial skeleton point set as the skeleton point set.
3. The method for processing enclosure boundary points for agricultural machinery navigation according to claim 1, characterized in that: The process of performing indentation processing on the skeleton point set to obtain the indentation point set is specifically as follows: In the skeleton point set, any three adjacent elements are selected, the angles of two vectors formed by the three elements are subtracted, and all subtraction results are counted to determine the encircling rotation direction of the skeleton point set; According to a preset threshold and the enclosure rotation direction, all elements in the skeleton point set are sequentially translated to obtain a translated element corresponding to each element, and all translated elements are integrated to obtain an indented point set.
4. The method for processing enclosure boundary points for agricultural machinery navigation according to claim 1, characterized in that: According to the fitting result, the process of removing outliers from the indentation point set to obtain the first boundary point set after removing the indentation points is specifically as follows: Determine a line between the first endpoint in the indented point set and the first endpoint in the enclosure boundary point set to obtain a second reference line, determine a second distance value between the first endpoint in the indented point set and the second reference line, and determine a third distance value between the first endpoint in the indented point set and the end point in the indented point set; When the second distance value and the third distance value meet the preset condition, taking the first endpoint and the end point in the indentation point set as the starting point, respectively selecting the first fixed length to obtain the first segment point set and the second segment point set, respectively establishing linear regression models for the first segment point set and the second segment point set, and determining the optimal point set in the first segment point set and the second segment point set based on the ordinary R-square value corresponding to each linear regression model; Reversely arrange the elements in the indentation point set to obtain a reverse indentation point set, take the first endpoint in the reverse indentation point set as the starting point, select a second fixed length to obtain a third segment point set, determine a fourth distance value between each element in the third segment point set and the end point in the reverse indentation point set, and determine a first index value corresponding to the minimum value of the fourth distance values; Determine a line segment between an end point in the reverse indentation point set and an element adjacent to the end point to obtain a third reference line, determine fifth distance values between all elements in the third segment point set and the third reference line, and determine a second index value corresponding to a minimum value in the fifth distance values; A final index value is determined according to the first index value and the second index value, and elements corresponding to the final index value are removed from the indentation point set to generate a first boundary point set after removing the indentation points.
5. The method for processing enclosure boundary points for agricultural machinery navigation according to claim 1, characterized in that: The process of traversing the elements in the first boundary point set after removing the indentation points and removing the closed loop points to obtain the second boundary point set after removing the closed loop points specifically includes: In the first boundary point set after removing the indented points, a middle point is randomly selected, and according to the middle point, the first boundary point set after removing the indented points is divided into a front segment and a rear segment, and the intersection of a line segment composed of any two adjacent points in the front segment and a line segment composed of any two adjacent points in the rear segment is calculated, and it is determined whether the position of the intersection meets the position condition. If the position condition is met, elements other than the index value corresponding to the intersection are removed, and a second boundary point set after removing the closed loop points is generated with the intersection as the first endpoint.
6. The method for processing enclosure boundary points for agricultural machinery navigation according to claim 1, characterized in that: The specific process of performing a cubic uniform B-spline curve polygon fitting process on the second boundary point set to obtain the third boundary point set is as follows: A type value point is determined in advance, and a cubic uniform B-spline curve corresponding to the type value point is determined by an assumption method. According to the first and last endpoints of the cubic uniform B-spline curve, combined with the matrix of the cubic uniform B-spline curve, a third boundary point set is determined.
7. A system for processing enclosure boundary points for agricultural machinery navigation, characterized in that: include: The acquisition module is used to: acquire a set of enclosure boundary points for agricultural machinery navigation, and compress the set of enclosure boundary points by using the Douglas-Peucker algorithm to obtain a compressed skeleton point set; The first fitting module is used to: perform indentation processing on the skeleton point set to obtain an indentation point set, perform feature fitting on the starting segment and the ending segment of the enclosure boundary, and remove outliers from the indentation point set according to the fitting result to obtain a first boundary point set after removing the indentation points; The elimination module is used to: traverse the elements in the first boundary point set after eliminating the indentation points, and eliminate the closed loop points to obtain the second boundary point set after eliminating the closed loop points; The second fitting module is used to: perform a cubic uniform B-spline curve polygon fitting process on the second boundary point set to obtain a third boundary point set; The processing module is used to: perform compression processing on the third boundary point set again to obtain a final enclosure boundary point set.
8. An electronic device, characterized in that: The electronic device comprises a processor, the processor is coupled to a memory, at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the electronic device implements the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements the method according to any one of claims 1 to 6.
10. An agricultural machine, characterized in that: Comprising the electronic device as claimed in claim 8.
Citation Information
Patent Citations
Boundary simplification methods, path planning methods, devices, equipment and systems
CN114485664B