Branch road filtering method and device based on inflection point recognition and skeleton line extraction
The branch road filtering method uses inflection point recognition and skeleton line extraction to accurately separate trunk and branch roads, enhancing road extraction precision and reducing interference.
Patent Information
- Application Number
- CN202410485875.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-22
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-04-22
AI Technical Summary
Current road extraction methods struggle to accurately separate trunk and branch roads due to high similarity and complex environments, often mistakenly deleting parts of the trunk road area.
A branch road filtering method utilizing inflection point recognition and skeleton line extraction, involving inflection point identification, grid skeleton line extraction, and overlay analysis to separate main and branch roads based on size information.
The method effectively and accurately filters branch roads and incomplete sections, retaining main road information while minimizing interference, with improved efficiency and accuracy compared to traditional post-processing methods.
Smart Images

Figure CN118411378B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of geographic data processing, and in particular to a branch road filtering method and device based on inflection point recognition and skeleton line extraction. Background Art
[0002] Roads are important basic geographic data for mapping, route searching and emergency response. Obtaining accurate road information plays an important role in promoting urban planning, traffic navigation, digital map updates and building real-time road traffic information systems. Trunk roads are the backbone of the transportation network. Accurately obtaining trunk roads helps to understand road capacity and smoothness, which is even more important for the entire city's traffic planning and emergency rescue work.
[0003] With the rapid development of computer technology, road extraction methods emerge in an endless stream. In particular, deep learning algorithms have significantly improved the extraction accuracy in the field of road extraction with their excellent image analysis and pattern recognition capabilities. However, current algorithms mainly focus on the extraction of the overall road network, and there is little research on the extraction of trunk roads in specific scenarios. In addition, the complex and changeable road system environment and the high similarity of the characteristics of the main and branch roads in actual application scenarios make the accurate extraction of remote sensing trunk road information face great challenges. The current mainstream method is still to separate the main and branch roads by post-processing methods, such as morphological operations and small spot removal algorithms. The above methods can filter sporadic small roads to a certain extent, but they cannot be selectively eliminated, and it is easy to mistakenly delete parts of the trunk road area. Therefore, the separation of trunk and branch roads still faces great difficulties. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a branch road filtering method and device based on inflection point recognition and skeleton line extraction, which can quickly and accurately remove branch roads and incomplete sections and have a good anti-interference effect.
[0005] In a first aspect, an embodiment of the present invention provides a branch road filtering method based on inflection point recognition and skeleton line extraction, comprising:
[0006] Obtain road raster data to be processed;
[0007] Identify the inflection points contained in the road raster data, and use the inflection points to cut the road raster data to obtain cut road surface data; and extract the grid skeleton lines corresponding to the road raster data, and iteratively search the grid skeleton lines to obtain target vector skeleton lines; wherein the cut road surface data includes main road patches and branch road vector patches;
[0008] An overlay analysis is performed on the cut road surface data and the target vector skeleton line, so as to filter the branch road raster data contained in the road raster data based on the overlay analysis result to obtain road filtering result data; wherein the overlay analysis result is used to determine the size information corresponding to each road segment in the road raster data.
[0009] In one embodiment, the step of identifying the inflection points included in the road grid data and using the inflection points to cut the road grid data to obtain cut road surface data includes:
[0010] Converting the road raster data into initial road vector data, and smoothing the jagged edges of the initial road vector data to obtain target road vector data;
[0011] Based on a vector angle algorithm, identifying an inflection point included in the target road vector data;
[0012] The inflection points included in the target road vector data are matched, so as to cut the road raster data using the two matched inflection points to obtain cut road surface data.
[0013] In one implementation, based on a vector angle algorithm, the step of identifying an inflection point included in the target road vector data includes:
[0014] For three road points continuously distributed clockwise on the road boundary in the target road vector data, respectively construct a first road vector pointing from the first road point to the second road point and a second road vector pointing from the second road point to the third road point;
[0015] determining a vector angle between the first road vector and the second road vector;
[0016] If the vector angle is within a preset angle range, the second road point is used as a turning point between the main road and the branch road.
[0017] In one implementation, the step of matching the inflection point included in the target road vector data includes:
[0018] For each inflection point included in the target road vector data, taking the inflection point as the center of a circle, determining the radius based on a preset minimum road width threshold, and constructing a buffer zone corresponding to the inflection point;
[0019] If the buffer does not contain any other inflection points except the inflection point, then the inflection point is removed;
[0020] If the buffer contains one other inflection point except the inflection point, then determining that the inflection point matches the other inflection points;
[0021] If the buffer zone contains a plurality of other inflection points except the inflection point, the distance between any two inflection points in the buffer zone is determined, and based on the distance, two inflection points having a matching relationship are determined.
[0022] In one embodiment, the step of iteratively searching the grid skeleton line to obtain the target vector skeleton line includes:
[0023] Obtain each pixel point contained in the grid skeleton line in the current sliding window, traverse each of the pixel points, and search for neighboring pixel points corresponding to each of the pixel points and located on the grid skeleton line to generate a vector skeleton line in the current sliding window;
[0024] When the sliding window ends, a target vector skeleton line is determined based on the vector skeleton lines in each sliding window.
[0025] In one embodiment, the step of traversing each of the pixel points and searching for neighboring pixel points corresponding to each of the pixel points and located on the grid skeleton line to generate the vector skeleton line in the current sliding window includes:
[0026] Establishing a first list containing each of the pixel points, and establishing an empty second list;
[0027] Performing a multi-neighborhood search on the first pixel point in the first list; if there are multiple neighboring pixel points in the multi-neighborhood of the first pixel point that exist in the first list, determining a skeleton line key point from the neighboring pixel points in the first list; recording the skeleton line key point in the second list, and removing it from the first list to update the first list; continuing to perform a multi-neighborhood search on the skeleton line key point until there are no neighboring pixel points in the first list in the multi-neighborhood of the skeleton line key point;
[0028] Continue to perform multi-neighborhood search on the second pixel point in the updated first list until the first list is empty, and then generate the vector skeleton line in the current sliding window based on the skeleton line key points in the second list.
[0029] In one embodiment, the step of performing an overlay analysis on the cut road surface data and the vector skeleton line to filter the branch road raster data contained in the road raster data based on the overlay analysis result to obtain road filtering result data includes:
[0030] Performing an overlay analysis on the cut road surface data and the vector skeleton line to segment the vector skeleton line using the cut road surface data;
[0031] Determine the length information of each segment of the vector skeleton line obtained by segmentation, so as to determine the size information corresponding to each segment of the road in the road raster data based on the length information;
[0032] According to the size information corresponding to each road segment in the road grid data, the branch road grid data contained in the road grid data is filtered to obtain road filtering result data.
[0033] In one embodiment, after the step of obtaining the road raster data to be processed, the method further includes:
[0034] The noise spots contained in the road grid data are removed to perform small spot removal processing on the road grid data; wherein the noise spots are spots whose area is smaller than a preset area threshold;
[0035] Erosion calculation and expansion calculation are performed on the road grid data after the noise spots are removed, so as to perform morphological opening operation on the road grid data and obtain optimized road grid data.
[0036] In a second aspect, an embodiment of the present invention further provides a branch road filtering device based on inflection point recognition and skeleton line extraction, comprising:
[0037] A data acquisition module, used to acquire road raster data to be processed;
[0038] The inflection point recognition and skeleton line extraction module is used to identify the inflection points contained in the road raster data, and use the inflection points to cut the road raster data to obtain cut road surface data; and extract the grid skeleton lines corresponding to the road raster data, and iteratively search the grid skeleton lines to obtain target vector skeleton lines; wherein the cut road surface data includes main road patches and branch road vector patches;
[0039] A branch road filtering module is used to perform overlay analysis on the cut road surface data and the target vector skeleton line, so as to filter the branch road raster data contained in the road raster data based on the overlay analysis result to obtain road filtering result data; wherein the overlay analysis result is used to determine the size information corresponding to each road segment in the road raster data.
[0040] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement any one of the methods provided in the first aspect.
[0041] The embodiment of the present invention provides a branch road filtering method and device based on inflection point recognition and skeleton line extraction, firstly obtaining the road raster data to be processed; then identifying the inflection points contained in the road raster data, and using the inflection points to cut the road raster data to obtain the cut road surface data; at the same time, extracting the grid skeleton lines corresponding to the road raster data, and iteratively searching the grid skeleton lines to obtain the target vector skeleton lines; wherein the cut road surface data includes the main road spots and the branch road vector spots; finally, the cut road surface data and the target vector skeleton lines are overlaid and analyzed, and the overlay analysis results are used to determine the size information corresponding to each section of the road in the road raster data, so as to filter the branch road raster data contained in the road raster data based on the overlay analysis results to obtain the road filtering result data. The above method uses the inflection points to cut the main roads and branch roads in the road raster data, effectively realizing the precise separation of the main roads and branch roads; at the same time, based on the grid skeleton lines, the corresponding vector skeleton lines are obtained through an iterative search method to quickly and accurately calculate the size information corresponding to each section of the road, thereby selectively filtering the branch roads and better retaining the information of the main roads. Compared with the post-processing means provided by the prior art, the embodiment of the present invention can quickly and accurately remove branch roads and incomplete road sections, and has a better anti-interference effect.
[0042] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 A schematic flow chart of a branch road filtering method based on inflection point recognition and skeleton line extraction provided in an embodiment of the present invention;
[0046] Figure 2 A comparison diagram before and after performing small spot removal and morphological opening operation provided by an embodiment of the present invention;
[0047] Figure 3A schematic diagram of a vector simplification threshold adaptive principle provided by an embodiment of the present invention;
[0048] Figure 4 A schematic diagram of identifying inflection points based on a vector angle algorithm provided by an embodiment of the present invention;
[0049] Figure 5 A schematic diagram of a road turning point extraction result provided by an embodiment of the present invention;
[0050] Figure 6 A vector skeleton line extraction diagram provided by an embodiment of the present invention;
[0051] Figure 7 A schematic diagram of an eight-neighborhood provided by an embodiment of the present invention;
[0052] Figure 8 A schematic diagram of an urban road extraction image and a rural road extraction image provided by an embodiment of the present invention;
[0053] Fig. 9 A schematic diagram of superimposition analysis of vector skeleton lines and cut road surface data provided by an embodiment of the present invention;
[0054] Fig.10 A road filtering effect diagram provided by an embodiment of the present invention;
[0055] Fig.11 Another road filtering effect diagram provided by an embodiment of the present invention;
[0056] Fig.12 An overall flow chart of a branch road filtering method based on inflection point recognition and skeleton line extraction provided by an embodiment of the present invention;
[0057] Fig.13 A schematic diagram of the structure of a branch road filtering device based on inflection point recognition and skeleton line extraction provided by an embodiment of the present invention;
[0058] Fig.14 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] At present, the branch road filtering means provided by the relevant technology cannot selectively eliminate the branches according to the length and width of the roads, and it is easy to mistakenly delete some areas of the main roads. Therefore, the separation of the main and branch roads still faces great difficulties. Based on this, the present invention provides a branch road filtering method and device based on inflection point recognition and skeleton line extraction, which can quickly and accurately eliminate branch roads and incomplete sections, and has a good anti-interference effect.
[0061] To facilitate understanding of this embodiment, firstly, a branch road filtering method based on inflection point recognition and skeleton line extraction disclosed in an embodiment of the present invention is described in detail, see Figure 1 The flowchart of a branch road filtering method based on inflection point recognition and skeleton line extraction is shown, and the method mainly includes the following steps S102 to S106:
[0062] Step S102, obtaining road raster data to be processed.
[0063] The road raster data may be data extracted by model interpretation, and the model interpretation process may be a process of extracting roads using a convolutional neural network or other methods.
[0064] In one example, after obtaining the road grid data to be processed, small spots can be removed and morphological opening operations can be performed on the road grid data. In this process, the spot area threshold and the size of the opening convolution kernel can be selectively modified to more accurately remove interfering spots and obtain optimized road grid data.
[0065] Step S104, identifying the inflection points contained in the road grid data, and using the inflection points to cut the road grid data to obtain cut road surface data; and extracting the grid skeleton lines corresponding to the road grid data, and iteratively searching the grid skeleton lines to obtain the target vector skeleton lines.
[0066] Among them, the inflection point can be understood as the turning point of the road, the cut road surface data includes the main road map and the branch road vector map, and the skeleton line is an object representation that uses a thin curve that is consistent with the connectivity and topological structure of the original shape (that is, the road raster data) as an ideal expression.
[0067] In one example, after converting the road raster data to vectors and simplifying the vectors, the turning points of the target road vector data are identified and matched based on the direction and angle, and the two matched turning points are connected to cut the main roads and branch roads of the target road vector data, thereby obtaining the main road patches and branch road vector patches.
[0068] In one example, the grid skeleton line of the road grid data is extracted based on the skeleton line extraction algorithm, and the grid skeleton line is iteratively searched by drawing on the idea of the refinement algorithm to generate the target vector skeleton line. However, when the road is complex and the amount of data is large, the efficiency of the algorithm will be significantly reduced, so the sliding window method is further combined in the iterative search algorithm to obtain the target vector skeleton line.
[0069] Step S106, performing an overlay analysis on the cut road surface data and the target vector skeleton line, and filtering the branch road raster data contained in the road raster data based on the overlay analysis result to obtain road filtering result data.
[0070] Among them, the overlay analysis results are used to determine the size information corresponding to each road segment in the road raster data. In one example, by overlaying the cut road surface data and the target vector skeleton line, the target vector skeleton line can be segmented to obtain the skeleton line segmentation points, thereby segmenting the target vector skeleton line into multiple vector skeleton lines, and the length information of each vector skeleton line can be used to determine the size information of each road segment, including width information and length information, and then the narrow branch roads in the road raster data are filtered according to the width information and length information to obtain the final filtering result data.
[0071] The branch road filtering method based on inflection point recognition and skeleton line extraction provided by the embodiment of the present invention uses inflection points to cut the main roads and branch roads in the road raster data, effectively realizing the precise separation of the main roads and branch roads; at the same time, the corresponding vector skeleton lines are obtained through an iterative search method based on the grid skeleton lines, so as to quickly and accurately calculate the size information corresponding to each section of the road, thereby selectively filtering the branch roads and better retaining the information of the main roads. Compared with the post-processing means provided by the prior art, the embodiment of the present invention can quickly and accurately eliminate branch roads and incomplete sections, and has a better anti-interference effect.
[0072] For ease of understanding, the embodiment of the present invention provides a specific implementation of a branch road filtering method based on inflection point recognition and skeleton line extraction.
[0073] After executing the aforementioned step S102, the road grid data may be preprocessed, including the following steps 1A to 1B:
[0074] Step 1A, removing noise spots contained in the road grid data, so as to perform small spot removal processing on the road grid data. The noise spots are spots whose area is smaller than a preset area threshold, and can also be called interference spots or fragmented spots.
[0075] In one example, a small spot removal algorithm is first executed to scan the road raster data using a four-connected or eight-connected method to delete fragmented spots in the road raster data caused by extraction errors. The fragmented spots are usually connected areas with the same pixel values.
[0076] Step 1B, performing erosion calculation and dilation calculation on the road raster data after removing the noise spots, so as to perform morphological opening operation on the road raster data and obtain optimized road raster data.
[0077] In one example, the morphological opening process first performs an erosion calculation, during which broken and narrow road surfaces are replaced by surrounding background pixels, thereby removing the extracted noise in the road raster data; then a dilation calculation is performed, which restores the road surface to its original size and smoothes the road boundaries to further remove holes in the road patch.
[0078] See also Figure 2 A comparison diagram before and after small spot removal and morphological opening operation is shown. The embodiment of the present invention comprehensively utilizes small spot removal processing and morphological opening operation processing to optimize the incomplete part of the road and eliminate the erroneously extracted interfering objects to obtain optimized road raster data.
[0079] For the aforementioned step S104, the embodiment of the present invention provides an implementation method for identifying the inflection points contained in the road grid data, and using the inflection points to cut the road grid data to obtain cut road surface data, including the following steps 2A to 2C:
[0080] Step 2A: convert the road raster data into initial road vector data, and smooth the jagged edges of the initial road vector data to obtain target road vector data.
[0081] In one example, the optimized road raster data is converted to vectors to facilitate the flexible calculation of road geometry. The converted test road vector data retains the pixel features of the road raster data, so the edges are jagged and need to be further executed by the vector simplification algorithm to smooth the jagged edges. In this process, the threshold of the vector simplification algorithm needs to be set according to the image resolution to ensure that the algorithm only removes the jagged edges of the vectors without over-simplification.
[0082] The vector simplification algorithm threshold s used in the embodiment of the present invention represents the distance between a point A and the line connecting the two adjacent points BC before and after it. Figure 3 The following is a schematic diagram of the principle of vector simplification threshold adaptation. The following is a method for implementing threshold adaptation: Draw a perpendicular line from vertex A to edge BC. If the sawtooth span is one pixel and the image resolution is r, then it can be known that If the aliasing span is two pixels, then Considering that the pixel length and width resolutions of some images are inconsistent, setting the threshold range to 0.9rr can make the algorithm smooth the jagged edges and minimize the impact on the width of the road.
[0083] In the specific implementation, for any point on the road boundary in the initial road vector data and its two adjacent points in front and behind, the distance between the point and the line connecting the two points in front and behind is determined. If the distance is less than the above threshold range, the point is eliminated, that is, the two adjacent points are directly connected to achieve smoothing of the jagged edge.
[0084] Step 2B, based on the vector angle algorithm, identify the inflection points contained in the target road vector data. In one example, after the vector simplification is completed, the inflection points are further extracted, and the inflection points at the connection between the main road and the branch road are identified using the vector angle algorithm. For details, please refer to the following steps 2B-1 to 2B-3:
[0085] Step 2B-1, for three road points continuously distributed clockwise on the road boundary in the target road vector data, construct a first road vector from the first road point to the second road point and a second road vector from the second road point to the third road point. In one example, traverse the points on the road boundary clockwise and identify the turning point. For example, see Figure 4 The schematic diagram of identifying turning points based on the vector angle algorithm is shown. For three points A, B, and C that are continuously distributed on the road boundary, where A is the first road point, B is the second road point, and C is the third road point, the first road vector is constructed. To the second road vector
[0086] Step 2B-2, determine the vector angle between the first road vector and the second road vector. Figure 4 , calculated from the first road vector To the second road vector The clockwise angle θ of , θ is also the vector angle.
[0087] Step 2B-3, if the vector angle is within the preset angle range, the second road point is regarded as the turning point between the main road and the branch road. In one example, when the vector angle θ is between 180° and 315°, it can be considered that the road boundary has a clear turning point at the second road point B, and the second road point B can be regarded as the turning point between the main road and the branch road.
[0088] Step 2C, matching the inflection points contained in the target road vector data, and using the two matched inflection points to cut the road raster data to obtain cut road surface data, that is, using the two matched inflection point connection lines to cut the main road and the branch road into different objects. For details, please refer to the following steps 2C-1 to 2C-2:
[0089] Step 2C-1, for each inflection point included in the target road vector data, the inflection point is taken as the center of the circle, the radius is determined based on the preset minimum road width threshold, and the buffer zone corresponding to the inflection point is constructed. Exemplarily, the minimum road width threshold r to be eliminated is input; after obtaining the inflection point, each inflection point k is searched, and other inflection points for pairing are found in the buffer zone with the point as the center and 1.2r as the radius.
[0090] Step 2C-2, searching for other inflection points for pairing in the buffer zone, the specific situations are as follows:
[0091] Case 1: If the buffer does not contain any other inflection points except the inflection point, the inflection point is removed. In one example, there are no other inflection points in the buffer: this indicates that point k is a separate false detection point, and point k is removed.
[0092] Case 2: If the buffer contains one other inflection point besides this inflection point, then the inflection point is determined to match the other inflection points. In one example, there is an inflection point l in the buffer: k and l may be inflection points on both sides of the branch road, respectively. Connect point k with point l, and cut the road grid data with their connecting line; if k and l are on the same side of the road, since their connecting line coincides with the road boundary, it will not affect the road surface.
[0093] Case 3: If the buffer contains multiple inflection points other than this inflection point, the distance between any two inflection points in the buffer is determined, and two inflection points with a matching relationship are determined based on the distance. In one example, there are two or more inflection points in the buffer: this situation is prone to occur in areas where roads are densely intertwined. The distances between all points, including the k point, are calculated, and the shortest multi-segment distances (preferably two or three segments) are selected, and the corresponding endpoints are connected. Finally, the road raster data is cut to obtain road vector data (i.e., cut road surface data) that separates the main road from the branch road.
[0094] The inflection point recognition algorithm developed in the embodiment of the present invention can realize the extraction of inflection points of most roads, see Figure 5 A schematic diagram of a road turning point extraction result is shown. After the turning points are extracted and matched, the road can be cut using their connecting lines.
[0095] This algorithm can separate the main roads and branch roads of the target road vector data to form independent vector patches. In practical applications, adjusting the input r size can eliminate roads of different widths.
[0096] For the aforementioned step S104, the embodiment of the present invention also provides an implementation method for extracting the grid skeleton line corresponding to the road raster data, and iteratively searching the grid skeleton line to obtain the target vector skeleton line: first, the grid skeleton line of the road raster data is extracted, and further converted into a vector form, that is, the target vector skeleton line. In this process, the vector skeleton line is generated by an iterative search algorithm. The iterative search uses the idea of the refinement algorithm to iteratively search the grid skeleton line, obtains the geographic coordinates corresponding to each pixel on the grid skeleton line, and then searches for adjacent pixels based on the initial pixel. If the adjacent pixel exists on the skeleton line, the geographic coordinates of the adjacent pixel are saved in a list, and the adjacent pixels of the next pixel are traversed according to this rule until there are no adjacent pixels around the next pixel on the skeleton line.
[0097] However, when the road is complex and the amount of data is large, the efficiency of the algorithm will decrease significantly. Therefore, the sliding window method is further combined in the iterative search algorithm to obtain Figure 6 The target vector skeleton line shown, Figure 6 It is a vector skeleton line extraction diagram. Figure 6 The left picture in the middle shows the grid skeleton absorption, and the right picture shows the vector skeleton line. For details, please refer to the following steps 3A to 3B:
[0098] Step 3A, obtain each pixel point contained in the grid skeleton line in the current sliding window, traverse each pixel point, and search for the neighboring pixel points corresponding to each pixel point and located on the grid skeleton line to generate the vector skeleton line in the current sliding window.
[0099] Please refer to steps 3A-1 to 3A-3 below for details:
[0100] Step 3A-1, establish a first list containing each pixel point, and establish an empty second list. In one example, set the sliding window size, obtain the coordinate point list L of the grid skeleton line pixel points in the sliding window, considering that the searched points in the point set will be deleted during the iterative search, so the table L will be copied to obtain a new list N to prevent the original list L from being destroyed, and the list N is also the first list; in addition, an empty list M is established, and the list M is also the second list.
[0101] Step 3A-2, based on the initial pixel, find the adjacent pixel. If the adjacent pixel exists on the skeleton line, save the geographic coordinates of the adjacent pixel in a list. Specifically including (1) to (3):
[0102] (1) Perform a multi-neighborhood search on the first pixel point in the first list. If there are multiple neighboring pixel points in the multi-neighborhood of the first pixel point in the first list, determine the skeleton line key points from the neighboring pixel points in the first list. The multi-neighborhood search may be an eight-neighborhood search, and the neighboring pixel points are also eight-neighborhood points. In one example, see Figure 7 A schematic diagram of an eight-neighborhood is shown, starting from the first point in the first list N, searching in the eight-neighborhood. The point is recorded as P and recorded in the second list M. The eight-neighborhood points are represented by Pi (1≤i≤8), and the search is performed in the direction of P1→P2→…→P8. When there are multiple points in the eight-neighborhood that exist in the first list N, take the first searched point Pi, which is the key point of the skeleton line, and record this point Pi as point Q.
[0103] (2) Record the skeleton key points into the second list and remove them from the first list to update the first list. In one example, point Q is recorded into the second list M and removed from the first list N.
[0104] (3) Continue to perform multi-neighborhood search on the skeleton line key point until there is no neighboring pixel point in the first list in the multi-neighborhood of the skeleton line key point.
[0105] In one example, with the skeleton key point Q as the center, the eight neighborhoods are searched in the same direction for points that exist in the first list N. If they exist, they are recorded in the second list M. When no points in the eight neighborhoods of the skeleton key point Q exist in the first list N, it indicates that the point is the end point of this path segment. It is further determined whether the eight neighborhood points of the skeleton key point Q exist in the table L. If so, it indicates that the point is an intersection point. The eight neighborhood points in the table L are recorded as points K and added to the second list M. The search for this path segment ends.
[0106] Step 3A-3, continue to perform multi-neighborhood search on the second pixel point in the updated first list until the first list is empty, and generate the vector skeleton line in the current sliding window based on the skeleton line key points in the second list. In one example, repeat the above step 3A-2, perform multi-neighborhood search on the second pixel point in the updated first list until the first list N is empty, and obtain the vector skeleton line in the current sliding window.
[0107] Step 3B, when the sliding window ends, determine the target vector skeleton line based on the vector skeleton lines in each sliding window. In one example, repeat step 3A to generate the vector skeleton line in the next sliding window, and the target vector skeleton line can be obtained when the sliding window ends.
[0108] The embodiment of the present invention adopts an iterative search method combined with a sliding window to extract the road vector skeleton line, and then overlays it with the cut road data to calculate the length and width of the cut road. Compared with the method without a sliding window, the iterative search method combined with a sliding window shows obvious efficiency advantages when processing complex roads and large-scale data. Since urban roads and rural roads are quite different in morphology, two different types of road extraction images of urban roads and rural roads are used for experimental comparison. The two test road images are as follows: Figure 8As shown, Figure 8 A schematic diagram of urban road extraction image and rural road extraction image.
[0109] As shown in Table 1, the efficiency table of vector skeleton line extraction by different methods shows that although urban roads are relatively complex, they are small in scope. The running time of the combined sliding window method is 40.19 seconds, while the non-sliding window method takes 95.51 seconds. For rural roads with a large data scale, the running time of the combined sliding window method is 111.72 seconds, and the non-sliding window method increases to 397.23 seconds, which is a significant increase in time. From the experiment, it can be seen that the efficiency of the combined sliding window method in vector skeleton line extraction is much better than that of the non-sliding window method.
[0110] Table 1
[0111]
[0112] For the aforementioned step S106, the embodiment of the present invention provides an implementation method of performing overlay analysis on the cut road surface data and the vector skeleton line, so as to filter the branch road raster data contained in the road raster data based on the overlay analysis result to obtain the road filtering result data, see the following steps 4A to 4B:
[0113] Step 4A, superimposes and analyzes the cut road surface data and the vector skeleton line, so as to segment the vector skeleton line using the cut road surface data; determines the length information of each segment of the vector skeleton line obtained by segmentation, so as to determine the size information corresponding to each road segment in the road raster data based on the length information. The size information may be an average width. In one example, the vector skeleton line is simplified using a vector simplification technique, and the cut road surface data and the vector skeleton line data are superimposed and analyzed to obtain the area and length of each road segment after segmentation, thereby obtaining the average width corresponding to each road segment.
[0114] The specific process is as follows: Fig. 9 The diagram of the overlay analysis of a vector skeleton line and cut road surface data shown in the figure uses the line connecting the curb turning points A and B to cut the road, and the road vector surface is cut at the AB line. At this time, the vector skeleton line can be split by using these two independent road surfaces and the vector skeleton line for overlay analysis, and the split point is point C in the figure. In this process, each road surface will correspond to an independent vector skeleton line, and the vector analysis algorithm is further used to obtain the length of each skeleton line, which is the approximate length of each road section. The average width of each road section can be obtained by dividing the road area by the length of the vector skeleton line.
[0115] In this process, in order to obtain more accurate road length and width data, this algorithm first obtains the latitude and longitude (latitude, longitude) of the upper left corner of the image, and determines its belt number in the Gauss-Krüger three-dimensional belt projection according to (longitude-1.5) / 3+1, and then calculates the road length and width under the corresponding three-dimensional belt projection. The Gauss-Krüger three-dimensional belt projection has no angle deformation, no deformation of the central meridian, and very little deformation in length and area. The road length and width calculated under this projection are also closer to the actual data.
[0116] Step 4B, according to the size information corresponding to each road segment in the road raster data, the branch road raster data contained in the road raster data is filtered to obtain road filtering result data. In one example, a width threshold and a length threshold can be pre-configured to remove roads smaller than the width threshold and / or smaller than the length threshold as branch roads.
[0117] Road filtering effect comparison Fig.10 and Fig.11 As shown, Fig.10 It is the result of filtering the urban road extraction image, including the original road extraction result, the road image after opening operation and the road image processed by this method. On the urban road image, the algorithm can accurately segment the main road and branch road, and filter the branch road below the set length or width. Fig.11 This is the result of filtering the road extraction image in a rural area, including the original road extraction result, the road image after opening operation, and the road image processed by this method. Rural roads are more winding than urban roads. This method also has a good filtering effect on rural roads and can effectively eliminate small roads and incomplete road sections.
[0118] from Fig.10 and Fig.11 The comparison between this method and the common morphological opening operation also shows that although the common morphological method can remove narrow roads, the threshold of the corrosion algorithm cannot be adjusted adaptively according to the road morphology, which often leads to excessive removal of main roads. In contrast, this method can customize the length and width of the road and filter the roads according to the specified length and width thresholds. It is more flexible and has better filtering effects.
[0119] The embodiment of the present invention can calculate and process the road raster image according to the specified length or width to obtain the road section that meets the length and width requirements. A processing flow of "road extraction results-morphological processing-road inflection point extraction and centerline extraction-road cutting-length and width calculation-result output" has been developed, focusing on using inflection points to cut the main roads and branch roads, effectively realizing the precise separation of the main and branch roads. At the same time, based on the grid skeleton line, the vector skeleton line of the road is obtained through an iterative search method, and the length and width of the road are calculated quickly and accurately, so that the branch roads are selectively filtered according to the length and width of the road, and the information of the main roads is better retained, realizing the full process of remote sensing image road branch filtering processing.
[0120] Further, the embodiments of the present invention provide Fig.12 The overall flow chart of a branch road filtering method based on inflection point recognition and skeleton line extraction shown in the figure includes: optimizing road grid data, including two processes of removing small spots and morphological opening operation; obtaining road surface data (i.e. the aforementioned segmented road surface data), including processes such as road grid to vector, vector simplification, inflection point recognition and road cutting; and obtaining road skeleton line data (i.e. the aforementioned target vector skeleton line), including processes such as road grid skeleton line extraction, obtaining vector skeleton lines based on iterative search algorithm, vector simplification, etc.; folding analysis of road surface and skeleton line; calculating the length and width of the road surface; filtering roads according to the length and width.
[0121] In summary, in order to overcome the shortcomings of the prior art, an embodiment of the present invention proposes a branch road filtering method based on inflection point recognition and skeleton line extraction, which mainly performs post-processing on the extraction results based on road extraction using a convolutional neural network or other methods. The present invention uses inflection points to cut the main roads and branch roads, effectively realizing the precise separation of the main and branch roads. At the same time, based on the grid skeleton line, the vector skeleton line of the road is obtained through an iterative search method, and the length and width of the road are quickly and accurately calculated, so that the branch roads are selectively filtered according to the length and width of the road, and the information of the main roads is better retained. In addition, the comprehensive use of small spot removal algorithms and morphological opening operations can optimize the incomplete parts of the road and eliminate interfering objects that are mistakenly extracted. This method can quickly and accurately eliminate branch roads and incomplete sections, and has a good anti-interference effect.
[0122] Based on the above-mentioned embodiments, the present invention provides a branch road filtering device based on inflection point recognition and skeleton line extraction, see Fig.13 The schematic diagram of the structure of a branch road filtering device based on inflection point recognition and skeleton line extraction is shown, and the device mainly includes the following parts:
[0123] The data acquisition module 1302 is used to acquire the road grid data to be processed;
[0124] The inflection point identification and skeleton line extraction module 1304 is used to identify the inflection points contained in the road raster data, and use the inflection points to cut the road raster data to obtain cut road surface data; and extract the grid skeleton lines corresponding to the road raster data, and iteratively search the grid skeleton lines to obtain the target vector skeleton lines; wherein the cut road surface data includes the main road spots and the branch road vector spots;
[0125] The branch road filtering module 1306 is used to perform overlay analysis on the cut road surface data and the target vector skeleton line, so as to filter the branch road raster data contained in the road raster data based on the overlay analysis result to obtain road filtering result data; wherein the overlay analysis result is used to determine the size information corresponding to each road segment in the road raster data.
[0126] The branch road filtering device based on inflection point recognition and skeleton line extraction provided by the embodiment of the present invention uses inflection points to cut the main roads and branch roads in the road raster data, effectively realizing the precise separation of the main roads and branch roads; at the same time, the corresponding vector skeleton lines are obtained through an iterative search method based on the grid skeleton lines, so as to quickly and accurately calculate the size information corresponding to each section of the road, thereby selectively filtering the branch roads and better retaining the information of the main roads. Compared with the post-processing means provided by the prior art, the embodiment of the present invention can quickly and accurately eliminate branch roads and incomplete sections, and has a better anti-interference effect.
[0127] In one embodiment, the inflection point identification and skeleton line extraction module 1304 is further used to:
[0128] Convert the road raster data into initial road vector data, and smooth the jagged edges of the initial road vector data to obtain target road vector data;
[0129] Based on the vector angle algorithm, identify the turning points contained in the target road vector data;
[0130] The inflection points contained in the target road vector data are matched, so as to cut the road raster data using the two matched inflection points to obtain cut road surface data.
[0131] In one embodiment, the inflection point identification and skeleton line extraction module 1304 is further used to:
[0132] For three road points continuously distributed clockwise on the road boundary in the target road vector data, respectively construct a first road vector pointing from the first road point to the second road point and a second road vector pointing from the second road point to the first road point;
[0133] determining a vector angle between the first road vector and the second road vector;
[0134] If the vector angle is within the preset angle range, the second road point is used as the turning point between the main road and the branch road.
[0135] In one embodiment, the inflection point identification and skeleton line extraction module 1304 is further used to:
[0136] For each inflection point included in the target road vector data, the radius is determined based on a preset minimum road width threshold with the inflection point as the center of the circle, and a buffer zone corresponding to the inflection point is constructed;
[0137] If the buffer does not contain any other inflection points except this inflection point, then this inflection point is removed;
[0138] If the buffer contains one other inflection point except the inflection point, it is determined that the inflection point matches the other inflection points;
[0139] If the buffer contains multiple inflection points other than the inflection point, the distance between any two inflection points in the buffer is determined, and two inflection points having a matching relationship are determined based on the distance.
[0140] In one embodiment, the inflection point identification and skeleton line extraction module 1304 is further used to:
[0141] Obtain each pixel point contained in the grid skeleton line in the current sliding window, traverse each pixel point, and search for the neighboring pixel points corresponding to each pixel point and located on the grid skeleton line to generate the vector skeleton line in the current sliding window;
[0142] When the sliding window ends, the target vector skeleton line is determined based on the vector skeleton lines in each sliding window.
[0143] In one embodiment, the inflection point identification and skeleton line extraction module 1304 is further used to:
[0144] Create a first list containing each pixel point, and create an empty second list;
[0145] Perform a multi-neighborhood search on the first pixel point in the first list; if there are multiple neighboring pixel points in the multi-neighborhood of the first pixel point that exist in the first list, determine the skeleton line key point from the neighboring pixel points in the first list; record the skeleton line key point in the second list and remove it from the first list to update the first list; continue to perform a multi-neighborhood search on the skeleton line key point until there is no neighboring pixel point in the first list in the multi-neighborhood of the skeleton line key point;
[0146] Continue to perform multi-neighborhood search on the second pixel point in the updated first list until the first list is empty, and then generate a vector skeleton line in the current sliding window based on the skeleton line key points in the second list.
[0147] In one implementation, the branch trunk filtering module 1306 is further configured to:
[0148] Performing overlay analysis on the cut road surface data and the vector skeleton line, so as to segment the vector skeleton line by using the cut road surface data;
[0149] Determine the length information of each segment of the vector skeleton line obtained by segmentation, so as to determine the size information corresponding to each segment of the road in the road raster data based on the length information;
[0150] According to the size information corresponding to each road segment in the road raster data, the branch road raster data contained in the road raster data is filtered to obtain the road filtering result data.
[0151] In one embodiment, a pre-processing module is further included, which is used to:
[0152] The noise spots contained in the road raster data are removed to realize the small spot removal processing on the road raster data; wherein the noise spots are spots whose area is smaller than a preset area threshold;
[0153] The road raster data after the noise spots are removed is subjected to erosion calculation and expansion calculation to realize morphological opening operation on the road raster data and obtain the optimized road raster data.
[0154] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0155] An embodiment of the present invention provides an electronic device. Specifically, the electronic device includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes the method described in any one of the above-mentioned implementation methods.
[0156] Fig.14 A structural diagram of an electronic device provided in an embodiment of the present invention, the electronic device 100 includes: a processor 140, a memory 141, a bus 142 and a communication interface 143, wherein the processor 140, the communication interface 143 and the memory 141 are connected via the bus 142; the processor 140 is used to execute an executable module stored in the memory 141, such as a computer program.
[0157] The memory 141 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 143 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0158] The bus 142 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.14 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0159] Among them, the memory 141 is used to store programs, and the processor 140 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any of the embodiments of the present invention can be applied to the processor 140 or implemented by the processor 140.
[0160] The processor 140 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 140. The above processor 140 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 141, and the processor 140 reads the information in the memory 141 and completes the steps of the above method in combination with its hardware.
[0161] The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be referred to the previous method embodiments, which will not be repeated here.
[0162] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0163] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes 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, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A branch road filtering method based on inflection point recognition and skeleton line extraction, characterized in that: include: Obtain road raster data to be processed; Identify the inflection points contained in the road raster data, and use the inflection points to cut the road raster data to obtain cut road surface data; and extract the grid skeleton lines corresponding to the road raster data, and iteratively search the grid skeleton lines to obtain target vector skeleton lines; wherein the cut road surface data includes main road patches and branch road vector patches; Performing an overlay analysis on the cut road surface data and the target vector skeleton line, so as to filter the branch road raster data contained in the road raster data based on the overlay analysis result to obtain road filtering result data; wherein the overlay analysis result is used to determine the size information corresponding to each road segment in the road raster data; The step of identifying the inflection points included in the road raster data and using the inflection points to cut the road raster data to obtain cut road surface data comprises: converting the road raster data into initial road vector data and smoothing the jagged edges of the initial road vector data to obtain target road vector data; identifying the inflection points included in the target road vector data based on a vector angle algorithm; matching the inflection points included in the target road vector data to cut the road raster data using the two matched inflection points to obtain cut road surface data; The step of identifying the turning point included in the target road vector data based on the vector angle algorithm includes: for three road points continuously distributed on the road boundary in the target road vector data, constructing a first road vector pointing from the first road point to the second road point and a second road vector pointing from the second road point to the third road point respectively; determining the vector angle between the first road vector and the second road vector; if the vector angle is within a preset angle range, taking the second road point as the turning point between the main road and the branch road; The step of matching the inflection points included in the target road vector data comprises: for each inflection point included in the target road vector data, taking the inflection point as the center of a circle, determining the radius based on a preset minimum road width threshold, and constructing a buffer zone corresponding to the inflection point; if the buffer zone does not contain any other inflection points except the inflection point, then removing the inflection point; if the buffer zone contains one other inflection point except the inflection point, then determining that the inflection point matches the other inflection points; if the buffer zone contains multiple other inflection points except the inflection point, then determining the distance between any two inflection points in the buffer zone, and determining two inflection points that have a matching relationship based on the distance; The step of iteratively searching the grid skeleton line to obtain the target vector skeleton line includes: obtaining each pixel point contained in the grid skeleton line in the current sliding window, traversing each pixel point, searching for the neighboring pixel points corresponding to each pixel point and located on the grid skeleton line to generate the vector skeleton line in the current sliding window; when the sliding window ends, determining the target vector skeleton line based on the vector skeleton lines in each sliding window; The step of traversing each of the pixel points and searching for the neighboring pixel points corresponding to each of the pixel points and located on the grid skeleton line to generate the vector skeleton line in the current sliding window includes: establishing a first list containing each of the pixel points, and establishing an empty second list; performing a multi-neighborhood search on the first pixel point in the first list; if there are multiple neighboring pixel points in the multi-neighborhood of the first pixel point that exist in the first list, determining the skeleton line key points from the neighboring pixel points in the first list; recording the skeleton line key points in the second list and removing them from the first list to update the first list; continuing to perform a multi-neighborhood search on the skeleton line key points until there are no neighboring pixel points in the first list in the multi-neighborhood of the skeleton line key points; continuing to perform a multi-neighborhood search on the second pixel point in the updated first list until the first list is empty, and generating the vector skeleton line in the current sliding window based on the skeleton line key points in the second list; The step of performing an overlay analysis on the cut road surface data and the vector skeleton line to filter the branch road raster data contained in the road raster data based on the overlay analysis result to obtain road filtering result data comprises: performing an overlay analysis on the cut road surface data and the vector skeleton line to segment the vector skeleton line using the cut road surface data; determining the length information of each segment of the vector skeleton line obtained by segmentation to determine the size information corresponding to each segment of the road in the road raster data based on the length information; and filtering the branch road raster data contained in the road raster data according to the size information corresponding to each segment of the road in the road raster data to obtain road filtering result data.
2. The branch road filtering method based on inflection point recognition and skeleton line extraction according to claim 1 is characterized in that: After the step of obtaining the road grid data to be processed, the method further comprises: The noise spots contained in the road grid data are removed to perform small spot removal processing on the road grid data; wherein the noise spots are spots whose area is smaller than a preset area threshold; Erosion calculation and expansion calculation are performed on the road grid data after the noise spots are removed, so as to perform morphological opening operation on the road grid data and obtain optimized road grid data.
3. A branch road filtering device based on inflection point recognition and skeleton line extraction, characterized in that: The branch road filtering method based on inflection point recognition and skeleton line extraction according to any one of claims 1 to 2 comprises: A data acquisition module, used to acquire road raster data to be processed; The inflection point recognition and skeleton line extraction module is used to identify the inflection points contained in the road raster data, and use the inflection points to cut the road raster data to obtain cut road surface data; and extract the grid skeleton lines corresponding to the road raster data, and iteratively search the grid skeleton lines to obtain target vector skeleton lines; wherein the cut road surface data includes main road patches and branch road vector patches; A branch road filtering module is used to perform overlay analysis on the cut road surface data and the target vector skeleton line, so as to filter the branch road raster data contained in the road raster data based on the overlay analysis result to obtain road filtering result data; wherein the overlay analysis result is used to determine the size information corresponding to each road segment in the road raster data.
4. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 2.