Complex trajectory centerline extraction method based on expansion-erosion algorithm
Through the vector data processing method based on the expansion corrosion algorithm, the complexity and irregularity of field trajectory data processing are solved, and efficient and accurate navigation and route planning are achieved.
Patent Information
- Application Number
- CN202211412890.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-11-11
AI Technical Summary
The prior art cannot efficiently and easily process complex, irregular and small trajectory data in field construction environments, resulting in low efficiency and low accuracy in navigation and route planning.
The field trajectory data is optimized and processed and extracted centerlines based on expansion corrosion algorithm is adopted, and the centerlines are extracted through vector data rasterization, trajectory raster expansion, trajectory raster corrosion and trajectory raster centerline methods.
It realizes efficient and accurate processing of field trajectory data, quickly obtains regular navigation routes, and improves the efficiency of field navigation and route planning.
Smart Images

Figure CN118071789B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of data processing, and relates to a method for extracting the center line of a complex trajectory, in particular to a method for extracting the center line of a complex trajectory based on an expansion-erosion algorithm. Background Art
[0002] During field construction, the environment often lacks detailed road networks and accessible paths. Therefore, workers must explore accessible paths on foot or with specialized vehicles, which can be quite dangerous. GPS devices carried by workers or vehicles record their trajectory data, which must be processed to obtain accessible path information.
[0003] There are many different methods for processing trajectory data, but most are targeted at urban areas, processing point and line data and using existing roads as a reference. These methods are complex, challenging to implement, and their effectiveness varies depending on the specific data. Field environments differ in many ways. First, urban roads are highly regular, resulting in abundant and densely collected trajectory data, necessitating complex processing for data screening and analysis. In contrast, field construction sites, often located in areas without man-made roads, rely on vehicle and personnel trajectories to provide navigational references for subsequent work. Trajectory data is sparse, spaced widely, and routes are irregular, requiring low accuracy. Second, due to field environmental constraints and potential equipment errors and failures, trajectory patterns are highly irregular, subject to interruptions and confusion. Furthermore, data recorded by multiple people and multiple devices may not be completely consistent, resulting in interlaced and small-scale offsets in the overall trajectory data. Consequently, existing algorithms are not applicable to field trajectory data processing. Currently, manual editing is often used to process field trajectory data, resulting in low accuracy and efficiency. Summary of the Invention
[0004] In order to solve the above deficiencies in the prior art, the present invention aims to provide a complex trajectory centerline extraction method based on the expansion-erosion algorithm, so as to achieve the purpose of extracting the centerline of complex field travel trajectories simply and efficiently.
[0005] To achieve the above-mentioned purpose, the technical solution adopted by the present invention is as follows: a complex trajectory centerline extraction method based on the expansion and corrosion algorithm, comprising: rasterizing vector data to obtain a binary trajectory grid; expanding the trajectory grid to obtain an expanded trajectory grid image; corroding the trajectory grid to obtain an corroded trajectory grid image; and extracting the trajectory grid centerline to obtain the extracted centerline.
[0006] As a limitation of the present invention, the vector data rasterization includes: setting a grid size, converting the trajectory line data into binary raster data, and obtaining a binary trajectory raster map, wherein the binary trajectory raster map includes a trajectory raster and a non-trajectory raster.
[0007] As a limitation of the present invention: the trajectory line data is formed by connecting trajectory points in time sequence.
[0008] As a limitation of the present invention: set the grid size to i, divide the area covered by the trajectory line into a grid map with i*i as the pixel, set the pixel value of the trajectory grid through which the trajectory line passes to 1, and set the pixel value of the non-trajectory grid through which the trajectory line does not pass to 0, and obtain a binary trajectory grid map.
[0009] As a limitation of the present invention: the trajectory grid expansion includes setting an expansion radius, performing an expansion operation on the trajectory grid, and setting the grid within the range of the expansion radius divided by the grid size with the trajectory grid as the center as the expanded trajectory grid to obtain an expanded trajectory grid map.
[0010] As a limitation of the present invention: setting the expansion radius to R, using a two-dimensional filter with a radius of R / i to traverse the trajectory grid map, if there is a pixel with a pixel value of 1 in the filter neighborhood, then the value of the center pixel of the filter is set to 1, and the grid is the expanded trajectory grid, and the expanded trajectory grid map is obtained.
[0011] As a limitation of the present invention: the trajectory grid erosion includes setting an erosion radius, performing an erosion operation on the expanded trajectory grid image, assigning a grid with the expanded non-trajectory grid as the center and the erosion radius as the radius to the eroded non-trajectory grid, and obtaining the eroded trajectory grid image.
[0012] As a limitation of the present invention: setting the erosion radius to r, using a two-dimensional filter with a radius of r / i to traverse the expanded trajectory grid map, if there is a pixel with a pixel value of 0 in the filter neighborhood, then the value of the center pixel of the filter is set to 0, and the grid is the non-trajectory grid after erosion, and the trajectory grid map after erosion is obtained.
[0013] As a limitation of the present invention: the trajectory grid centerline extraction includes using a tracking-based grid centerline extraction algorithm to process the eroded trajectory grid image, obtain the center points of the key inflection points of the refined trajectory, and connect the center points to obtain the extracted center line.
[0014] Due to the adoption of the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0015] The present invention adaptively optimizes the expansion-erosion algorithm based on the characteristics of field data, realizes the processing of field trajectory data, can effectively process the characteristics of field trajectory data such as scattered inflection points, overlapping intersections and discontinuities, and retains and fits the route characteristics of the original trajectory data to the greatest extent. The calculation is simple and accurate, and accurate and regular navigation route data can be quickly obtained, thereby improving the efficiency of field navigation and route planning and the effect of field navigation and route planning.
[0016] In summary, the present invention is more suitable for processing field travel trajectory data. Its calculation is simple and accurate, which improves the efficiency of field navigation and route planning, improves the effect of field navigation and route planning, and is suitable for all processing of field travel trajectory data. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.
[0018] Figure 1 is a flow chart of an embodiment of the present invention;
[0019] Figure 2 is the original trajectory diagram in the embodiment of the present invention;
[0020] Figure 3 This is a binarized trajectory grid image in an embodiment of the present invention;
[0021] Figure 4 This is the expanded trajectory grid diagram in an embodiment of the present invention;
[0022] Figure 5 This is a trajectory grid diagram after corrosion in an embodiment of the present invention;
[0023] Figure 6 This is the optimized regular trajectory diagram in the embodiment of the present invention;
[0024] Figure 7 3 is a comparison diagram of the original trajectory and the optimized trajectory in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The preferred embodiment of the present invention is described below with reference to the accompanying drawings. It should be understood that the complex trajectory centerline extraction method based on the expansion-erosion algorithm described herein is a preferred embodiment, which is only used to illustrate and explain the present invention and does not constitute a limitation of the present invention.
[0026] Complex trajectory centerline extraction method based on expansion and corrosion algorithm
[0027] This embodiment Figures 1 to 7 As shown in Figure 1, a complex trajectory centerline extraction method based on the expansion and corrosion algorithm is shown in Figure 2. Figure 1 As shown, the process includes sequentially performing vector data rasterization, trajectory grid expansion, trajectory grid erosion, and trajectory grid centerline extraction, and finally obtaining the extracted centerline, that is, the optimized regular trajectory line.
[0028] Taking the local trajectory data of multiple off-road vehicles in a forest area as an example, the specific steps of this embodiment are as follows:
[0029] (1) Rasterization of vector data
[0030] Connect the trajectory points in time sequence to obtain the trajectory line data. Figure 2 As shown in FIG, in this embodiment, the original track line is measured to be about 3 to 4 meters on average, about 15 meters at the widest point, and about 20 meters between breakpoints. Therefore, the grid size i is set to 2 meters, that is, the area covered by the track line (the rectangular area within the four boundaries of the track line) is divided into a grid map with 2×2 meters as pixels. The pixel value of the track grid through which the track line passes is set to 1, and the pixel value of the non-track grid that the track line does not pass is set to 0, thereby obtaining a binary track grid map, as shown in FIG. Figure 3 As shown, the lines in the figure are composed of trajectory grids.
[0031] (2) Trajectory grid expansion
[0032] According to the track spacing measured in the previous step, the expansion radius R is set to 20 meters, and the track grid is expanded. The grid with the track grid as the center and a radius of 10 (i.e. 20 / 2) pixels is set as the expanded track grid. That is, a two-dimensional filter with a radius of 10 pixels is used to traverse the track grid map. If there is a grid with a pixel value of 1 in the filter neighborhood, the value of the center pixel of the filter is set to 1. This grid is the expanded track grid, and the expanded track grid map is obtained, as shown in the figure below. Figure 4 As shown in the figure, wide tracks are formed (the dark gray portion is the expanded track, and the light gray line portion is the original track), with a track width greater than 40 meters. This ensures that the values of all grid pixels within a radius of R around the track grid pixel are set to 1. The track grid expands by a distance of R to both sides, merging overlapping tracks and connecting broken tracks.
[0033] (3) Track grid corrosion
[0034] While step (2) obtains wide trajectories that are fused and connected to each other, some irregular boundaries and noise points will be generated, which need to be removed by corrosion operation. The corrosion operation is opposite to the expansion operation. It is necessary to select a suitable corrosion radius r to corrode the boundary of the trajectory grid inward to refine the trajectory. In this embodiment, the corrosion radius r is set to 18 meters, and the corrosion operation is performed on the expanded trajectory grid map. The grid with the expanded non-trajectory grid as the center and 9 pixels as the radius is assigned as the eroded non-trajectory grid to obtain the eroded trajectory grid map. That is, a two-dimensional filter with a radius of 9 pixels (i.e. 18 / 2) pixels is used to traverse the expanded trajectory grid map. If there is a grid with a pixel value of 0 in the filter neighborhood, the value of the center pixel of the filter is set to 0. The grid is the eroded non-trajectory grid, and the eroded trajectory grid map is obtained, as shown in FIG. Figure 5 As shown in the figure, a refined trajectory grid is obtained (the black part in the figure is the expanded trajectory, the light gray part is the eroded trajectory, and the line part is the original trajectory). The width of the eroded trajectory is greater than 4 meters.
[0035] (4) Trajectory grid centerline extraction
[0036] The eroded trajectory grid image is processed by using a grid centerline extraction algorithm based on tracking to obtain the center points of the key inflection points of the refined trajectory. The center points are connected to obtain the center line of the trajectory grid, i.e., the optimized regular trajectory line. In this embodiment, the center line of the eroded trajectory grid image is vectorized to obtain the trajectory center line, i.e., the optimized regular trajectory line. The effect is as follows: Figure 6 As shown in the figure (the black part is the expansion trajectory, the light gray part is the trajectory after corrosion, and the line part is the optimized regular trajectory), compared with the original trajectory Figure 7 (The dark grey lines in the figure are the optimized regular trajectories, and the light grey lines are the original trajectories).
[0037] From the final effect Figure 7 It can be seen that the phenomena of trajectory line duplication and breakage have been eliminated, and the new trajectory line is smooth and continuous, achieving the expected goal.
Claims
1. A complex trajectory centerline extraction method based on expansion-erosion algorithm, characterized in that: include: Vector data is rasterized to obtain a binary trajectory raster; The vector data rasterization includes setting a grid size, converting the trajectory line data into binary raster data, and obtaining a binary trajectory raster map, wherein the binary trajectory raster map includes trajectory raster and non-trajectory raster; Expanding the trajectory grid to obtain an expanded trajectory grid map; the trajectory grid expansion includes setting an expansion radius, performing an expansion operation on the trajectory grid, setting the grid within the range of the expansion radius divided by the grid size with the trajectory grid as the center as the expanded trajectory grid, and obtaining the expanded trajectory grid map; The trajectory grid is corroded to obtain a trajectory grid map after corrosion; the trajectory grid corrosion includes setting an corrosion radius, performing an corrosion operation on the expanded trajectory grid map, assigning a grid with the expanded non-trajectory grid as the center and the corrosion radius as the radius to the corroded non-trajectory grid, and obtaining the trajectory grid map after corrosion; The center line of the trajectory grid is extracted to obtain the extracted center line.
2. The complex trajectory centerline extraction method based on the expansion-erosion algorithm according to claim 1 is characterized in that: The trajectory line data is formed by connecting the trajectory points in time sequence.
3. The complex trajectory centerline extraction method based on the expansion-erosion algorithm according to claim 1 or 2, characterized in that: Set the grid size to i, divide the area covered by the trajectory into a grid map with i*i pixels, set the pixel value of the trajectory grid through which the trajectory passes to 1, and set the pixel value of the non-trajectory grid that the trajectory does not pass to 0, and obtain a binary trajectory grid map.
4. The complex trajectory centerline extraction method based on the expansion-erosion algorithm according to claim 3 is characterized in that: The expansion radius is set to R, and the trajectory grid map is traversed using a two-dimensional filter with a radius of R / i. If there is a pixel with a pixel value of 1 in the filter neighborhood, the value of the center pixel of the filter is set to 1, and the corresponding grid is the expanded trajectory grid, and the expanded trajectory grid map is obtained.
5. The complex trajectory centerline extraction method based on the expansion-erosion algorithm according to claim 4 is characterized in that: The erosion radius is set to r, and a two-dimensional filter with a radius of r / i is used to traverse the expanded trajectory grid map. If there is a pixel with a pixel value of 0 in the filter neighborhood, the value of the center pixel of the filter is set to 0, and the corresponding grid is the non-trajectory grid after erosion, and the trajectory grid map after erosion is obtained.
6. The complex trajectory centerline extraction method based on the expansion-erosion algorithm according to claim 5 is characterized in that: The trajectory grid centerline extraction includes processing the eroded trajectory grid image using a tracking-based grid centerline extraction algorithm to obtain center points of key inflection points of the refined trajectory, and connecting the center points to obtain the extracted centerline.
Citation Information
Patent Citations
Lane line automatic extraction method based on vehicle trajectory
CN105488485A
Systems and methods for new road determination
CN111279386A