A method and system for extracting the contour of a field ridge
Through rasterization processing and low-dimensional mapping, data is projected into two-dimensional space, combined with semantic segmentation and contour extraction algorithms, the problems of large and slow calculations in the existing technology are solved, and efficient field contour extraction is achieved.
Patent Information
- Application Number
- CN202211621503.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-12-16
AI Technical Summary
The existing technology has a huge amount of calculation in the extraction of troughs and slow calculation speed, so it is impossible to effectively extract troughs with dense distribution, small scale and fuzzy features.
Rasterization processing and low-dimensional mapping are used to map data to two-dimensional space for calculation, avoid multiple clustering operations, and extract the field ridge profile through semantic segmentation and contour extraction algorithms.
This greatly reduces the calculation amount, improves the calculation speed, and achieves efficient field ridge profile extraction.
Smart Images

Figure CN116229093B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of surveying and mapping, and specifically relates to a method and system for extracting ridge contours. Background Art
[0002] In projects such as land acquisition and resettlement, smart cities, smart construction sites, land planning, and engineering quantity measurement, the statistics of cultivated land plots mainly rely on a large number of on-site researchers to conduct on-site visits and measurements, or to manually outline through satellite images, making statistical data extremely difficult. Currently, remote sensing images are mainly used to statistically analyze land use information and monitor land cover to achieve the extraction of land plots.
[0003] However, due to the low resolution of remote sensing images, the above-mentioned plot extraction based on remote sensing is only applicable to large-scale national land monitoring and cannot extract ridges that are densely distributed, small in scale, and fuzzy in features in large scenes.
[0004] In this regard, the Chinese invention patent with the publication number CN115049925A provides a method for extracting ridges of fields. The disadvantage of this method is that it requires multiple clustering operations, all of which are calculated based on three-dimensional point cloud data, resulting in a huge amount of calculation and a slow calculation speed. Summary of the Invention
[0005] To solve the problems of the large amount of calculation and slow calculation speed of the existing ridge extraction methods, the present invention provides a method for extracting ridge contours.
[0006] On the one hand, a method for extracting ridge contours is provided, including the following steps:
[0007] S1. Perform three-dimensional reconstruction on the aerial image sequence of the ridge to be extracted to obtain an oblique photography model and three-dimensional point cloud data;
[0008] S2. Perform a forward projection on the oblique photography model to obtain orthophoto image data;
[0009] S3. Input the orthophoto image data into a semantic segmentation algorithm model to obtain a ridge mask result map;
[0010] S4. Perform contour extraction on the ridge mask result map to obtain the contours of each cultivated land plot;
[0011] S5. According to the contours of each cultivated land plot, extract the point cloud sets corresponding to the contours of each cultivated land plot from the three-dimensional point cloud data;
[0012] S6. Project all point cloud sets onto a two-dimensional plane, perform rasterization processing to obtain a raster matrix, calculate the average angle between the normal vector of each point cloud in each raster and the unit vector, assign the first brightness value to the rasters with the average angle within the range of 0 to 45°, assign the second brightness value to the rasters with the average angle within the range of 65 to 90°, and convert the raster matrix into two monochromatic images according to different brightness values;
[0013] S7. After performing binarization processing on the two monochromatic images, extract all the contours in the two monochromatic images. Use the coordinates of any contour point on the contour as an index, and use the index to find the raster corresponding to the contour point. Use the central coordinates of all the point clouds in the raster as the new coordinates of the contour point until the new coordinates of all the contour points are updated;
[0014] S8. Reconstruct the contour according to the new coordinates of each contour point to obtain the contour of each ridge.
[0015] In some embodiments, in step S6, first calculate the normal vector of each point cloud, and then project all the point cloud sets onto a two-dimensional plane.
[0016] In some embodiments, in step S6, the two-dimensional plane is obtained by the following method: Use the bounding box algorithm to calculate the minimum bounding cube of all the point cloud sets. Define the origin as the lower left rear vertex of the minimum bounding cube, the x-axis and the Y-axis are parallel to the sides of the minimum bounding cube, the Z-axis is perpendicular to the bottom surface and upward, define the Z-axis direction as the mapping main direction, and the XY plane is the two-dimensional plane.
[0017] In some embodiments, in step S6, the point clouds in each raster are determined by the following method; traverse all the point clouds, and judge the raster into which each point cloud falls according to the following formula:
[0018] M = ((y max - y) / step);
[0019] N = ((x - x min ) / step);
[0020] If M is greater than 0 and less than rows, and N is greater than 0 and less than cols, then the point cloud falls into the [[M], [N]]-th position in the raster matrix;
[0021] In the formula, M and N are the indexes of each point cloud in the raster matrix, x is the abscissa value of the point cloud, y is the ordinate value of the point cloud, x min is the minimum abscissa value of the point clouds in the point cloud set, y max is the maximum ordinate value of the point clouds in the point cloud set, rows is the total number of columns of the raster matrix, cols is the total number of rows of the raster matrix, step is the step size of the raster matrix; rows = int((Y max - Ymin ) / step); cols = int((X max -X min ) / step).
[0022] In some embodiments, step S6 further includes the following steps: counting the difference between the highest point and the lowest point of each point cloud in the z-axis direction of each grid; if the difference is less than 2m, determining that the point cloud in the grid is a ground point; if the difference is greater than 2m, determining that the point cloud in the grid is an obstacle point, and removing the obstacle point.
[0023] On the other hand, a ridge extraction system is provided, which includes a computer device. The computer device includes a memory, a processor, and program instructions stored in the memory and executable by the processor. The processor executes the program instructions to implement the steps of the above ridge contour extraction method.
[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: The present application adopts grid processing and low-dimensional mapping, avoiding multiple clustering operations, and mapping the data to two-dimensional space for calculation, reducing the amount of calculation and greatly improving the calculation speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a schematic flowchart of a ridge contour extraction method in an embodiment of the present application;
[0026] Figure 2 It is a schematic diagram of converting a point cloud into a red-blue two-dimensional mapping diagram in an embodiment of the present application;
[0027] Figure 3 It is a ridge mask result diagram in an embodiment of the present application;
[0028] Figure 4 It is a schematic diagram of a single cultivated land in an embodiment of the present application;
[0029] Figure 5 It is a two-dimensional vector surface diagram of each ridge in a single cultivated land in an embodiment of the present application;
[0030] Figure 6 It is a two-dimensional vector surface diagram of each plot in a single cultivated land in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0031] In order to better understand the above technical solutions, the above technical solutions will be described in detail below in conjunction with the accompanying drawings of the specification and specific embodiments.
[0032] Embodiment 1
[0033] See Figure 1, A method for extracting the contour of a field ridge, comprising the following steps:
[0034] S1. Perform 3D reconstruction on the aerial image sequence of the field ridge to be extracted to obtain an oblique photography model and 3D point cloud data; the 3D reconstruction can be implemented using existing software. For example, the 3D reconstruction can be completed using ContextCapture software;
[0035] S2. Perform forward projection on the oblique photography model to obtain orthophoto image data;
[0036] S3. Input the orthophoto image data into a semantic segmentation algorithm model to obtain a field ridge mask result map. The semantic segmentation algorithm model is a pre-trained model, for example, it can be DeeplabV3.
[0037] S4. Use a contour extraction algorithm to extract the contours of each cultivated land plot from the field ridge mask result map;
[0038] S5. According to the contours of each cultivated land plot, use the ray method to extract the point cloud set corresponding to each cultivated land plot contour from the 3D point cloud data. It should be noted here that the data storage form of the contours of each cultivated land plot is pixel coordinate values, while the data storage form of the 3D point cloud data is geographic coordinate values. Therefore, it is necessary to first perform pixel-geographic coordinate system conversion to make the reference coordinate systems of the contours of each cultivated land plot and the 3D point cloud data consistent, and then extract the point cloud set corresponding to each cultivated land plot contour from the 3D point cloud data. The pixel-geographic coordinate system conversion method is an existing technology.
[0039] S6. Calculate the normal vectors of each point cloud in the point cloud set, project all the point cloud sets onto a two-dimensional plane, perform rasterization processing to obtain a raster matrix, and statistically calculate the difference between the highest point and the lowest point of each point cloud in the z-axis direction in each raster; if the difference is less than 2m, it is determined that the point cloud in the raster is a ground point; if the difference is greater than 2m, it is determined that the point cloud in the raster is an obstacle point, and the obstacle point is removed. Then calculate the average value of the angles between the normal vectors of each point cloud in each raster and the unit vector, set [0°-45°] and [65°-90°] as the point cloud retention intervals, and delete the points whose average angle value is not within this range. Assign the raster with an average angle value in the range of 0 to 45° a blue brightness value [0,0,255], assign the raster with an average angle value in the range of 65 to 90° a red brightness value [255,0,0], and set the raster without point cloud to a black brightness value [0,0,0] to obtain a red-blue two-dimensional mapping diagram. Use image threshold processing to set the red and blue values in the red-blue two-dimensional mapping diagram to zero respectively to obtain an image without red and an image without blue, that is, convert the raster matrix into two monochromatic images according to the different brightness values.
[0040] Specifically, the two-dimensional plane is obtained by the following method: Using the bounding box algorithm to calculate the minimum enclosing cube of all point cloud sets, the origin is defined as the lower left rear vertex of the minimum enclosing cube, the x-axis and the Y-axis are parallel to the sides of the minimum enclosing cube, the Z-axis is perpendicular to the bottom surface and points upward, the Z-axis direction is defined as the mapping main direction, and the XY plane is the two-dimensional plane.
[0041] Specifically, the rasterization process includes the following steps: Search for the minimum coordinate point (x min , y max ) and the maximum coordinate point (x max , y min ) in the point cloud set, generate a minimum rectangular box with the minimum coordinate point and the maximum coordinate point, and obtain a raster matrix by rasterizing the rectangular box through a step size; where, x min is the minimum abscissa value of the point cloud in the point cloud set, x max is the maximum abscissa value of the point cloud in the point cloud set, y min is the minimum ordinate value of the point cloud in the point cloud set, and y max is the maximum ordinate value of the point cloud in the point cloud set.
[0042] Specifically, the point cloud in each grid is determined by the following method: Traverse all point clouds, and judge the grid into which each point cloud falls according to the following formula:
[0043] M = ((y max - y) / step);
[0044] N = ((x - x min ) / step);
[0045] If M is greater than 0 and less than rows, and N is greater than 0 and less than cols, then the point cloud falls into the [[M], [N]]-th position in the raster matrix;
[0046] In the formula, M and N are the indexes of each point cloud in the raster matrix, x is the abscissa value of the point cloud, y is the ordinate value of the point cloud, rows is the total number of columns of the raster matrix, cols is the total number of rows of the raster matrix, and step is the step size; rows = int((Y max - Y min ) / step); cols = int((X max - X min ) / step).
[0047] S8. After binarizing the two monochromatic images, use the contour search algorithm to extract all the contours in the two monochromatic images. Use the coordinates of any contour point on the contour as an index, and use the index to find the grid corresponding to the contour point. Use the center coordinates of all the point clouds in the grid as the new coordinates of the contour point until the new coordinates of all the contour points are updated.
[0048] Specifically, the grid corresponding to the contour point is found by using the index through the following method: the size of each red-blue two-dimensional mapping diagram is O*P, and the size of the corresponding grid matrix is also O*P. The coordinates of any contour point are (a, b). Suppose for a certain contour point a = 3 and b = 3, then this contour point corresponds to the position in the third row and third column of the grid matrix.
[0049] S9. Reconstruct the contour according to the new coordinates of each contour point to obtain the contours of each ridge.
[0050] The contours of each ridge can be saved as a two-dimensional vector surface file, and thus the two-dimensional vector surface map of each ridge in a single cultivated land can be obtained, as Figure 5 shown. Further, the two-dimensional vector surface file of the field block can also be output to obtain the two-dimensional vector surface map of each field block in a single cultivated land, as Figure 6 shown.
[0051] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for extracting ridge contours, comprising the following steps: S1. Perform three-dimensional reconstruction on the aerial image sequence of the ridge to be extracted to obtain an oblique photography model and three-dimensional point cloud data; S2. Perform forward projection on the oblique photography model to obtain orthophoto image data; S3. Input the orthophoto image data into the semantic segmentation algorithm model to obtain a ridge mask result map; S4. Perform contour extraction on the ridge mask result map to obtain the contours of each cultivated land plot; S5. According to the contours of each cultivated land plot, extract the point cloud sets corresponding to the contours of each cultivated land plot from the three-dimensional point cloud data; S6. Project all the point cloud sets onto a two-dimensional plane, perform rasterization processing to obtain a raster matrix, calculate the average value of the angles between the normal vectors and the unit vectors of the point clouds in each raster, assign the first brightness value to the raster with the average angle value in the range of 0-45°, assign the second brightness value to the raster with the average angle value in the range of 65-90°, and convert the raster matrix into two monochromatic images according to the different brightness values; Among them, The two-dimensional plane is obtained by the following method: Use the bounding box algorithm to calculate the minimum circumscribed cube of all the point cloud sets, define the origin as the lower left rear vertex of the minimum circumscribed cube, the x-axis and the Y-axis are parallel to the sides of the minimum circumscribed cube, the Z-axis is perpendicular to the bottom surface and upward, define the Z-axis direction as the mapping main direction, and the XY plane is the two-dimensional plane; The point clouds in each raster are determined by the following method: Traverse all the point clouds and judge the raster into which each point cloud falls according to the following formula: ; ; If is greater than 0 and less than , is greater than 0 and less than , then the point cloud falls into the th position in the grid matrix; Wherein, , is the index of each point cloud in the grid matrix, is the abscissa value of the point cloud, is the ordinate value of the point cloud, is the minimum abscissa value of the point clouds in the point cloud set, is the maximum ordinate value of the point clouds in the point cloud set, is the total number of columns of the grid matrix, is the total number of rows of the grid matrix, is the step size of the grid matrix; ; ; S7. After performing binarization processing on the two monochromatic images, extract all the contours in the two monochromatic images. Use the coordinates of any contour point on the contour as an index, use the index to find the raster corresponding to the contour point, and use the central coordinates of all the point clouds in the raster as the new coordinates of the contour point until the new coordinates of all the contour points are updated; S8. Reconstruct the contours according to the new coordinates of each contour point to obtain the contours of each ridge.
2. The method for extracting the ridge contour according to claim 1, characterized in that: In step S6, first calculate the normal vectors of the point clouds in the cloud set, and then project all the point cloud sets onto a two-dimensional plane.
3. The method for extracting the ridge contour according to claim 1 or 2, characterized in that Step S6 further includes the following steps: Statistically calculate the difference between the highest point and the lowest point in the z-axis direction of the point clouds in each raster; if the difference is less than 2m, judge that the point cloud in the raster is a ground point; if the difference is greater than 2m, judge that the point cloud in the raster is an obstacle point and remove the obstacle point.
4. A ridge extraction system, which includes a computer device. The computer device includes a memory, a processor, and program instructions stored in the memory and available for the processor to run. The processor executes the program instructions to implement the steps of the method according to any one of claims 1-3.
Citation Information
Patent Citations
Field block field ridge extraction method, electronic equipment and storage medium
CN115049925A
Unmanned aerial vehicle point cloud lane line extraction method and system
CN112528892A
Laser scanning automatic laying on-line detection method and device based on deep learning
CN113781432A