Flatness detection method and device, electronic equipment and storage medium

By performing plane fitting and normal vector internal product calculation on the three-dimensional point cloud data of cultivated land, combined with the first distance in the grid, high-precision detection of the overall and local flatness of cultivated land is achieved, and the problems of low measurement accuracy and high cost in the prior art are solved.

CN119935027APending Publication Date: 2025-05-06CHINA MOBILE CHENGDU INFORMATION & TELECOMM TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311458866.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, the measurement results of cultivated land flatness are relatively accurate and the manual measurement cost is too high.

Method used

By plane fitting the three-dimensional point cloud data of the cultivated land, the equation of the fitted plane is obtained, and the overall flatness is determined based on the internal product between the first normal vector and the second normal vector of the point cloud coordinate system, and the local flatness is determined based on the first distance of each three-dimensional point cloud in the grid.

Benefits of technology

It improves the accuracy, confidence and measurement accuracy of cultivated land flatness, reduces labor costs, and avoids manual measurement errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119935027A_ABST
    Figure CN119935027A_ABST
Patent Text Reader

Abstract

The invention discloses a flatness detection method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the plane fitting of a three-dimensional point cloud of a cultivated land according to the three-dimensional point cloud data of the cultivated land, and obtaining an equation of a fitting plane; determining the overall flatness of the cultivated land according to an inner product between the first normal vector and a second normal vector of a point cloud coordinate system; the first normal vector is obtained by an equation of the fitting plane; according to the first distance of each three-dimensional point cloud in the grids of the cultivated land, determining the local flatness of the cultivated land covered by the corresponding grids; the first distance represents the distance from the three-dimensional point cloud to the fitting plane. According to the scheme, the overall flatness and the local flatness of the cultivated land can be determined based on the three-dimensional point cloud data of the cultivated land, the flatness of the cultivated land does not need to be evaluated manually by measuring the flatness of the sampling points, the labor cost is reduced, manual measurement errors are avoided, and the accuracy, the confidence coefficient and the measurement precision of the flatness of the cultivated land are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a flatness detection method, device, electronic device and storage medium. Background Art

[0002] In the related art, surveyors use laser levels to measure sampling points of cultivated land and evaluate the flatness of the cultivated land based on the measurement results. However, the accuracy of the measurement results of the flatness of the cultivated land is low and the cost of manual measurement is too high. Summary of the invention

[0003] To solve the related technical problems, the embodiments of the present application provide a flatness detection method, device, electronic device and storage medium.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application embodiment provides a flatness detection method, including:

[0006] Performing plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land to obtain an equation of the fitting plane;

[0007] Determining the overall flatness of the cultivated land according to the inner product between a first normal vector and a second normal vector of the point cloud coordinate system, wherein the first normal vector is obtained by the equation of the fitting plane;

[0008] According to the first distance of each three-dimensional point cloud in the grid of the cultivated land, the local flatness of the cultivated land covered by the corresponding grid is determined; the first distance represents the distance from the three-dimensional point cloud to the fitting plane.

[0009] In the above solution, determining the overall flatness of the cultivated land includes:

[0010] When the first absolute value is greater than or equal to the first set threshold, determining the overall flatness of the cultivated land as the first flatness; or

[0011] When the first absolute value is less than the first set threshold, the overall flatness of the cultivated land is determined as the second flatness; wherein,

[0012] The first absolute value represents the absolute value of the inner product between the first normal vector and the second normal vector; the first absolute value is greater than or equal to 0 and less than or equal to 1; the first flatness represents the overall flatness of the cultivated land, and the second flatness represents the overall unevenness of the cultivated land.

[0013] In the above scheme, determining the local flatness of the cultivated land covered by the corresponding grid according to the first distance of each three-dimensional point cloud in the grid of the cultivated land includes:

[0014] Determine a first distance of each three-dimensional point cloud in the grid of the cultivated land according to an equation of the fitting plane and the coordinates of each three-dimensional point cloud in the grid of the cultivated land;

[0015] The local flatness of the cultivated land covered by the corresponding grid is determined according to the second set threshold and the average distance corresponding to the grid of the cultivated land; the average distance corresponding to the grid represents the mean value of the sum of the first distances of all three-dimensional point clouds in the grid.

[0016] In the above scheme, the number of the second set thresholds is N, where N is an integer greater than or equal to 1; determining the local flatness of the cultivated land covered by the corresponding grid according to the second set threshold and the average distance corresponding to the grid of the cultivated land includes:

[0017] Matching the average distance corresponding to the grid of the cultivated land with N+1 distance ranges to obtain a first distance range to which the average distance corresponding to the grid belongs;

[0018] According to the correspondence between N+1 distance ranges and N+1 levels of local flatness, the local flatness corresponding to the first distance range is determined; wherein,

[0019] The first distance range is one of N+1 distance ranges, and the N+1 distance range is an interval divided according to N second set thresholds.

[0020] In the above scheme, the method further comprises:

[0021] According to the first relationship, the three-dimensional point cloud within the grid of the cultivated land is rendered as a color corresponding to the local flatness corresponding to the grid, and the rendered image is output; wherein the first relationship at least includes a corresponding relationship between local flatness and color, and different local flatnesses correspond to different colors.

[0022] In the above scheme, when the number of the second set thresholds is N, and N is an integer greater than or equal to 1, the first relationship further includes the correspondence between N+1 levels of local flatness and N+1 colors.

[0023] In the above solution, when the average distance corresponding to the grid is obtained to belong to the first distance range, the first relationship further includes a correspondence relationship between N+1 distance ranges and N+1 colors, and the N+1 colors are different;

[0024] The rendering of the three-dimensional point cloud in the grid of the cultivated land into a color corresponding to the local flatness corresponding to the grid according to the first relationship includes:

[0025] According to the correspondence between N+1 distance ranges and N+1 colors, the three-dimensional point cloud within the grid of the cultivated land is rendered into the color corresponding to the first distance range.

[0026] The present application also provides a flatness detection device, including:

[0027] A fitting unit, used for performing plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land, so as to obtain an equation of the fitting plane;

[0028] A first determining unit, configured to determine the overall flatness of the cultivated land according to an inner product between a first normal vector and a second normal vector of a point cloud coordinate system, wherein the first normal vector is obtained by an equation of the fitting plane;

[0029] The second determination unit is used to determine the local flatness of the cultivated land covered by the corresponding grid according to the first distance of each three-dimensional point cloud in the grid of the cultivated land; the first distance represents the distance from the three-dimensional point cloud to the fitting plane.

[0030] The embodiment of the present application also provides an electronic device, including a processor and a communication interface, wherein:

[0031] The processor is used to perform plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land to obtain the equation of the fitting plane; determine the overall flatness of the cultivated land according to the inner product between the first normal vector and the second normal vector of the point cloud coordinate system; determine the local flatness of the cultivated land covered by the corresponding grid according to the first distance of each three-dimensional point cloud in the grid of the cultivated land; wherein the first normal vector is obtained by the equation of the fitting plane; and the first distance represents the distance from the three-dimensional point cloud to the fitting plane.

[0032] The embodiment of the present application further provides an electronic device, comprising a processor and a memory for storing a computer program that can be run on the processor.

[0033] Wherein, the processor is used to execute the steps of any of the above methods when running the computer program.

[0034] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0035] In the flatness detection method, device, electronic device and storage medium provided in the embodiment of the present application, the electronic device performs plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land to obtain the equation of the fitting plane; the overall flatness of the cultivated land is determined according to the inner product between the first normal vector and the second normal vector of the point cloud coordinate system; the first normal vector is obtained by the equation of the fitting plane; the local flatness of the cultivated land covered by the corresponding grid is determined according to the first distance of each three-dimensional point cloud in the grid of the cultivated land; the first distance represents the distance from the three-dimensional point cloud to the fitting plane. The above scheme can determine the overall flatness and local flatness of the cultivated land based on the three-dimensional point cloud data of the cultivated land, and does not require manual evaluation of the flatness of the cultivated land by measuring the flatness of the sampling points. Compared with the scheme of manually measuring the flatness of the cultivated land in the related art, the above scheme reduces labor costs and avoids manual measurement errors, and improves the accuracy, confidence and measurement precision of the flatness of the cultivated land. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a schematic diagram of the process flow of the flatness detection method according to the embodiment of the present application;

[0037] Figure 2 This is a source code example for implementing plane fitting in the embodiment of the present application;

[0038] Figure 3 This is an example diagram of gridding of cultivated land in an embodiment of the present application;

[0039] Figure 4 (a) is an example diagram of the original three-dimensional point cloud of the embodiment of the present application;

[0040] Figure 4 (b) Figure 4 (a) The corresponding mesh rendering image;

[0041] Figure 5 This is a schematic diagram of the structure of the flatness detection device according to an embodiment of the present application;

[0042] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0043] As rural land becomes more and more concentrated, large tracts of farmland provide favorable conditions for mechanized farming, and mechanized and intelligent modern agriculture is developing continuously. Under the development trend of precision agriculture, accurate assessment of the flatness of cultivated land can effectively guide agricultural production on the one hand, and also serve as the basis for charging for public agricultural machinery operations on the other.

[0044] In the related art, the flatness of cultivated land is mainly assessed by surveyors using laser levels. Specifically, the surveyor uses the gravity sensing device of the laser level to ensure that the laser level is placed at a position perpendicular to the direction of gravity, turns on the laser emission switch to enable the laser level to emit lasers, and measures the distance between the laser level and the position hit by laser beams in different directions, and determines the flatness of the placement position (sampling point) of the laser level based on the measured distance; the surveyor assesses the flatness of multiple sampling points in the cultivated land in the above manner, and assesses the flatness of the cultivated land based on the flatness assessment results of the multiple sampling points.

[0045] However, this approach has the following problems:

[0046] (1) If you want to evaluate the flatness of a 10m x 10m piece of farmland, you need to use a laser level to measure at least four sampling points (four vertices) of the farmland, but in reality, it is often more than four times. When the area of ​​farmland is large, more sampling points need to be measured, which is labor intensive and labor costs are too high.

[0047] (2) Due to the limitation of the number of sampling points, it is difficult for surveyors to assess whether the entire piece of farmland is flat or tilted based on the measurement results of limited sampling points. The accuracy and confidence of the assessment results of farmland flatness are low.

[0048] (3) The entire measurement process relies heavily on the manual operation of the surveyor, which may result in large measurement errors and make it difficult to ensure measurement accuracy. For example, an experienced surveyor and a novice surveyor may obtain completely different results for the same farmland.

[0049] Based on this, in various embodiments of the present application, a plane fitting is performed on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land to obtain the equation of the fitting plane; the overall flatness of the cultivated land is determined according to the inner product between the first normal vector and the second normal vector of the point cloud coordinate system; the first normal vector is obtained by the equation of the fitting plane; the local flatness of the cultivated land covered by the corresponding grid is determined according to the first distance of each three-dimensional point cloud in the grid of the cultivated land; the first distance represents the distance from the three-dimensional point cloud to the fitting plane. The above scheme can determine the overall flatness and local flatness of the cultivated land based on the three-dimensional point cloud data of the cultivated land, and there is no need to manually evaluate the flatness of the cultivated land by measuring the flatness of the sampling points. Compared with the scheme of manually measuring the flatness of the cultivated land in the related art, the above scheme reduces the labor cost and avoids the manual measurement error, and improves the accuracy, confidence and measurement precision of the flatness of the cultivated land.

[0050] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0051] The present application embodiment provides a flatness detection method, which is applicable to electronic devices, including terminals and servers, such as Figure 1 As shown, the method includes:

[0052] Step 101: performing plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land to obtain an equation of the fitting plane.

[0053] Here, the electronic device obtains the three-dimensional point cloud data of the cultivated land; uses the set plane fitting algorithm to perform plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land, and obtains the equation of the fitting plane; the fitting plane can also be understood as the point cloud fitting plane. Cultivated land generally refers to any piece of cultivated land that needs to be evaluated for flatness.

[0054] The three-dimensional point cloud data can be obtained by scanning the surface of the cultivated land using a device for acquiring three-dimensional point cloud data, such as a laser radar. The three-dimensional point cloud data at least includes the three-dimensional coordinates and / or normal vectors of the three-dimensional point cloud. The three-dimensional point cloud data can also be stored in the form of a pointer, in which case the three-dimensional point cloud data can also be referred to as a pointer of the three-dimensional point cloud or a pointer of the point cloud. The cultivated land includes at least one of the following: dry land, vegetable land, irrigated land, sky-viewing field, irrigated paddy field and non-irrigated land.

[0055] In actual application, the two classes of SampleConsensus Model Plane and Random Sample Consensus of the Point Cloud Library (PCL library) can be called to perform plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land to obtain the equation of the fitting plane.

[0056] Among them, PCL is an open source cross-platform project for processing 2D / 3D images and point cloud data. It implements general algorithms related to point cloud processing, such as filtering, feature extraction, surface reconstruction, model fitting and segmentation. The SampleConsensus Model Plane class is used to reconstruct 3D point clouds based on the 3D point cloud data of cultivated land, so as to convert the 3D point cloud into a 3D plane model calculated by sampling consistency, thereby obtaining a 3D plane model of cultivated land; the RandomSample Consensus class is used to perform plane fitting on the 3D point cloud and obtain the equation of the fitting plane. 3D point cloud reconstruction can be understood as performing relevant processing on the 3D point cloud data of cultivated land to obtain a 3D model of cultivated land.

[0057] Figure 2 A source code example of plane fitting based on PCL class is given. Figure 2In the example, the input of the Sample ConsensusModel Plane class is cloud, which is the pointer to the 3D point cloud. The point cloud coordinate system pointed to by the pointer to the 3D point cloud is the northeast celestial coordinate system, that is, the X axis points to the east, the Y axis points to the north, and the Z axis points to the sky. The output of the Random Sample Consensus class is coeff, which is a four-dimensional vector. The values ​​of the four dimensions (coeff[0]), coeff[1], coeff[2], coeff[3]) correspond to the four parameters of the final fitting plane. For example, when the equation of the fitting plane is ax+by+cz+d=0, a=coeff[0], b=coeff[1], c=coeff[2], d=coeff[3]; a, b, c, and d are all constants.

[0058] It should be noted that the fitting algorithms used by the Sample Consensus Model Plane and Random Sample Consensus classes are random sampling consensus algorithms. The random sampling consensus algorithm is a commonly used plane fitting algorithm, which usually has a better effect on data that obeys the Gaussian distribution, that is, the error of the plane fitted by the random sampling consensus algorithm is small. Agricultural practitioners will give priority to cultivating land with overall flat terrain, which can obey the Gaussian distribution.

[0059] Step 102: Determine the overall flatness of the cultivated land according to the inner product between a first normal vector and a second normal vector of the point cloud coordinate system; the first normal vector is obtained by the equation of the fitting plane.

[0060] Here, the electronic device determines the first normal vector according to the equation of the fitted plane, and determines the second normal vector of the point cloud coordinate system of the three-dimensional point cloud; calculates the inner product between the first normal vector and the second normal vector; determines the overall flatness of the cultivated land according to the absolute value of the inner product; or, normalizes the inner product, and determines the overall flatness of the cultivated land according to the result of the normalization. The point cloud coordinate system can also be understood as the northeast sky coordinate system mentioned above. The overall flatness can be understood as the overall horizontality.

[0061] Since the inner product between the first normal vector and the second normal vector can reflect whether the two vectors are parallel or intersecting, or reflect the difference between the two vectors, measuring the overall flatness of the cultivated land based on the inner product between the first normal vector and the second normal vector can improve the accuracy of the overall flatness of the cultivated land.

[0062] In practical application, a threshold or a threshold range can be pre-set, and the calculated absolute value of the inner product can be compared with the first set threshold or the first set threshold range, and the overall flatness of the cultivated land can be determined according to the comparison result. For example, when the absolute value of the inner product is equal to the first set threshold, or the absolute value of the inner product is within the first set threshold range, the overall flatness of the cultivated land indicates that the cultivated land is flat or the cultivated land tends to be level as a whole; when the absolute value of the inner product is not equal to the first set threshold, or the absolute value of the inner product falls outside the first set threshold range, the overall flatness of the cultivated land indicates that the cultivated land is uneven or the cultivated land is tilted as a whole. The unevenness of cultivated land can include at least one of the following situations: the existence of raised areas, sunken areas, and overall tilt of the cultivated land.

[0063] In order to determine the overall flatness of the cultivated land more quickly and accurately, the first normal vector and the second normal vector are both unit normal vectors. In one embodiment, determining the overall flatness of the cultivated land includes:

[0064] When the first absolute value is greater than or equal to the first set threshold, determining the overall flatness of the cultivated land as the first flatness; or

[0065] When the first absolute value is less than the first set threshold, the overall flatness of the cultivated land is determined as the second flatness; wherein,

[0066] The first absolute value represents the absolute value of the inner product between the first normal vector and the second normal vector; the first absolute value is greater than or equal to 0 and less than or equal to 1; the first flatness represents the overall flatness of the cultivated land, and the second flatness represents the overall unevenness of the cultivated land.

[0067] Here, the electronic device calculates the absolute value of the inner product between the first normal vector and the second normal vector to obtain a first absolute value; since the first normal vector and the second normal vector are both unit normal vectors, the first absolute value is greater than or equal to 0 and less than or equal to 1; when the first absolute value is greater than or equal to a first set threshold, the overall flatness of the cultivated land is determined to be the first flatness; or, when the first absolute value is less than the first set threshold, the overall flatness of the cultivated land is determined to be the second flatness.

[0068] For example, assuming that the XOY plane in the point cloud coordinates is planeXoy, and the value of the unit normal vector normalXoy of the XOY plane is (0,0,1); the fitting plane of the cultivated land is planeCloud, and the value of the unit normal vector normalCloud of the fitting plane is (a,b,c), then the inner product dot between normalCloud and normalXoy is dot=normalCloud.dot(normalXoy), that is, a×0+b×0+c×1.

[0069] When the first absolute value is equal to 1, it represents the overall level or overall flatness of the cultivated land; the closer the first absolute value is to 1, the more the cultivated land tends to be flat as a whole; the closer the first absolute value is to 0, the more severe the inclination degree of the cultivated land as a whole.

[0070] Step 103: Determine the local flatness of the cultivated land covered by the corresponding grid according to the first distance of each three-dimensional point cloud within the grid of the cultivated land.

[0071] Wherein, the first distance represents the distance from the three-dimensional point cloud to the fitting plane.

[0072] Here, considering the actual operation scenario of agricultural cultivated land, only mastering the overall flatness of the cultivated land is often not enough to guide agricultural production. Because even a cultivated land that is overall parallel to the northeast celestial coordinate system may have protrusions or depressions in local positions. If these protrusions or depressions can be quickly discovered, and the positions of the protrusion areas and the depression areas can be determined, it will be convenient to guide the agricultural machine operator to carry out land preparation operations. Therefore, in this application, the same cultivated land is divided into grids, and the local flatness of the cultivated land covered by each grid is determined, so that relevant personnel can accurately determine the local protrusion or depression areas in the cultivated land.

[0073] The following details the implementation process of determining the local flatness of the first grid of the cultivated land. The first grid is any grid of the cultivated land.

[0074] The electronic device divides the cultivated land into grids according to a set granularity, thereby dividing a cultivated land into multiple grids to obtain multiple grids of the cultivated land; the set granularity can be 10 meters × 10 meters, and of course, it can also be set according to the actual situation; according to the three-dimensional coordinates of the three-dimensional point cloud, the three-dimensional point cloud within the first grid is determined. Figure 3 An example diagram of dividing the cultivated land into grids according to a granularity of 10 meters × 10 meters is given. The following takes the first grid as Figure 3 the gray grid in it as an example to detail the implementation process of determining the three-dimensional point cloud within the first grid: Assume that in the point cloud coordinate system (northeast celestial coordinate system), the coordinates of the lower left corner of the gray grid are (Xmin, Ymin), and the coordinates of the upper right corner of the gray grid are (Xmax, Ymax). For the three-dimensional coordinates (x, y, z) of any three-dimensional point cloud in the three-dimensional point cloud of the cultivated land, if x ≥ Xmin and x < Xmax, and at the same time y ≥ Ymin and y < Ymax are satisfied, then it is confirmed that this three-dimensional point cloud belongs to this gray grid.

[0075] When the electronic device determines the three-dimensional point cloud in the first grid, the electronic device determines the distance from each three-dimensional point cloud in the first grid to the fitting plane according to the equation of the fitting plane and the three-dimensional coordinates of each three-dimensional point cloud in the first grid, and obtains the first distance of each three-dimensional point cloud in the first grid; the local flatness of the cultivated land covered by the first grid is determined according to the first distance of each three-dimensional point cloud in the first grid of the cultivated land. For example, the average distance corresponding to the first grid, the variance or standard deviation of the first distance are determined according to the first distance of each three-dimensional point cloud in the first grid; the determined parameter is compared with the corresponding set threshold value to obtain a comparison result, and the local flatness of the cultivated land covered by the first grid is determined according to the comparison result.

[0076] In practical applications, electronic devices can be based on the following formula Determine the first distance of any three-dimensional point cloud P0 (x0, y0, z0) in the first grid. dist0 represents the distance from the three-dimensional point cloud P0 to the fitting plane, that is, the first distance of the three-dimensional point cloud P0.

[0077] In one embodiment, determining the local flatness of the farmland covered by the corresponding grid according to the first distance of each three-dimensional point cloud in the grid of the farmland includes:

[0078] Determine a first distance of each three-dimensional point cloud in the grid of the cultivated land according to an equation of the fitting plane and the coordinates of each three-dimensional point cloud in the grid of the cultivated land;

[0079] The local flatness of the cultivated land covered by the corresponding grid is determined according to the second set threshold and the average distance corresponding to the grid of the cultivated land; the average distance corresponding to the grid represents the mean value of the sum of the first distances of all three-dimensional point clouds in the grid.

[0080] Here, the grid refers to any grid divided into cultivated land. The electronic device determines the first distance of each three-dimensional point cloud in the same grid of the cultivated land according to the method for determining the first distance of the three-dimensional point cloud mentioned above; determines the mean of the sum of all the first distances according to the first distance of each three-dimensional point cloud in the grid to obtain the average distance corresponding to the grid; compares the average distance corresponding to the grid with a second set threshold to obtain a first comparison result, and determines the local flatness of the cultivated land covered by the grid according to the first comparison result.

[0081] In actual application, the electronic device can divide a corresponding number of distance ranges according to the second set threshold value, and establish a corresponding relationship between the distance range and the local flatness of the cultivated land; when the electronic device determines the first comparison result between the average distance corresponding to any grid and the second set threshold value, it determines the distance range to which the first comparison result belongs, and according to the corresponding relationship between the distance range and the local flatness of the cultivated land, determines the local flatness corresponding to the distance range to which the first comparison result belongs.

[0082] In practical application, the local flatness of cultivated land can be divided into two categories, one is flatness and the other is unevenness. Furthermore, since the local unevenness of cultivated land includes local protrusions of cultivated land and / or local depressions of cultivated land, the local flatness of cultivated land can be divided into three categories, one is flatness, one is local depressions of cultivated land, and the other is local protrusions of cultivated land.

[0083] For example, when the second set threshold is one, when the first comparison result indicates that the average distance corresponding to the grid is equal to the second set threshold, the local flatness of the determined farmland is the third flatness, and the third flatness indicates that the farmland covered by the grid does not have convex areas and concave areas, that is, the farmland covered by the grid is flat or tends to be horizontal; when the first comparison result indicates that the average distance corresponding to the grid is less than the second set threshold, the local flatness of the determined farmland is the fourth flatness, and the fourth flatness indicates that the farmland covered by the grid has a concave area; when the first comparison result indicates that the average distance corresponding to the grid is greater than the second set threshold, the local flatness of the determined farmland is the fifth flatness, and the fifth flatness indicates that the farmland covered by the grid has a convex area. The second set threshold can be zero, or can be set according to actual conditions.

[0084] For another example, when the number of second set thresholds is 2, when the average distance corresponding to the grid represented by the first comparison result is within the set distance range, the local flatness of the cultivated land is the third flatness; when the average distance corresponding to the grid represented by the first comparison result is less than the minimum boundary value of the set distance range, the local flatness of the cultivated land is the fourth flatness, and the minimum boundary value of the set distance range is the minimum value of the two second set thresholds; when the average distance corresponding to the grid represented by the first comparison result is greater than the maximum boundary value of the set distance range, the local flatness of the cultivated land is the fifth flatness, and the maximum boundary value of the set distance range is the maximum value of the two second set thresholds. In actual application, the two second set thresholds are -5 and 5 respectively.

[0085] In order to determine the local flatness of the cultivated land according to a unified standard to improve the accuracy of the local flatness of the cultivated land, in one embodiment, the number of the second set thresholds is N, where N is an integer greater than or equal to 1; the determining the local flatness of the cultivated land covered by the corresponding grid according to the second set threshold and the average distance corresponding to the grid of the cultivated land includes:

[0086] Matching the average distance corresponding to the grid of the cultivated land with N+1 distance ranges to obtain a first distance range to which the average distance corresponding to the grid belongs;

[0087] According to the correspondence between N+1 distance ranges and N+1 levels of local flatness, the local flatness corresponding to the first distance range is determined; wherein,

[0088] The first distance range is one of N+1 distance ranges, and the N+1 distance range is an interval divided according to N second set thresholds.

[0089] Here, when the number of second set thresholds is N, the electronic device divides N+1 distance ranges according to the N second set thresholds; matches the average distance corresponding to the grid of the cultivated land with the N+1 distance ranges to obtain the first distance range to which the average distance corresponding to the grid belongs; determines the local flatness corresponding to the first distance range according to the correspondence between the N+1 distance ranges and the N+1 levels of local flatness; different distance ranges correspond to different local flatnesses.

[0090] For example, when N=2, three distance ranges are divided by two second set thresholds, and the local flatness of the cultivated land is divided into three levels (the first level of local flatness, the second level of local flatness, and the third level of local flatness), and one level of local flatness corresponds to one distance range. Among them, the distance range corresponding to the first level of local flatness is greater than the distance range corresponding to the second level of local flatness, and the distance range corresponding to the first level of local flatness is smaller than the distance range corresponding to the third level of local flatness; the first level of local flatness indicates that the cultivated land covered by the grid does not have convex areas and concave areas, that is, the cultivated land covered by the grid is flat or tends to be horizontal; the second level of local flatness indicates that the cultivated land covered by the grid has concave areas; the third level of local flatness indicates that the cultivated land covered by the grid has convex areas.

[0091] In actual agricultural production, there is a certain tolerance range for the unevenness of cultivated land. For example, for a piece of cultivated land of more than 50 mu, if there is a bulge or depression within 20 centimeters (cm) in a local position, the producer will often ignore it and do not need to deal with it; when the degree of bulge and depression exceeds this threshold, the producer needs to perform land leveling operations, which also requires the unevenness of the cultivated land to be graded. Specifically, the electronic device can grade the degree of bulge and depression, so as to obtain more local flatness of different levels (grades), set the distance range corresponding to each level of local flatness, and establish a correspondence between different levels of local flatness and distance ranges, one distance range corresponds to one level of local flatness; after the electronic device determines the first distance range to which the first comparison result belongs between the average distance corresponding to any grid and the second set threshold, according to the correspondence between different levels of local flatness and distance ranges, the local flatness corresponding to the first distance range to which the first comparison result belongs is determined.

[0092] For example, when the number of the second set thresholds is 6, 7 distance ranges are divided accordingly, and the distance range unit is cm. Different distance ranges correspond to different levels of local flatness. For example, the 7 distance ranges are:

[0093] The distance range A is (-∞,-20×1.5), that is, the distance range A represents less than or equal to -20×1.5;

[0094] The distance range B is (-20×1.5,-20), and the distance range B represents a value greater than -20×1.5 and less than -20;

[0095] The distance range C is [-20, -5), and the distance range C represents greater than -20 and less than -5;

[0096] The distance range D is [-5,5], where the distance range D represents a value greater than or equal to -5 and less than or equal to 5;

[0097] The distance range E is (5,20), and the distance range E represents a value greater than 5 and less than 20;

[0098] The distance range F is [20, 20×1.5), where the distance range F represents a value greater than or equal to 20 and less than 20×1.5;

[0099] The distance range G is [20×1.5,∞), and the distance range G represents being greater than or equal to 20×1.5.

[0100] Among them, 1.5 represents the coefficient, and of course the coefficient can also be set to other values ​​between 0 and 2.

[0101] The local flatness corresponding to the distance range D is flatness D, and flatness D represents the flatness of the cultivated land.

[0102] The local flatness corresponding to distance range A, distance range B and distance range C represents the existence of different degrees of depression in local cultivated land. The smaller the value of the distance range, the more serious the depression. For example, the local flatness corresponding to distance range A is flatness A, which represents the existence of severe depression in local cultivated land. The local flatness corresponding to distance range B is flatness B, which represents the existence of relatively serious depression in local cultivated land. The local flatness corresponding to distance range C is flatness C, which represents the existence of slight depression in local cultivated land.

[0103] Distance range E, distance range F, and distance range G represent different degrees of bulges in the local cultivated land; the larger the distance range value, the more serious the bulge. For example, the local flatness corresponding to distance range E is flatness E, which represents the existence of a slightly bulged area in the local cultivated land; the local flatness corresponding to distance range F is flatness F, which represents the existence of a more serious bulge in the local cultivated land; the local flatness corresponding to distance range G is flatness G, which represents the existence of a severely bulged area in the local cultivated land.

[0104] It should be noted that the electronic device can determine the local flatness corresponding to part or all of the grids of the cultivated land according to the above method.

[0105] After determining the local flatness of the farmland covered by the grid, different colors can be used to mark different degrees of raised and / or sunken areas, so that relevant personnel can quickly find different degrees of sunken areas and / or raised areas in the local farmland. Based on this, in one embodiment, the method also includes:

[0106] According to the first relationship, the three-dimensional point cloud within the grid of the cultivated land is rendered as a color corresponding to the local flatness corresponding to the grid, and the rendered image is output; wherein the first relationship at least includes a corresponding relationship between local flatness and color, and different local flatnesses correspond to different colors.

[0107] Here, when the electronic device determines the local flatness of the cultivated land covered by any grid, it determines the color corresponding to the local flatness of the cultivated land covered by the grid according to the correspondence between the local flatness and the color, and renders the three-dimensional point cloud in the grid to the determined color; after rendering the colors of the three-dimensional point clouds in all grids of the cultivated land, it outputs the rendered image. Outputting the rendered image may be displaying the rendered image in a user interface of a display screen of the electronic device; or the electronic device may output the rendered image to a connected display screen to instruct the display screen to display the rendered image.

[0108] In actual application, electronic devices can use VTK (visualization toolkit) to render the 3D point cloud in the grid of cultivated land into the color corresponding to the local flatness of the grid. VTK is an open source cross-platform software system mainly used for 3D computer graphics, image processing and visualization.

[0109] In order to intuitively display the degree of convexity or depression of the cultivated land covered by the grid to guide agricultural production, in one embodiment, when the number of the second set threshold is N, N is an integer greater than or equal to 1, the first relationship also includes the correspondence between N+1 levels of local flatness and N+1 colors.

[0110] Here, the electronic device determines the local flatness corresponding to any grid according to the correspondence between N+1 distance ranges and N+1 levels of local flatness in accordance with the above method, and then determines the color corresponding to the local flatness of the cultivated land covered by the grid according to the correspondence between the N+1 levels of local flatness and N+1 colors, and renders the three-dimensional point cloud in the grid to the determined color; after rendering the colors of the three-dimensional point clouds in all grids of the cultivated land, the rendered image is output.

[0111] For example, when N=6, the correspondence between N+1 levels of local flatness and N+1 colors is: the color corresponding to flatness A is red, the color corresponding to flatness B is a gradient from red to purple, the color corresponding to flatness C is a gradient from purple to blue, the color corresponding to flatness D is blue, the color corresponding to flatness E is a gradient from blue to green, the color corresponding to flatness F is a gradient from green to yellow, and the color corresponding to flatness G is yellow.

[0112] If the local flatness of the cultivated land covered by any grid is flatness D, then the electronic device renders all the three-dimensional point clouds within the grid as blue; if the local flatness of the cultivated land covered by any grid is flatness A, then the electronic device renders all the three-dimensional point clouds within the grid as red; if the local flatness of the cultivated land covered by any grid is flatness E, then the electronic device renders all the three-dimensional point clouds within the grid as a gradient from blue to green.

[0113] In order to intuitively display the degree of convexity or concavity of the cultivated land covered by the grid to guide agricultural production, in one embodiment, when the average distance corresponding to the grid is obtained to belong to the first distance range, the first relationship further includes a correspondence relationship between N+1 distance ranges and N+1 colors, and the N+1 colors are different;

[0114] The rendering of the three-dimensional point cloud in the grid of the cultivated land into a color corresponding to the local flatness corresponding to the grid according to the first relationship includes:

[0115] According to the correspondence between N+1 distance ranges and N+1 colors, the three-dimensional point cloud within the grid of the cultivated land is rendered into the color corresponding to the first distance range.

[0116] Here, when the number of the second set thresholds is N, the electronic device can establish a correspondence between N+1 distance ranges and N+1 colors, and the N+1 colors are different. When the electronic device determines that the average distance corresponding to any grid belongs to the first distance range, the electronic device determines the color corresponding to the first distance range based on the correspondence between the N+1 distance ranges and the N+1 colors, and renders all three-dimensional point clouds in the grid into the color corresponding to the first distance range.

[0117] For example, when N=6, the correspondence between N+1 distance ranges and N+1 colors is: the color corresponding to the distance range A (-∞, -20×1.5) is red, the color corresponding to the distance range B (-20×1.5, -20) is a gradient from red to purple, the color corresponding to the distance range C [-20, -5) is a gradient from purple to blue, the color of the distance range D [-5, 5] is blue, the color corresponding to the distance range E (5, 20) is a gradient from blue to green, the color corresponding to the distance range F [20, 20×1.5) is a gradient from green to yellow, and the color corresponding to the distance range G [20×1.5, ∞) is yellow.

[0118] If the first distance range to which the average distance corresponding to any grid belongs is distance range A, then the electronic device renders all three-dimensional point clouds within the grid as red; if the first distance range to which the average distance corresponding to any grid belongs is distance range C, then the electronic device renders all three-dimensional point clouds within the grid as a gradient from purple to blue; if the first distance range to which the average distance corresponding to any grid belongs is distance range E, then the electronic device renders all three-dimensional point clouds within the grid as a gradient from blue to green.

[0119] Figure 4 The following is an example of a 30-acre arable land 3D point cloud before and after rendering. Figure 4 (a) is the original 3D point cloud; Figure 4 (b) is the grid rendering image corresponding to the original 3D point cloud in 4(a). The grid rendering image can be understood as the image obtained by rendering the 3D point cloud in each grid of the same farmland into corresponding colors. Figure 4 Image (b) can quickly find local sunken areas and / or convex areas of the cultivated land. For example, there is a severely convex area in the lower left corner of the cultivated land, and there is a severely sunken area in the upper right corner.

[0120] The above scheme can quickly evaluate the overall and local levelness of the cultivated land. Since the measurement accuracy of the cultivated land flatness is not affected by the operator's experience and sampling frequency, the measurement accuracy of the cultivated land flatness can be maintained at a stable level, thereby improving the accuracy and confidence of the detection results of the cultivated land flatness.

[0121] In order to implement the flatness detection method of the embodiment of the present application, the embodiment of the present application also provides a flatness detection device, which is arranged in an electronic device, such as Figure 5 As shown, the device comprises:

[0122] A fitting unit 501 is used to perform plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land to obtain an equation of the fitting plane;

[0123] A first determining unit 502 is used to determine the overall flatness of the cultivated land according to the inner product between a first normal vector and a second normal vector of the point cloud coordinate system, wherein the first normal vector is obtained by the equation of the fitting plane;

[0124] The second determination unit 503 is used to determine the local flatness of the cultivated land covered by the corresponding grid according to the first distance of each three-dimensional point cloud in the grid of the cultivated land; the first distance represents the distance from the three-dimensional point cloud to the fitting plane.

[0125] In one embodiment, the first determining unit 502 is specifically configured to:

[0126] When the first absolute value is greater than or equal to the first set threshold, determining the overall flatness of the cultivated land as the first flatness; or

[0127] When the first absolute value is less than the first set threshold, the overall flatness of the cultivated land is determined as the second flatness; wherein,

[0128] The first absolute value represents the absolute value of the inner product between the first normal vector and the second normal vector; the first absolute value is greater than or equal to 0 and less than or equal to 1; the first flatness represents the overall flatness of the cultivated land, and the second flatness represents the overall unevenness of the cultivated land.

[0129] In one embodiment, the second determining unit 503 is specifically configured to:

[0130] Determine a first distance of each three-dimensional point cloud in the grid of the cultivated land according to an equation of the fitting plane and the coordinates of each three-dimensional point cloud in the grid of the cultivated land;

[0131] The local flatness of the cultivated land covered by the corresponding grid is determined according to the second set threshold and the average distance corresponding to the grid of the cultivated land; the average distance corresponding to the grid represents the mean value of the sum of the first distances of all three-dimensional point clouds in the grid.

[0132] In one embodiment, the number of the second set thresholds is N, where N is an integer greater than or equal to 1; the second determining unit 503 is specifically configured to:

[0133] Matching the average distance corresponding to the grid of the cultivated land with N+1 distance ranges to obtain a first distance range to which the average distance corresponding to the grid belongs;

[0134] According to the correspondence between N+1 distance ranges and N+1 levels of local flatness, the local flatness corresponding to the first distance range is determined; wherein,

[0135] The first distance range is one of N+1 distance ranges, and the N+1 distance range is an interval divided according to N second set thresholds.

[0136] In one embodiment, the device further comprises:

[0137] A rendering unit, configured to render the three-dimensional point cloud in the grid of the cultivated land into a color corresponding to the local flatness corresponding to the grid according to the first relationship;

[0138] An output unit is used to output the rendered image; wherein the first relationship at least includes a corresponding relationship between local flatness and color, and different local flatnesses correspond to different colors.

[0139] In one embodiment, when the number of the second set thresholds is N, and N is an integer greater than or equal to 1, the first relationship further includes a correspondence between N+1 levels of local smoothness and N+1 colors.

[0140] In one embodiment, when the average distance corresponding to the grid is obtained to belong to the first distance range, the first relationship further includes a correspondence relationship between N+1 distance ranges and N+1 colors, and the N+1 colors are different;

[0141] The rendering unit is specifically configured to render the three-dimensional point cloud within the grid of the cultivated land into the color corresponding to the first distance range according to the correspondence between N+1 distance ranges and N+1 colors.

[0142] In actual application, the fitting unit 501, the first determination unit 502, the second determination unit 503 and the rendering unit can be implemented by a processor in the flatness detection device, and the output unit can be implemented by a processor in the flatness detection device combined with a communication interface.

[0143] It should be noted that: the flatness detection device provided in the above embodiment only uses the division of the above program modules as an example when performing flatness detection. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the flatness detection device provided in the above embodiment and the flatness detection method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0144] Based on the hardware implementation of the above program module, and in order to implement the above method of the embodiment of the present application, the embodiment of the present application also provides an electronic device, such as Figure 6 As shown, the electronic device 600 includes:

[0145] Communication interface 601, capable of exchanging information with other network nodes;

[0146] The processor 602 is connected to the communication interface 601 to implement information exchange with other network nodes, and is used to execute the method provided by one or more technical solutions when running a computer program. The computer program is stored in the memory 603.

[0147] It should be noted that the specific processing process of the processor 602 and the communication interface 601 can be understood by referring to the above method.

[0148] Of course, in actual application, the various components in the electronic device 600 are coupled together through the bus system 604. It can be understood that the bus system 604 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 604 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 6 Various buses are labeled as bus system 604 .

[0149] The memory 603 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 600. Examples of such data include: any computer program used to operate on the electronic device 600.

[0150] The method disclosed in the above embodiment of the present application can be applied to the processor 602, or implemented by the processor 602. The processor 602 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of the hardware in the processor 602 or an instruction in the form of software. The above-mentioned processor 602 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 602 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 603, and the processor 602 reads the information in the memory 603 and completes the steps of the above method in combination with its hardware.

[0151] In an exemplary embodiment, the electronic device 600 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0152] It can be understood that the memory (memory 603) of the embodiment of the present application 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 magnetic random access memory (FRAM), a ferromagnetic random access memory, 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), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, 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 (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.

[0153] In an exemplary embodiment, the present application embodiment further provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a first memory 603 storing a computer program, and the computer program can be executed by a processor 602 of an electronic device 600 to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.

[0154] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0155] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0156] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.

[0157] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A flatness detection method, characterized in that: include: Performing plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land to obtain an equation of the fitting plane; Determining the overall flatness of the cultivated land according to the inner product between a first normal vector and a second normal vector of the point cloud coordinate system, wherein the first normal vector is obtained by the equation of the fitting plane; Determine the local flatness of the cultivated land covered by the corresponding grid according to the first distance of each three-dimensional point cloud in the grid of the cultivated land; The first distance represents the distance from the three-dimensional point cloud to the fitting plane.

2. The method according to claim 1, characterized in that: Determining the overall flatness of the cultivated land comprises: When the first absolute value is greater than or equal to the first set threshold, determining the overall flatness of the cultivated land as the first flatness; or When the first absolute value is less than the first set threshold, the overall flatness of the cultivated land is determined as the second flatness; wherein, The first absolute value represents the absolute value of the inner product between the first normal vector and the second normal vector; the first absolute value is greater than or equal to 0 and less than or equal to 1; the first flatness represents the overall flatness of the cultivated land, and the second flatness represents the overall unevenness of the cultivated land.

3. The method according to claim 1, characterized in that The determining, according to the first distance of each three-dimensional point cloud in the grid of the cultivated land, the local flatness of the cultivated land covered by the corresponding grid comprises: Determine a first distance of each three-dimensional point cloud in the grid of the cultivated land according to an equation of the fitting plane and the coordinates of each three-dimensional point cloud in the grid of the cultivated land; The local flatness of the cultivated land covered by the corresponding grid is determined according to the second set threshold and the average distance corresponding to the grid of the cultivated land; the average distance corresponding to the grid represents the mean value of the sum of the first distances of all three-dimensional point clouds in the grid.

4. The method according to claim 3, characterized in that: The number of the second set thresholds is N, where N is an integer greater than or equal to 1; determining the local flatness of the cultivated land covered by the corresponding grid according to the second set threshold and the average distance corresponding to the grid of the cultivated land includes: Matching the average distance corresponding to the grid of the cultivated land with N+1 distance ranges to obtain a first distance range to which the average distance corresponding to the grid belongs; According to the correspondence between N+1 distance ranges and N+1 levels of local flatness, the local flatness corresponding to the first distance range is determined; wherein, The first distance range is one of N+1 distance ranges, and the N+1 distance range is an interval divided according to N second set thresholds.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: According to the first relationship, the three-dimensional point cloud within the grid of the cultivated land is rendered as a color corresponding to the local flatness corresponding to the grid, and the rendered image is output; wherein the first relationship at least includes a corresponding relationship between local flatness and color, and different local flatnesses correspond to different colors.

6. The method according to claim 5, characterized in that When the number of the second set thresholds is N, and N is an integer greater than or equal to 1, the first relationship further includes a correspondence between N+1 levels of local smoothness and N+1 colors.

7. The method according to claim 5, characterized in that In the case where the average distance corresponding to the grid is obtained to belong to the first distance range, the first relationship further includes a correspondence relationship between N+1 distance ranges and N+1 colors, and the N+1 colors are different; The rendering of the three-dimensional point cloud in the grid of the cultivated land into a color corresponding to the local flatness corresponding to the grid according to the first relationship includes: According to the correspondence between N+1 distance ranges and N+1 colors, the three-dimensional point cloud within the grid of the cultivated land is rendered into the color corresponding to the first distance range.

8. A flatness detection device, characterized in that: include: A fitting unit, used for performing plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land, so as to obtain an equation of the fitting plane; A first determining unit, configured to determine the overall flatness of the cultivated land according to an inner product between the first normal vector and a second normal vector of the point cloud coordinate system; The first normal vector is obtained from the equation of the fitted plane; A second determination unit is used to determine the local flatness of the cultivated land covered by the corresponding grid according to the first distance of each three-dimensional point cloud in the grid of the cultivated land; The first distance represents the distance from the three-dimensional point cloud to the fitting plane.

9. An electronic device, characterized in that: comprising a processor and a communication interface, wherein: The processor is used to perform plane fitting on the three-dimensional point cloud of the cultivated land according to the three-dimensional point cloud data of the cultivated land to obtain the equation of the fitting plane; determine the overall flatness of the cultivated land according to the inner product between the first normal vector and the second normal vector of the point cloud coordinate system; determine the local flatness of the cultivated land covered by the corresponding grid according to the first distance of each three-dimensional point cloud in the grid of the cultivated land; wherein the first normal vector is obtained by the equation of the fitting plane; and the first distance represents the distance from the three-dimensional point cloud to the fitting plane.

10. An electronic device, characterized in that: comprising a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the steps of the method described in any one of claims 1 to 7.

11. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.