Agricultural machine working area measurement method and device
By establishing a second coordinate system based on the direction of maximum variance and performing grid division in agricultural machinery operations, combined with data thinning and Kalman filtering, the area measurement of agricultural machinery operations is optimized, solving the problem of large errors in existing technologies and achieving higher precision area measurement.
Patent Information
- Application Number
- CN202110748519.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-02
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2041-07-02
AI Technical Summary
Existing methods for measuring the operating area of agricultural machinery have large errors, especially when the wheels slip, the ground is uneven, or the operations overlap, making it difficult to achieve accurate measurements.
By acquiring agricultural machinery operation trajectory data, a second coordinate system based on the direction of maximum variance is established, rectangles are generated and grids are divided, the area after merging is calculated, and the calculation process is optimized by combining data thinning and Kalman filtering techniques.
It improves the accuracy of agricultural machinery operation area measurement, reduces the amount of calculation, and solves the problem of inaccurate measurement caused by heavy tillage.
Smart Images

Figure CN115560717B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of intelligent agricultural technology, and in particular to a method and device for measuring the area of agricultural operation. BACKGROUND
[0002] With the increasing concentration of rural land, large farmland provides favorable conditions for mechanized cultivation. Mechanized and intelligent modern agriculture is developing continuously. Under the development trend of precision agriculture, the calculation of the area of agricultural operation can not only count crop yield, but also serve as the basis for charging for public agricultural operation.
[0003] The existing dynamic measurement methods for the area of agricultural operation mainly include the wheel rotation method and the navigation positioning method. The wheel rotation method calculates the number of wheel rotations by using a speed sensor when the agricultural machine is driven, indirectly obtains the operation distance, and then calculates the operation area by multiplying the operation distance by a fixed width. This method is simple in principle and low in cost, but it is prone to large errors when the wheels slip, the ground is uneven, and there is overlap or omission during operation.
[0004] The measurement method for the area of agricultural operation based on navigation positioning can be roughly divided into two categories: one is a boundary-based measurement method, and the other is a trajectory-based measurement method. The boundary-based area measurement method can measure the area of irregular plots. Generally, the larger the plot area, the higher the accuracy of the measurement result. However, this method cannot perform real-time dynamic measurement of the area of agricultural operation. The trajectory-based measurement method mainly uses the width measurement method, which is the product of the length of the agricultural machine trajectory and the operation width during operation. When the agricultural machine is controlled by an automatic navigation system to perform full-width operation, the accuracy of the area measurement is relatively high. However, in reality, most agricultural operations are performed without navigation or reference, relying on the experience of the driver, which can easily result in overlapping of the operation area. SUMMARY
[0005] To solve the existing technical problems, the embodiments of the present application provide a method and device for measuring the area of agricultural operation.
[0006] To achieve the above-mentioned purposes, the technical solutions of the embodiments of the present application are as follows:
[0007] In a first aspect, the embodiments of the present application provide a method for measuring the area of agricultural operation, comprising:
[0008] obtaining running trajectory data of the agricultural machine in a first coordinate system;
[0009] establishing a second coordinate system based on the maximum variance direction of the running trajectory data in the first coordinate system, and determining the coordinates of each trajectory point corresponding to the running trajectory data in the second coordinate system;
[0010] Translate the coordinates according to the first buffer distance, generate a first rectangle corresponding to each trajectory point based on the translated coordinates, and determine a second rectangle covering all the first rectangles according to the coordinate axis direction of the second coordinate system;
[0011] Grid division is performed on the second rectangle, and the area of all the first rectangles after merging is determined in the second rectangle according to the divided grid, to obtain the working area of the agricultural machine.
[0012] In some optional embodiments of the present application, after obtaining the running trajectory data of the agricultural machine in the first coordinate system, the method further comprises:
[0013] Data thinning processing is performed on the running trajectory data;
[0014] The second coordinate system is established based on the maximum variance direction of the running trajectory data in the first coordinate system, comprising:
[0015] The second coordinate system is established based on the maximum variance direction of the running trajectory data after data thinning processing in the first coordinate system.
[0016] In some optional embodiments of the present application, the data thinning processing on the running trajectory data comprises:
[0017] A target trajectory point corresponding to the running trajectory data is obtained, the target trajectory point being a trajectory point in the running trajectory data having the maximum perpendicular distance to the line connecting the two end points, a threshold index is determined according to the target trajectory point, the threshold index being the larger of a first value and a second value, wherein the first value is the perpendicular distance of the target trajectory point to the line connecting the two end points, and the second value is the smaller of the distance of the target trajectory point to the two end points;
[0018] In the case where the threshold index is greater than or equal to a first threshold value, the target trajectory point is retained, the running trajectory data is segmented with the target trajectory point, the target trajectory point corresponding to the segmented running trajectory data is re-obtained, and the threshold index is re-determined;
[0019] In the case where the threshold index is less than the first threshold value, the remaining trajectory points in the running trajectory data except the two end points are discarded.
[0020] In some optional embodiments of the present application, the grid division on the second rectangle comprises:
[0021] According to the first grid division factor and the size of the second rectangle, it is determined whether the memory required for grid division exceeds a second threshold value;
[0022] when the memory does not exceed the second threshold, performing grid division on the second rectangle based on the first grid division factor;
[0023] when the memory exceeds the second threshold, determining a second grid division factor according to the second threshold and a size of the second rectangle, the second grid division factor being greater than the first grid division factor; and performing grid division on the second rectangle based on the second grid division factor.
[0024] In some optional embodiments of the present application, the establishing a second coordinate system based on the maximum variance direction of the running track data in the first coordinate system comprises:
[0025] performing principal component analysis (PCA) on the coordinates of each track point in the first coordinate system to determine the maximum variance direction of the running track data, and establishing the second coordinate system with the maximum variance direction and a direction perpendicular to the maximum variance direction as coordinate axes.
[0026] In some optional embodiments of the present application, the translating the coordinates by the first buffer distance and generating a first rectangle corresponding to each track point based on the translated coordinates comprises:
[0027] determining a perpendicular line direction of a line connecting each track point and an adjacent track point according to the coordinates of each track point in the second coordinate system;
[0028] translating the coordinates of each track point in the second coordinate system by the first buffer distance in two directions indicated by the perpendicular line direction to obtain a first vertex coordinate and a second vertex coordinate corresponding to each track point respectively, and generating a first rectangle corresponding to each track point based on the first vertex coordinate and the second vertex coordinate of each track point and an adjacent track point after translation.
[0029] In some optional embodiments of the present application, the determining a second rectangle covering all the first rectangles according to the coordinate axis direction of the second coordinate system comprises:
[0030] obtaining a horizontal axis maximum value, a horizontal axis minimum value, a vertical axis maximum value and a vertical axis minimum value of vertex coordinates of all the first rectangles in the second coordinate system;
[0031] determining the second rectangle based on the horizontal axis maximum value, the horizontal axis minimum value, the vertical axis maximum value, the vertical axis minimum value and a second buffer distance.
[0032] In some optional embodiments of the present application, the obtaining running track data of the agricultural machine in the first coordinate system comprises:
[0033] The satellite navigation positioning device obtains the geodetic coordinates of each trajectory point when the agricultural machine moves, and determines the coordinates of each trajectory point in a navigation coordinate system according to the geodetic coordinates, wherein the navigation coordinate system is a three-dimensional rectangular coordinate system with an initial position of the agricultural machine when the agricultural machine moves as an origin.
[0034] The coordinates in the navigation coordinate system are subjected to Kalman filtering, and the running trajectory data of the agricultural machine in the first coordinate system is determined based on the coordinates subjected to Kalman filtering; the first coordinate system is a projection coordinate system of the navigation coordinate system on a horizontal plane.
[0035] In some optional embodiments of the present application, the area of all the first rectangles after merging is determined according to the divided grids in the second rectangle, including:
[0036] The number of grids covered by all the first rectangles is determined by traversing the grids in the second rectangle, and the area of all the first rectangles after merging is determined based on the number of grids and the area of a single grid.
[0037] In a second aspect, the embodiments of the present application provide an agricultural machine working area measuring device, including:
[0038] A data acquisition module is configured to acquire running trajectory data of an agricultural machine in a first coordinate system.
[0039] A coordinate conversion module is configured to establish a second coordinate system based on a maximum variance direction of the running trajectory data in the first coordinate system, and determine coordinates of each trajectory point corresponding to the running trajectory data in the second coordinate system.
[0040] An area determination module is configured to translate the coordinates by a first buffer distance, generate first rectangles corresponding to each trajectory point based on the translated coordinates, and determine a second rectangle covering all the first rectangles according to a coordinate axis direction of the second coordinate system.
[0041] An area calculation module is configured to divide grids in the second rectangle, determine the area of all the first rectangles after merging according to the divided grids in the second rectangle, and obtain a working area of the agricultural machine.
[0042] In some optional embodiments of the present application, the device further includes:
[0043] A data processing module is configured to perform data thinning processing on the running trajectory data.
[0044] The coordinate conversion module is further configured to establish a second coordinate system based on a maximum variance direction of the running trajectory data subjected to data thinning processing by the data processing module in the first coordinate system.
[0045] In some optional embodiments of the present application, the data processing module comprises:
[0046] a first processing submodule, configured to acquire a target trajectory point corresponding to the running trajectory data, the target trajectory point being a trajectory point with the maximum perpendicular distance to the line connecting two end points among the trajectory points of the running trajectory data, and determine a threshold index according to the target trajectory point, the threshold index being the larger one of a first value and a second value, wherein the first value is the perpendicular distance of the target trajectory point to the line connecting two end points, and the second value is the smaller one of the distances of the target trajectory point to the two end points;
[0047] and a second processing submodule, configured to retain the target trajectory point and segment the running trajectory data with the target trajectory point in the case where the threshold index determined by the first processing submodule is greater than or equal to a first threshold value, reacquire a target trajectory point corresponding to the segmented running trajectory data according to the first submodule, and redetermine a threshold index; and configured to discard the trajectory points other than the two end points in the running trajectory data in the case where the threshold index is less than the first threshold value.
[0048] In some optional embodiments of the present application, the area calculation module comprises:
[0049] a first calculation submodule, configured to determine whether the memory required for grid division exceeds a second threshold value according to a preset first grid division factor and the size of the second rectangle;
[0050] and a second calculation submodule, configured to perform grid division on the second rectangle based on the first grid division factor in the case where the first calculation submodule determines that the memory does not exceed the second threshold value; and configured to determine a second grid division factor according to the second threshold value and the size of the second rectangle in the case where the memory exceeds the second threshold value, the second grid division factor being greater than the first grid division factor; and perform grid division on the second rectangle based on the second grid division factor.
[0051] In some optional embodiments of the present application, the coordinate conversion module is configured to perform PCA on the coordinates of each trajectory point in the first coordinate system, determine the direction of maximum variance of the running trajectory data, and establish the second coordinate system with the direction of maximum variance and the direction perpendicular to the direction of maximum variance as coordinate axes.
[0052] In some optional embodiments of the present application, the area determining module is configured to: determine a perpendicular line direction of a line connecting each trajectory point and an adjacent trajectory point according to the coordinates of each trajectory point in the second coordinate system; translate the coordinates of each trajectory point in the second coordinate system in two directions indicated by the perpendicular line direction by the first buffer distance, respectively, to obtain a first vertex coordinate and a second vertex coordinate corresponding to each trajectory point; and generate a first rectangle corresponding to each trajectory point based on the first vertex coordinate and the second vertex coordinate of each trajectory point after translation.
[0053] In some optional embodiments of the present application, the area determining module includes:
[0054] a first determining sub-module configured to obtain a maximum horizontal axis value, a minimum horizontal axis value, a maximum vertical axis value and a minimum vertical axis value of the vertex coordinates of all the first rectangles in the second coordinate system; and
[0055] a second determining sub-module configured to determine the second rectangle based on the maximum horizontal axis value, the minimum horizontal axis value, the maximum vertical axis value, the minimum vertical axis value and the second buffer distance.
[0056] In some optional embodiments of the present application, the data obtaining module includes:
[0057] a first obtaining sub-module configured to obtain geodetic coordinates of each trajectory point when the agricultural machine moves by using a satellite navigation positioning device, and determine the coordinates of each trajectory point in a navigation coordinate system according to the geodetic coordinates, the navigation coordinate system being a three-dimensional rectangular coordinate system established with an initial position of the agricultural machine when the agricultural machine moves as an origin; and
[0058] a second obtaining sub-module configured to perform Kalman filtering on the coordinates in the navigation coordinate system, and determine the running trajectory data of the agricultural machine in the first coordinate system based on the coordinates after Kalman filtering, the first coordinate system being a projection coordinate system of the navigation coordinate system on a horizontal plane.
[0059] In some optional embodiments of the present application, the area calculating module is configured to: traverse the grid in the second rectangle, determine the number of grids covered by all the first rectangles, and determine the area of all the first rectangles after merging based on the number of grids and the area of a single grid.
[0060] In a third aspect, an embodiment of the present application provides a measuring device, including a processor and a memory for storing a computer program capable of running on the processor, wherein the processor is configured to execute the steps of the method of the embodiment of the present application when running the computer program.
[0061] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the method according to the embodiments of the present application.
[0062] The embodiment of the present application provides a farmland working area measurement method and device, the maximum variance direction of farmland operation track data is determined to determine the minimum rectangle covering the farmland working area, so that the grid theory optimal is consumed when the farmland working area is calculated by using the grid, the problem of inaccurate area measurement caused by farmland re-cultivation is solved, and the measurement precision is improved. BRIEF DESCRIPTION OF DRAWINGS
[0063] Figure 1 The flowchart of the farmland working area measurement method according to the embodiment of the present application Figure One ;
[0064] Figure 2 The conversion schematic diagram of the first coordinate system and the second coordinate system according to the embodiment of the present application
[0065] Figure 3 The schematic diagram of the first rectangle according to the embodiment of the present application
[0066] Figure 4 The schematic diagram of the second rectangle according to the embodiment of the present application
[0067] Figure 5 The grid division schematic diagram according to the embodiment of the present application
[0068] Figure 6 The flowchart of the farmland working area measurement method according to the embodiment of the present application Figure Two ;
[0069] Figure 7 The data thinning process schematic diagram according to the embodiment of the present application
[0070] Figure 8 The flowchart of the farmland working area measurement method according to the embodiment of the present application Figure Three ;
[0071] Figure 9 The structure schematic diagram of the farmland working area measurement device according to the embodiment of the present application Figure One ;
[0072] Figure 10 The structure schematic diagram of the farmland working area measurement device according to the embodiment of the present application Figure Two ;
[0073] Figure 11 The hardware structure schematic diagram of the measurement equipment according to the embodiment of the present application. DETAILED DESCRIPTION
[0074] The application will be described in further detail below with reference to the drawings and specific embodiments.
[0075] The embodiment of the application provides a farmland working area measurement method. Figure 1 The flowchart of the image processing method of the embodiment of the application is shown in Figure One As shown in Figure 1 The method comprises the following steps.
[0076] In step 101, running track data of a farm machine in a first coordinate system is acquired.
[0077] In step 102, a second coordinate system is established based on a maximum variance direction of the running track data in the first coordinate system, and coordinates of each track point corresponding to the running track data in the second coordinate system are determined.
[0078] In step 103, the coordinates are translated by a first buffer distance, first rectangles corresponding to each track point are generated based on the translated coordinates, and a second rectangle covering all the first rectangles is determined according to the coordinate axis direction of the second coordinate system.
[0079] In step 104, the second rectangle is divided into grids, the area of all the first rectangles after merging is determined in the second rectangle according to the divided grids, and the working area of the farm machine is obtained.
[0080] The farmland working area measurement method of the embodiment is applied to a farmland working area measurement device, and the farmland working area measurement device is arranged in a measurement equipment. The measurement equipment can be an electronic device with a processing function such as a personal computer or a server, or can also be an on-board device located on a farm machine. The measurement equipment is taken as an example for description.
[0081] In the embodiment, the first coordinate system is a two-dimensional coordinate system. For example, a navigation positioning device is arranged on the farm machine, the navigation positioning device acquires positioning information of the farm machine as running track data every set time, the running track data can comprise position information and time of the farm machine, and the positioning information is sent to an upper computer for storage. It should be noted that when the positioning information of the farm machine acquired by the navigation positioning device is three-dimensional coordinates, the three-dimensional coordinates can be projected onto a horizontal plane where the farm machine is located, as the running track data of the farm machine in the first coordinate system, so as to facilitate calculation of the working area. The navigation positioning device can be implemented based on satellite navigation, inertial navigation, combined navigation and the like, and the application is not limited in this regard.
[0082] In some optional embodiments, if the measuring device is an electronic device such as a personal computer, the measuring device can obtain the running track data obtained by the navigation positioning device through a wired connection or a wireless connection; or the running track data in the agricultural machine can be copied through a plug-and-play flash disk (such as a U disk, a mobile hard disk, etc.), and then the measuring device is connected with the flash disk to obtain the running track data in the flash disk.
[0083] Optionally, when the navigation positioning device arranged on the agricultural machine has a relatively large output frequency, such as 10 Hz, due to the limitation of the running speed of the agricultural machine, a too high output frequency will result in too many repeated track points, affecting the final calculation accuracy of the working area. Therefore, the running track data can be data obtained by sparsifying the positioning information output by the navigation positioning device. Optionally, when the running distance of the agricultural machine exceeds a preset threshold or the heading change of the agricultural machine exceeds a preset angle, such as 0.5 meters (m) or 5 degrees (°), the positioning information is retained to generate the running track data of the agricultural machine.
[0084] In step 102, one coordinate axis of the second coordinate system is the maximum variance direction of the running track data in the first coordinate system, and the other coordinate axis is the direction perpendicular to the maximum variance direction. The first coordinate system can be obtained by rotating or rotating and translating the second coordinate system. In some embodiments, the origin of the second coordinate system can coincide with the origin of the first coordinate system. At this time, according to the coordinate axis direction of the second coordinate system and the coordinate axis direction of the first coordinate system, a rotation matrix between the first coordinate system and the second coordinate system is determined, and the coordinates of each track point corresponding to the running track data in the first coordinate system can be converted into the coordinates in the second coordinate system through the rotation matrix. In other embodiments, the origin of the second coordinate system does not coincide with the origin of the first coordinate system. For example, the origin of the second coordinate system is determined according to the average value of the coordinates of each track point in the first coordinate system, or other coordinates convenient for calculation are used as the origin of the second coordinate system. At this time, a translation matrix is determined according to the origin of the second coordinate system and the origin of the first coordinate system, and / or a rotation matrix is determined according to the origin of the second coordinate system and the origin of the first coordinate system. The coordinates of each track point corresponding to the running track data in the first coordinate system can be converted into the coordinates in the second coordinate system through the rotation matrix and / or the translation matrix.
[0085] As an optional implementation, in step 102, the second coordinate system is established based on the maximum variance direction of the running track data in the first coordinate system, including: performing PCA on the coordinates of each track point in the first coordinate system to determine the maximum variance direction of the running track data, and establishing the second coordinate system with the maximum variance direction and the direction perpendicular to the maximum variance direction as coordinate axes.
[0086] In this embodiment, the PCA on the coordinates of each trajectory point in the first coordinate system comprises: performing a centering processing on the coordinates in the first coordinate system; calculating a covariance matrix of the centered coordinates; calculating eigenvalues and eigenvectors of the covariance matrix; sorting the eigenvalues from large to small, and constructing a projection matrix according to the eigenvectors corresponding to the sorted eigenvalues.
[0087] The centering processing refers to subtracting the mean value of the horizontal axis coordinates of all trajectory points from the horizontal axis coordinate of each trajectory point in the first coordinate system, and subtracting the mean value of the vertical axis coordinates of all trajectory points from the vertical axis coordinate of each trajectory point in the first coordinate system, to obtain the centered coordinates.
[0088] It should be noted that the purpose of PCA is to find a transformation matrix, so that the data in the original space has a larger variance after being projected to the transformed space. It can be understood that for the two-dimensional coordinates in the first coordinate system in this embodiment, two eigenvalues can be calculated, and after sorting from large to small, the first eigenvector corresponding to the largest eigenvalue and the second eigenvector corresponding to the second eigenvalue can be determined. The first eigenvector can make the data in the original space have the maximum variance after being projected onto the first eigenvector, and the second eigenvector can make the data in the original space have the maximum variance after being projected onto the plane composed of the first eigenvector and the second eigenvector. That is, the purpose of performing PCA on the two-dimensional coordinates in the first coordinate system in this embodiment is to find a set of mutually perpendicular two-dimensional basis vectors, so that after all coordinates in the first coordinate system are transformed into coordinates on the two-dimensional basis vectors, the variance value is maximum.
[0089] As shown in Figure 2 According to the projection matrix, the coordinate axes of the first coordinate system can be rotated to the maximum variance direction and the perpendicular direction of the maximum variance direction Thus, the second coordinate system is established. In this embodiment, by multiplying the projection matrix by the coordinates of each trajectory point in the first coordinate system, the coordinates of the trajectory point in the second coordinate system can be obtained.
[0090] In step 103, the first buffer distance is a pre-set distance value, and optionally, the first buffer distance is related to the implement width of the agricultural machine. As an implementation manner, the first buffer distance is the implement width, and the translation of the coordinates according to the first buffer distance can comprise:
[0091] translating the coordinates in the second coordinate system along the first direction by the first buffer distance; or,
[0092] translating the coordinates in the second coordinate system by a first distance in a first direction and by a second distance in a direction opposite to the first direction, the sum of the first distance and the second distance being the first buffer distance.
[0093] The first direction can be determined by a working direction of the farm implement and a forward direction of the agricultural machine. For example, when the working direction of the farm implement is perpendicular to the forward direction of the agricultural machine, the first direction can be a direction of a perpendicular line of a line connecting each trajectory point and an adjacent trajectory point, or a direction perpendicular to a velocity direction of each trajectory point output by a navigation positioning device, etc.
[0094] As another embodiment, the first buffer distance is half of a width of the farm implement, as shown in Figure 3 The translation of the coordinates by the first buffer distance and the generation of the first rectangle corresponding to each trajectory point based on the translated coordinates include:
[0095] determining a direction of a perpendicular line of a line connecting each trajectory point and an adjacent trajectory point according to the coordinates of each trajectory point in the second coordinate system;
[0096] translating the coordinates of each trajectory point in the second coordinate system by the first buffer distance in two directions indicated by the direction of the perpendicular line, respectively obtaining a first vertex coordinate and a second vertex coordinate corresponding to each trajectory point, and generating the first rectangle corresponding to each trajectory point based on the translated first vertex coordinate and the second vertex coordinate of each trajectory point and an adjacent trajectory point.
[0097] As shown in Figure 3 For any trajectory point, a direction of a perpendicular line of a line connecting the trajectory point and a subsequent adjacent trajectory point is determined (as shown by the direction of the arrow in Figure 3 ), the coordinates of the trajectory point in the second coordinate system are translated by the first buffer distance in two directions indicated by the direction of the perpendicular line, respectively obtaining a first vertex coordinate and a second vertex coordinate corresponding to the trajectory point, and the first rectangle corresponding to the trajectory point is generated based on the first vertex coordinate and the second vertex coordinate corresponding to the trajectory point and the first vertex coordinate and the second vertex coordinate corresponding to the subsequent adjacent trajectory point.
[0098] In step 103, after the first rectangle is generated, a second rectangle covering all the first rectangles is determined, i.e., the vertex coordinates of all the first rectangles are included in a region determined by the second rectangle, for the convenience of calculating an area of an irregular figure formed by all the first rectangles.
[0099] In an optional embodiment of the present application, the determining the second rectangle covering all the first rectangles according to the coordinate axis direction of the second coordinate system comprises: obtaining the maximum horizontal axis value, the minimum horizontal axis value, the maximum vertical axis value and the minimum vertical axis value of the vertex coordinates of all the first rectangles in the second coordinate system; and determining the second rectangle based on the maximum horizontal axis value, the minimum horizontal axis value, the maximum vertical axis value, the minimum vertical axis value and a second buffer distance.
[0100] As shown in Figure 4 , according to the vertex coordinates of all the first rectangles, four vertexes a, b, c and d closest to the outside of the track point in the second coordinate system can be determined, and further, the maximum horizontal axis value X max , the minimum horizontal axis value X min , the maximum vertical axis value Y max and the minimum vertical axis value Y min in the second coordinate system can be obtained according to the coordinates of the four vertexes, and a rectangle determined by the four reference points A, B, C and D is obtained after combination, and finally, the second rectangle is obtained by extending the rectangle determined by the four reference points outward by the second buffer distance.
[0101] It should be noted that the second buffer distance can be a pre-set fixed value, or can be determined according to the size of the rectangle formed by the four reference points, and of course, the second buffer distance can also be 0.
[0102] In step 104, as shown in Figure 5 , the second rectangle is divided into grids according to a grid division factor, and the area of all the first rectangles after merging is determined according to the divided grids in the second rectangle to obtain the working area of the agricultural machine. For example, step 104 can comprise: dividing the second rectangle into grids according to a grid division factor, determining the area of a single grid; determining the graph after merging of all the first rectangles according to the vertex coordinates of all the first rectangles in the second coordinate system, calculating the number of grids contained in the graph, and determining the area of the graph according to the number of grids and the area of a single grid to obtain the working area of the agricultural machine.
[0103] The grid division factor can be a pre-set fixed value, for example, determined according to the required calculation accuracy, or can be an adaptive factor, for example, determined according to the size of the second rectangle.
[0104] Optionally, the embodiment adopts the drawing function of OpenCV to calculate the area, such as the fillConvexPoly function. The fillConvexPoly function is used to fill a convex polygon, and the function input includes a canvas, polygon vertices, polygon color, and the like. For example, the embodiment inputs the vertex coordinates of the second rectangle as the canvas of the fillConvexPoly function, inputs all the vertex coordinates of the first rectangle as the polygon vertices of the function, and sets the polygon color as black and the canvas color as white, so that, as shown in FIG. 8, all the black areas in the canvas determined by the second rectangle are the graphics after the merging of all the first rectangles, and the working area of the agricultural machine can be obtained by calculating the total area of the black grids. Figure 5
[0105] In another embodiment of the present application, the method for determining the area of all the first rectangles after merging in the second rectangle according to the divided grids includes: traversing the grids in the second rectangle, determining the number of grids covered by all the first rectangles, and determining the area of all the first rectangles after merging based on the number of grids and the area of a single grid.
[0106] By using the technical solution of the embodiment of the present application, the minimum rectangle covering the working area of the agricultural machine is determined according to the maximum variance direction of the agricultural machine running track data, so that the theoretical optimal grid is consumed when the working area of the agricultural machine is calculated by using grid division, the calculation amount is reduced, the problem of inaccurate area measurement caused by the repeated plowing of the agricultural machine is effectively solved, and the measurement accuracy is improved.
[0107] Based on the steps 101 to 104 of the foregoing embodiment, the embodiment of the present application further provides a method for measuring the working area of an agricultural machine. The embodiment is further described with respect to step 104. Specifically, in step 104, the method for dividing the second rectangle into grids includes:
[0108] Step 104a: determining whether the memory required for grid division exceeds a second threshold value according to a preset first grid division factor and the size of the second rectangle;
[0109] Step 104b: when the memory does not exceed the second threshold value, dividing the second rectangle into grids based on the first grid division factor;
[0110] Step 104c: when the memory exceeds the second threshold value, determining a second grid division factor according to the second threshold value and the size of the second rectangle, the second grid division factor being greater than the first grid division factor; and dividing the second rectangle into grids based on the second grid division factor.
[0111] In the embodiment, the second rectangle is divided into grids according to the first grid division factor by default. Since the data corresponding to each grid needs to be stored after the division of the rectangle, the first grid division factor can be reasonably selected according to the calculation memory of the host processor and the required calculation accuracy. Optionally, the first grid division factor is 1 centimeter (cm).
[0112] Specifically, whether the required memory for grid division exceeds a second threshold is determined according to the default first grid division factor and the size of the second rectangle, where the second threshold represents the system calculation memory. The number of grids after division can be determined according to the size of the second rectangle and the first grid division factor, and whether the required memory for a single grid exceeds the second threshold is determined according to the number of grids and the required memory for a single grid. When the second threshold is not exceeded, the second rectangle is divided into grids according to the first grid division factor, and when the second threshold is exceeded, a second grid division factor is determined according to the second threshold and the size of the second rectangle, and the second rectangle is divided into grids based on the second grid division factor.
[0113] For example, the second threshold is maxMemory = 2G. When the fillConvexPoly function of OpenCV is used to calculate the agricultural machinery operation area, the color of the second rectangle is set to white, and the color of the first rectangle after merging is set to black, that is, a binary image of non-black and white is finally generated. In this case, the required memory for each pixel is 1 bit, and when the trajectory data is in cm units, 1 pixel corresponds to 1 cm 2 . The first grid factor is selected as 1 cm. After grid division, the memory consumed by a single grid is 1 bit, and the number of grids can be determined according to the size of the second rectangle. For example, the width of the second rectangle is W cm, and the height is H cm. The number of grids is W x H. Whether the required memory for grid division exceeds the second threshold is determined. When the required memory exceeds the second threshold, a suitable second grid division factor is determined based on the second grid division factor, and the second rectangle is divided into grids based on the second grid division factor.
[0114] By using the grid factor with adaptive granularity for grid division, the system memory can be fully utilized to improve the calculation accuracy under the condition of meeting the system memory.
[0115] Based on the foregoing embodiment, the embodiment of the present application also provides a method for measuring the working area of a farm machine. In the embodiment, step 101 comprises: obtaining the geodetic coordinates of each trajectory point of the farm machine in movement through a satellite navigation positioning device; determining the coordinates of each trajectory point in a navigation coordinate system according to the geodetic coordinates, the navigation coordinate system being a three-dimensional rectangular coordinate system established with the initial position of the farm machine in movement as the origin; performing Kalman filtering on the coordinates in the navigation coordinate system; and determining the running trajectory data of the farm machine in the first coordinate system based on the coordinates after Kalman filtering. The first coordinate system is a projection coordinate system of the navigation coordinate system on the horizontal plane.
[0116] In the embodiment, the satellite navigation positioning device is arranged in the farm machine, and can obtain the geodetic coordinates, i.e. the latitude and longitude coordinates and the geodetic height, of each trajectory point of the farm machine in movement. The navigation coordinate system is a three-dimensional rectangular coordinate system established with the initial position of the farm machine in movement as the origin, i.e. a three-dimensional coordinate system established with the tangent plane of the earth at the position of the farm machine. Optionally, the x-axis of the navigation coordinate system points to the true north direction, the y-axis is perpendicular to the x-axis and points to the east, and the z-axis is perpendicular to the x-axis and the y-axis and points to the plumb direction. Taking the global positioning system (GPS) as an example, the geodetic coordinates output by the GPS positioning device are coordinates in the WGS84 (World Geodetic System 1984) coordinate system, and the coordinates of each trajectory point in the navigation coordinate system can be determined through coordinate conversion.
[0117] Since the output of the satellite navigation positioning device has the problems of noise and instability, the embodiment also performs Kalman filtering on the trajectory data of the farm machine in movement. Specifically, the Kalman filtering on the coordinates in the navigation coordinate system and the determination of the running trajectory data of the farm machine in the first coordinate system based on the coordinates after Kalman filtering comprise: constructing the state equation of the Kalman filtering model according to the acceleration motion model of the farm machine, taking the acceleration, the speed and the position of the farm machine as the state variables; establishing the observation equation of the Kalman filtering model according to the coordinates of each trajectory point in the navigation coordinate system; performing Kalman filtering based on the state equation and the observation equation to determine the position coordinates of the farm machine after filtering in the navigation coordinate system; and projecting the position coordinates after filtering on the horizontal plane to obtain the running trajectory data of the farm machine in the first coordinate system.
[0118] Optionally, the acceleration motion model of the farm machine can be assumed to comply with the Singer model: wherein a represents the acceleration of the farm machine, represents the first derivative of the acceleration, λ represents the inverse of the first-order maneuvering target time constant, and w represents a Gaussian white noise with a mean value of 0. Therefore, the acceleration, the speed and the position of the farm machine satisfy the following motion equations, respectively:
[0119]
[0120]
[0121]
[0122] Where, x I y I z I These represent the projection components of the agricultural machinery's position onto the x, y, and z axes of the navigation coordinate system, respectively. xI v yI v zI These represent the projected components of the agricultural machinery's speed onto the x, y, and z axes of the navigation coordinate system, respectively. xI a yI a zI These represent the projection components of the agricultural machinery's acceleration onto the x, y, and z axes of the navigation coordinate system, respectively. They represent x respectively I y I z I v xI v yI v zI a xI a yI a zI The first derivative, λ x , λ y , λ z Let w represent the three-axis components of λ in the navigation coordinate system. xI w yI w zI These represent the three-axis components of w in the navigation coordinate system.
[0123] Furthermore, based on the above equations of motion, state difference equations (i.e., state equations) can be obtained for the changes in position, velocity, and acceleration over time. The observation equations are then determined based on the coordinates of each trajectory point in the navigation coordinate system. It should be noted that when the satellite navigation and positioning device can also output the speed of the agricultural machinery, the observation equations are determined by the position coordinates of each trajectory point in the navigation coordinate system and the stated velocity.
[0124] The technical solution of this invention, based on the motion model of agricultural machinery and combined with satellite navigation and positioning data, performs Kalman filtering, which effectively suppresses the measurement noise of satellite navigation. Moreover, it can ensure measurement stability and improve the robustness of the calculation process when the satellite navigation and positioning device experiences a brief anomaly.
[0125] Based on the foregoing embodiments, this invention also provides a method for measuring the area of agricultural machinery operations. Figure 6A flowchart of a method for measuring a working area of a farm machine according to an embodiment of the present application Figure Two As shown in Figure 6 , the method comprises:
[0126] Step 201: obtaining running track data of a farm machine in a first coordinate system;
[0127] Step 202: performing data thinning processing on the running track data;
[0128] Step 203: establishing a second coordinate system based on a maximum variance direction of the running track data after data thinning processing in the first coordinate system, and determining coordinates of each track point corresponding to the running track data in the second coordinate system;
[0129] Step 204: translating the coordinates according to a first buffer distance, generating a first rectangle corresponding to each track point based on the translated coordinates, and determining a second rectangle covering all the first rectangles according to the coordinate axis direction of the second coordinate system;
[0130] Step 205: performing grid division on the second rectangle, determining the area of all the first rectangles after merging in the second rectangle according to the divided grid, and obtaining the working area of the farm machine.
[0131] The detailed description of steps 201, 203-205 of the present embodiment can refer to the detailed description of steps 101-104 of the previous embodiment. For the sake of brevity, the detailed description will not be repeated here.
[0132] Considering that the running track data of the farm machine obtained in step 201 can have a large amount of data, for example, the output frequency of the satellite navigation positioning device is high, reaching 10 Hz, and according to the moving speed of the farm machine, the output of track data at 10 Hz will result in a large number of repeated track points. On the other hand, even if a certain track point selection rule (such as only keeping track data with a moving distance exceeding a threshold or a heading angle change exceeding a threshold) is used to filter the output track data, it is still difficult to eliminate the problem of repeated collection caused by repeated plowing of the farm machine. Therefore, in step 202 of the present embodiment, the running track data is thinned based on a data thinning algorithm.
[0133] As an optional implementation, the step 202 comprises:
[0134] Step 202a: Obtain the target trajectory point corresponding to the running trajectory data. The target trajectory point is the trajectory point with the largest vertical distance to the two endpoints among all trajectory points in the running trajectory data. Determine a threshold index based on the target trajectory point. The threshold index is the larger of a first value and a second value, wherein the first value is the vertical distance from the target trajectory point to the two endpoints, and the second value is the smaller of the distances from the target trajectory point to the two endpoints.
[0135] Step 202b: If the threshold index is greater than or equal to the first threshold, retain the target trajectory point, segment the running trajectory data with the target trajectory point, re-acquire the target trajectory point corresponding to the segmented running trajectory data, and redetermine the threshold index.
[0136] Step 202c: If the threshold index is less than the first threshold, discard the remaining trajectory points in the running trajectory data except for the two endpoints.
[0137] For example, Figure 7 Points 1-8 in the diagram represent the trajectory data that has undergone data thinning processing, such as... Figure 7 As shown in part (1), the perpendicular distance from each trajectory point 1-8 to the line connecting the two endpoints (point 1 and point 8) is calculated, and the target trajectory point among the trajectory points 1-8 is determined to be point 4. Furthermore, the smaller of the distances from trajectory point 4 to the two endpoints is obtained as line segment 14, so the threshold index is line segment 14. When line segment 14 is greater than the first threshold, the target trajectory point 4 is retained, and the running trajectory data 1-8 is segmented using trajectory point 4, as shown... Figure 7 As shown in part (2), the segmented data includes running trajectory data 1-4 and running trajectory data 4-8; for running trajectory data 1-4, its target trajectory point is point 3, and the threshold index is line segment 34. According to the relationship between the first threshold and line segment 34, when line segment 34 is less than the first threshold, as shown in part (2), the target trajectory point is point 3, and the threshold index is line segment 34. Figure 7 As shown in part (3), all trajectory points in the trajectory data 1-4 except for the two endpoints (points 1 and 4) are discarded (i.e., points 2 and 3 are discarded); similarly, the target trajectory point in the trajectory data 4-8 is point 6, and the threshold index is line segment 46. Since line segment 46 is greater than the first threshold, trajectory point 6 is retained, and the data is segmented again. The above process is repeated until no more trajectory points are discarded, resulting in the trajectory data after data thinning, as shown in the figure. Figure 7 As shown in part (4) of the document.
[0138] In the embodiment, the improved Douglas-Peucker (DP) algorithm is used to perform the thinning processing on the running track data. Compared with the threshold index in the traditional DP algorithm, which is the vertical distance from the target track point to the line connecting the two end points, in the improved DP algorithm, the threshold index is the maximum value between the vertical distance from the target track point to the line connecting the two end points and the distance to the nearest end point, which can effectively solve the data compression loss problem of repeated line segments and improve the calculation accuracy.
[0139] Based on the foregoing embodiment, the embodiment of the application further provides a farmland working area measurement method. Figure 8 The flowchart of the farmland working area measurement method of the embodiment of the application is shown in Figure Three As shown in Figure 8 The method comprises the following steps:
[0140] Step 301, after the agricultural machine starts to move, record the position information and time of the agricultural machine, and detect a calculation instruction;
[0141] Step 302, after receiving the calculation instruction, obtain the running track data of the agricultural machine in the first coordinate system from the start to the current time;
[0142] Step 303, perform data thinning processing on the running track data;
[0143] Step 304, perform PCA on the coordinates of each track point of the running track data in the first coordinate system, and convert the coordinates in the first coordinate system into coordinates in a second coordinate system;
[0144] Step 305, according to the implement width, widen the coordinates of each track point in the second coordinate system to generate a first rectangle corresponding to each track point;
[0145] Step 306, according to the maximum value and the minimum value in the direction of the coordinate axis of the second coordinate system, determine a second rectangle covering all the first rectangles;
[0146] Step 307, according to the first grid division factor and the size of the second rectangle, determine whether the required memory for grid division exceeds a second threshold value;
[0147] Step 308, when the memory does not exceed the second threshold value, perform grid division on the second rectangle based on the first grid division factor, and calculate the farmland working area according to the divided grid;
[0148] Step 309, when the memory exceeds the second threshold, determining a second grid division factor according to the second threshold and the size of the second rectangle, performing grid division on the second rectangle based on the second grid division factor, and calculating the agricultural machinery operation area according to the divided grids.
[0149] The related descriptions of steps 302 to 309 of the embodiment can refer to the detailed descriptions of steps 101 to 104 or steps 201 to 205 in the foregoing embodiments, and details are not described herein again to save space.
[0150] In step 301, the calculation instruction is used to instruct to measure the agricultural machinery operation area. In the embodiment, the agricultural machinery operation area can be measured in real time and dynamically during the movement of the agricultural machinery.
[0151] The embodiment of the application further provides an agricultural machinery operation area measuring device. Figure 9 A schematic diagram of a component structure of the agricultural machinery operation area measuring device of the embodiment of the application is shown in FIG. 4. Figure 9 As shown in FIG. 4, the device 400 comprises:
[0152] a data acquisition module 401 configured to acquire running track data of agricultural machinery in a first coordinate system;
[0153] a coordinate conversion module 402 configured to establish a second coordinate system based on a maximum variance direction of the running track data in the first coordinate system, and determine coordinates of each track point corresponding to the running track data in the second coordinate system;
[0154] an area determination module 403 configured to translate the coordinates according to a first buffer distance, generate a first rectangle corresponding to each track point based on the translated coordinates, and determine a second rectangle covering all the first rectangles according to a coordinate axis direction of the second coordinate system;
[0155] and an area calculation module 404 configured to perform grid division on the second rectangle, determine an area of all the first rectangles after merging in the second rectangle according to the divided grids, and obtain the operation area of the agricultural machinery.
[0156] In an optional embodiment of the application, as shown in FIG. 4, the agricultural machinery operation area measuring device 400 further comprises: Figure 10
[0157] a data processing module 405 configured to perform data thinning processing on the running track data;
[0158] The coordinate conversion module 402 is further configured to establish the second coordinate system based on a maximum variance direction of the running track data after data thinning processing by the data processing module in the first coordinate system.
[0159] In an optional embodiment of the present application, the data processing module 405 comprises:
[0160] a first processing submodule, configured to acquire a target trajectory point corresponding to the running trajectory data, the target trajectory point being a trajectory point with the maximum perpendicular distance to the line connecting two end points among the trajectory points of the running trajectory data, and determine a threshold index according to the target trajectory point, the threshold index being the larger one of a first value and a second value, wherein the first value is the perpendicular distance of the target trajectory point to the line connecting two end points, and the second value is the smaller one of the distances of the target trajectory point to the two end points;
[0161] and a second processing submodule, configured to, in the case where the threshold index determined by the first processing submodule is greater than or equal to a first threshold value, retain the target trajectory point, segment the running trajectory data with the target trajectory point, reacquire a target trajectory point corresponding to the segmented running trajectory data according to the first submodule, and redetermine a threshold index; and in the case where the threshold index is less than the first threshold value, discard the trajectory points other than the two end points in the running trajectory data.
[0162] In an optional embodiment of the present application, the area calculation module 404 comprises:
[0163] a first calculation submodule, configured to determine whether the memory required for grid division exceeds a second threshold value according to a preset first grid division factor and the size of the second rectangle;
[0164] and a second calculation submodule, configured to, in the case where the first calculation submodule determines that the memory does not exceed the second threshold value, perform grid division on the second rectangle based on the first grid division factor; and in the case where the memory exceeds the second threshold value, determine a second grid division factor according to the second threshold value and the size of the second rectangle, the second grid division factor being greater than the first grid division factor, and perform grid division on the second rectangle based on the second grid division factor.
[0165] In an optional embodiment of the present application, the coordinate conversion module 402 is configured to perform PCA on the coordinates of each trajectory point in the first coordinate system, determine the direction of maximum variance of the running trajectory data, and establish the second coordinate system with the direction of maximum variance and the direction perpendicular to the direction of maximum variance as coordinate axes.
[0166] In an optional embodiment of the present application, the area determining module 403 is configured to: determine a perpendicular line direction of a line connecting each trajectory point and an adjacent trajectory point according to the coordinates of each trajectory point in the second coordinate system; translate the coordinates of each trajectory point in the second coordinate system in two directions indicated by the perpendicular line direction by the first buffer distance, respectively, to obtain a first vertex coordinate and a second vertex coordinate corresponding to each trajectory point; and generate a first rectangle corresponding to each trajectory point based on the first vertex coordinate and the second vertex coordinate of each trajectory point after translation.
[0167] In an optional embodiment of the present application, the area determining module 403 includes:
[0168] a first determining sub-module configured to obtain a maximum horizontal axis value, a minimum horizontal axis value, a maximum vertical axis value and a minimum vertical axis value of the vertex coordinates of all the first rectangles in the second coordinate system; and
[0169] a second determining sub-module configured to determine the second rectangle based on the maximum horizontal axis value, the minimum horizontal axis value, the maximum vertical axis value, the minimum vertical axis value and the second buffer distance.
[0170] In an optional embodiment of the present application, the data obtaining module 401 includes:
[0171] a first obtaining sub-module configured to obtain geodetic coordinates of each trajectory point when the agricultural machine moves by a satellite navigation positioning device, and determine coordinates of each trajectory point in a navigation coordinate system according to the geodetic coordinates, the navigation coordinate system being a three-dimensional rectangular coordinate system established with an initial position of the agricultural machine when the agricultural machine moves as an origin; and
[0172] a second obtaining sub-module configured to perform Kalman filtering on the coordinates in the navigation coordinate system, and determine running trajectory data of the agricultural machine in the first coordinate system based on the coordinates after Kalman filtering, the first coordinate system being a projection coordinate system of the navigation coordinate system on a horizontal plane.
[0173] In an optional embodiment of the present application, the area calculating module 404 is configured to: traverse a grid in the second rectangle, determine a number of grids covered by all the first rectangles, and determine an area of all the first rectangles after merging based on the number of grids and an area of a single grid.
[0174] In the embodiment of the present application, the data acquisition module 401, the coordinate conversion module 402, the area determination module 403, the area calculation module 404 and the data processing module 405 in the device can be realized by a central processing unit (CPU), a digital signal processor (DSP), a microcontroller unit (MCU) or a field-programmable gate array (FPGA) in actual application.
[0175] It should be noted that the agricultural operation area measuring device provided in the above embodiment is only taken as an example for the division of the above program modules in the measurement, and in actual application, the above processing can be completed by different program modules according to the needs, that is, the internal structure of the device is divided into different program modules to complete all or part of the above processing. In addition, the agricultural operation area measuring device and the agricultural operation area measuring method provided in the above embodiment belong to the same concept, and the specific implementation process is described in the method embodiment, which will not be repeated here.
[0176] The embodiment of the present application also provides a measuring device. Figure 11 is a structural schematic diagram of the measuring device of the embodiment of the present application. The measuring device 500 can be a computer, a console, a server, a tablet device, etc. Figure 11 The measuring device 500 shown in the figure includes at least one processor 501, a memory 502 and a user interface 503. Various components in the measuring device 500 are coupled together through a bus system 504. It can be understood that the bus system 504 is used to realize the connection and communication between the components. In addition to the data bus, the bus system 504 also includes a power supply bus, a control bus and a state signal bus. However, in order to clearly illustrate, all kinds of buses are marked as the bus system 504 in the figure. Figure 11
[0177] The user interface 503 can include a display, a keyboard, a mouse, a trackball, a click wheel, a key, a button, a touchpad or a touch screen, etc.
[0178] It can be understood that the memory 502 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM can be used, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memory 502 described in the embodiments of the present application is intended to include, but not limited to, these and any other suitable types of memories.
[0179] The memory 502 in the embodiments of the present application is used to store various types of data to support the operation of the measuring device 500. Examples of these data include any computer programs and data used for operating on the measuring device 500, such as programs for performing agricultural work area measurement, recorded agricultural machine running track data, etc.
[0180] The method disclosed in the embodiments of the present application can be applied in the processor 501 or implemented by the processor 501. The processor 501 can be an integrated circuit chip having a processing capability of signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware in the processor 501 or the instructions in the form of software. The processor 501 mentioned above can be a general processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 501 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application. The general processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiments of the present application, the above-mentioned method can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium, which is located in the memory 502, and the processor 501 reads the information in the memory 502 and combines the hardware to complete the steps of the above-mentioned method.
[0181] In the exemplary embodiments, the measuring device 500 can be implemented by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, micro controllers (MCUs), microprocessors (Microprocessors), or other electronic elements, for executing the above-mentioned method.
[0182] In an exemplary embodiment, the present invention also provides a computer-readable storage medium, such as a memory 502 including a computer program, which can be executed by a processor 501 of a measuring device 500 to complete the steps described in the foregoing method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM; or it may be various devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0183] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0184] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0185] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0186] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0187] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0188] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0189] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0190] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0191] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for measuring the area of agricultural machinery operations, characterized in that, The method includes: Acquire the trajectory data of agricultural machinery in the first coordinate system; Based on the direction of the maximum variance of the running trajectory data in the first coordinate system, a second coordinate system is established, and the coordinates of each trajectory point corresponding to the running trajectory data in the second coordinate system are determined; wherein, the direction of the maximum variance is determined by performing principal component analysis (PCA) on the coordinates of each trajectory point in the first coordinate system. The coordinates are translated according to the first buffer distance, and a first rectangle corresponding to each trajectory point is generated based on the translated coordinates. A second rectangle covering all the first rectangles is determined according to the coordinate axis direction of the second coordinate system. The second rectangle is divided into grids, and the area of all the first rectangles combined within the second rectangle is determined based on the grid. The working area of the agricultural machinery is then obtained.
2. The method for measuring the area of agricultural machinery operations according to claim 1, characterized in that, After acquiring the agricultural machinery's trajectory data in the first coordinate system, the method further includes: The trajectory data is subjected to data thinning processing; The step of establishing a second coordinate system based on the direction of the maximum variance of the trajectory data in the first coordinate system includes: A second coordinate system is established based on the direction of the maximum variance of the trajectory data after data thinning in the first coordinate system.
3. The method for measuring the area of agricultural machinery operations according to claim 2, characterized in that, The data thinning process for the trajectory data includes: Obtain the target trajectory point corresponding to the running trajectory data. The target trajectory point is the trajectory point with the largest vertical distance to the two endpoints among all trajectory points in the running trajectory data. Determine a threshold index based on the target trajectory point. The threshold index is the larger of a first value and a second value, wherein the first value is the vertical distance from the target trajectory point to the two endpoints, and the second value is the smaller of the distances from the target trajectory point to the two endpoints. If the threshold index is greater than or equal to the first threshold, the target trajectory point is retained, and the running trajectory data is segmented with the target trajectory point. The target trajectory point corresponding to the segmented running trajectory data is re-acquired, and the threshold index is re-determined. If the threshold index is less than the first threshold, discard the remaining trajectory points in the running trajectory data except for the two endpoints.
4. The method for measuring the area of agricultural machinery operations according to claim 1, characterized in that, The step of dividing the second rectangle into grids includes: Based on the preset first grid partitioning factor and the size of the second rectangle, determine whether the memory required for grid partitioning exceeds the second threshold; When the memory does not exceed the second threshold, the second rectangle is divided into grids based on the first grid division factor; When the memory exceeds the second threshold, a second grid partitioning factor is determined based on the second threshold and the size of the second rectangle, wherein the second grid partitioning factor is greater than the first grid partitioning factor; and the second rectangle is gridded based on the second grid partitioning factor.
5. The method for measuring the area of agricultural machinery operations according to claim 1, characterized in that, The step of establishing a second coordinate system based on the direction of the maximum variance of the trajectory data in the first coordinate system includes: Principal component analysis (PCA) is performed on the coordinates of each trajectory point in the first coordinate system to determine the direction of maximum variance of the trajectory data. A second coordinate system is then established with the direction of maximum variance and its perpendicular direction as coordinate axes.
6. The method for measuring the area of agricultural machinery operations according to claim 1, characterized in that, The step of translating the coordinates according to a first buffer distance and generating a first rectangle corresponding to each trajectory point based on the translated coordinates includes: Based on the coordinates of each trajectory point in the second coordinate system, determine the direction of the perpendicular line connecting each trajectory point to its adjacent trajectory point. The coordinates of each trajectory point in the second coordinate system are translated by the first buffer distance in two directions indicated by the vertical line, respectively, to obtain the first vertex coordinates and the second vertex coordinates corresponding to each trajectory point. Based on the first vertex coordinates and the second vertex coordinates of each trajectory point after translation with the adjacent trajectory points, the first rectangle corresponding to each trajectory point is generated.
7. The method for measuring the area of agricultural machinery operations according to claim 1, characterized in that, Determining the second rectangle covering all first rectangles based on the coordinate axis directions of the second coordinate system includes: Obtain the maximum, minimum, maximum, and minimum x-axis coordinates of all vertices of the first rectangle in the second coordinate system; The second rectangle is determined based on the maximum value of the horizontal axis, the minimum value of the horizontal axis, the maximum value of the vertical axis, the minimum value of the vertical axis, and the second buffer distance.
8. The method for measuring the area of agricultural machinery operations according to claim 1, characterized in that, The acquisition of the agricultural machinery's trajectory data in the first coordinate system includes: The geodetic coordinates of each trajectory point during the movement of agricultural machinery are obtained by a satellite navigation and positioning device. The coordinates of each trajectory point in the navigation coordinate system are determined based on the geodetic coordinates. The navigation coordinate system is a three-dimensional rectangular coordinate system established with the initial position of the agricultural machinery as the origin. Kalman filtering is applied to the coordinates in the navigation coordinate system, and the running trajectory data of the agricultural machinery in the first coordinate system is determined based on the Kalman-filtered coordinates; the first coordinate system is the projection coordinate system of the navigation coordinate system on the horizontal plane.
9. The method for measuring the area of agricultural machinery operations according to any one of claims 1 to 8, characterized in that, The step of determining the combined area of all first rectangles within the second rectangle based on the divided grid includes: Traverse the grid within the second rectangle to determine the number of grids covered by all the first rectangles. Based on the number of grids and the area of a single grid, determine the area of all the merged first rectangles.
10. A device for measuring the operating area of agricultural machinery, characterized in that, The device includes: The data acquisition module is used to acquire the running trajectory data of agricultural machinery in the first coordinate system; The coordinate transformation module is used to establish a second coordinate system based on the maximum variance direction of the running trajectory data in the first coordinate system, and to determine the coordinates of each trajectory point corresponding to the running trajectory data in the second coordinate system; wherein, the maximum variance direction is determined by the coordinate transformation module performing principal component analysis (PCA) on the coordinates of each trajectory point in the first coordinate system. The area determination module is used to translate the coordinates according to a first buffer distance, generate a first rectangle corresponding to each trajectory point based on the translated coordinates, and determine a second rectangle covering all the first rectangles according to the coordinate axis direction of the second coordinate system. And an area calculation module, used to divide the second rectangle into grids, and determine the area of all the first rectangles merged within the second rectangle based on the divided grid, so as to obtain the working area of the agricultural machinery.
11. The agricultural machinery operation area measuring device according to claim 10, characterized in that, The device further includes: The data processing module is used to perform data thinning processing on the running trajectory data; The coordinate transformation module is also used to establish a second coordinate system based on the direction of the maximum variance of the running trajectory data after data thinning processing by the data processing module in the first coordinate system.
12. The agricultural machinery operation area measuring device according to claim 11, characterized in that, The data processing module includes: The first processing submodule is used to obtain the target trajectory point corresponding to the running trajectory data. The target trajectory point is the trajectory point with the largest vertical distance to the two endpoints among all trajectory points in the running trajectory data. The threshold index is determined based on the target trajectory point. The threshold index is the larger of a first value and a second value. The first value is the vertical distance from the target trajectory point to the two endpoints, and the second value is the smaller of the distances from the target trajectory point to the two endpoints. The second processing submodule is configured to retain the target trajectory point and segment the running trajectory data with the target trajectory point when the threshold index determined by the first processing submodule is greater than or equal to the first threshold, and to re-obtain the target trajectory point corresponding to the segmented running trajectory data according to the first processing submodule, and to re-determine the threshold index; and is also configured to discard the remaining trajectory points in the running trajectory data except for the two endpoints when the threshold index is less than the first threshold.
13. The agricultural machinery operation area measuring device according to claim 10, characterized in that, The area calculation module includes: The first calculation submodule is used to determine whether the memory required for grid division exceeds a second threshold based on a preset first grid division factor and the size of the second rectangle. And a second calculation submodule, configured to perform grid division on the second rectangle based on the first grid division factor when the first calculation submodule determines that the memory does not exceed the second threshold; and further configured to determine a second grid division factor, wherein the second grid division factor is greater than the first grid division factor, based on the second threshold and the size of the second rectangle when the memory exceeds the second threshold; and perform grid division on the second rectangle based on the second grid division factor.
14. The agricultural machinery operation area measuring device according to claim 10, characterized in that, The coordinate transformation module is used to perform principal component analysis (PCA) on the coordinates of each trajectory point in the first coordinate system to determine the direction of maximum variance of the running trajectory data, and to establish a second coordinate system with the direction of maximum variance and the direction perpendicular to the direction of maximum variance as coordinate axes.
15. The agricultural machinery operation area measuring device according to claim 10, characterized in that, The area determination module is used to determine the perpendicular direction of the line connecting each trajectory point and its adjacent trajectory points based on the coordinates of each trajectory point in the second coordinate system; to translate the coordinates of each trajectory point in the second coordinate system along the two directions indicated by the perpendicular direction by the first buffer distance, respectively obtaining the first vertex coordinates and the second vertex coordinates corresponding to each trajectory point; and to generate the first rectangle corresponding to each trajectory point based on the translated first vertex coordinates and the second vertex coordinates of each trajectory point and its adjacent trajectory points.
16. The agricultural machinery operation area measuring device according to claim 10, characterized in that, The area determination module includes: The first determination submodule is used to obtain the maximum and minimum values of the horizontal axis, the maximum and minimum values of the vertical axis of the vertex coordinates of all the first rectangles in the second coordinate system; And a second determining submodule, used to determine the second rectangle based on the maximum value of the horizontal axis, the minimum value of the horizontal axis, the maximum value of the vertical axis, the minimum value of the vertical axis, and the second buffer distance.
17. The agricultural machinery operation area measuring device according to claim 10, characterized in that, The data acquisition module includes: The first acquisition submodule is used to acquire the geodetic coordinates of each trajectory point when the agricultural machinery moves through a satellite navigation and positioning device, and determine the coordinates of each trajectory point in the navigation coordinate system based on the geodetic coordinates. The navigation coordinate system is a three-dimensional rectangular coordinate system established with the initial position of the agricultural machinery as the origin. And a second acquisition submodule, used to perform Kalman filtering on the coordinates in the navigation coordinate system, and determine the running trajectory data of the agricultural machinery in the first coordinate system based on the Kalman-filtered coordinates; the first coordinate system is the projection coordinate system of the navigation coordinate system on the horizontal plane.
18. The agricultural machinery operation area measuring device according to any one of claims 10 to 17, characterized in that, The area calculation module is used to traverse the grid within the second rectangle, determine the number of grids covered by all the first rectangles, and determine the area of all the merged first rectangles based on the number of grids and the area of a single grid.
19. A measuring device, characterized in that, include: The processor and the memory used to store computer programs that can run on the processor. When the processor is used to run the computer program, it performs the steps of the method according to any one of claims 1 to 9.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Automatic acquisition method for agricultural machinery operation width and acquisition method for agricultural machinery operation area
CN110132215A
Initial position determination method and device, electronic equipment and storage medium
CN112595325A