Road network extraction methods, apparatus, electronic devices and computer-readable storage media

By constructing and classifying raster maps of vehicle trajectory data, vector maps of intersections and roads are generated, solving the efficiency and accuracy problems of traditional road network extraction methods and achieving fast and efficient road network data updates.

CN121051183BActive Publication Date: 2026-03-13QINGDAO INST OF SURVEYING & MAPPING SURVEY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Traditional road network extraction methods rely on manual annotation, which is costly and inaccurate. Rule-based algorithms are difficult to adapt to large-scale and dynamic road condition changes, resulting in low efficiency and non-real-time road network data extraction.

Method used

An initial raster map is constructed by acquiring vehicle trajectory data, pixel types are mapped and classified, intersection and road raster maps are generated, and road network vector maps are generated by merging cross information, reducing manual intervention and updating in real time.

Benefits of technology

It enables fast, efficient, and real-time accurate extraction of road network data, improving the efficiency and accuracy of road network construction and reflecting changes in road conditions in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121051183B_ABST
    Figure CN121051183B_ABST
Patent Text Reader

Abstract

This invention discloses a road network extraction method, apparatus, electronic device, and computer-readable storage medium, applied in the field of intelligent transportation technology, aiming to achieve faster, more efficient, and real-time accurate road network data extraction. The method includes: acquiring the driving trajectory data of a target vehicle to construct an initial raster map; mapping the driving trajectory data to the initial raster map to obtain a target raster map; for each foreground pixel in the target raster map, determining the pixel type of the foreground pixel based on its neighboring pixels; the pixel type includes node pixels and non-node pixels; generating a target intersection raster map based on each node pixel, and converting the target intersection raster map into an intersection vector map; generating a target road raster map based on each non-node pixel, and converting the target road raster map into a road vector map; merging the intersection vector map and the road vector map based on the intersection information of the intersection vector map and the road vector map to obtain a road network vector map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent transportation technology, and in particular to a road network extraction method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Currently, autonomous driving technology is developing rapidly at an unprecedented pace, and intelligent transportation systems are becoming increasingly widespread and gradually integrating into people's daily lives, bringing great convenience and transformation to travel. Behind these advanced technologies, accurate and complete road network data plays a crucial foundational role. Like the cornerstone of a skyscraper, it is the key to supporting the successful implementation of many application functions such as precise navigation of autonomous vehicles and efficient scheduling of intelligent transportation systems.

[0003] However, a review of traditional road network extraction methods reveals numerous limitations. On one hand, many traditional methods heavily rely on manual annotation, which incurs significant manpower and time costs. Furthermore, the manual annotation process is highly susceptible to subjective influences, making it difficult to guarantee the accuracy and consistency of the annotation results. On the other hand, while some rule-based algorithms can achieve road network extraction to a certain extent, their relatively fixed and inflexible rules make them ill-suited for the ever-growing volume of large-scale road network data and frequently changing traffic conditions, hindering their ability to adapt to complex and ever-changing real-world needs.

[0004] Therefore, how to achieve faster, more efficient, and more accurate real-time road network data extraction is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this invention is to provide a road network extraction method that can achieve faster, more efficient, and more accurate real-time road network data extraction. Another purpose of this invention is to provide a road network extraction device, electronic device, and computer-readable storage medium, all of which have the above-mentioned beneficial effects.

[0006] In a first aspect, the present invention discloses a road network extraction method, comprising:

[0007] Acquire the driving trajectory data of the target vehicle, and construct an initial grid map based on the driving trajectory data;

[0008] The driving trajectory data is mapped onto the initial raster image to obtain a target raster image; in the target raster image, the mapped pixels of the driving trajectory data are foreground pixels;

[0009] For each foreground pixel in the target raster image, the pixel type of the foreground pixel is determined based on the neighboring pixels of the foreground pixel; the pixel type includes node pixels and non-node pixels.

[0010] A target intersection raster map is generated based on the pixels of each node, and the target intersection raster map is converted into an intersection vector map;

[0011] A target road raster image is generated based on each of the non-node pixels, and the target road raster image is converted into a road vector map;

[0012] The intersection vector map and the road vector map are merged based on the intersection information to obtain a road network vector map.

[0013] Optionally, an initial raster map is constructed based on the driving trajectory data, including:

[0014] The driving trajectory data is mapped to the UTM coordinate system to obtain the driving trajectory coordinates;

[0015] Determine the maximum and minimum values ​​of the horizontal and vertical coordinates among all the stated driving trajectory coordinates;

[0016] The width of the initial raster image is calculated based on the maximum and minimum values ​​of the horizontal coordinates and the preset minimum precision.

[0017] The height of the initial raster image is calculated based on the maximum and minimum values ​​of the ordinate and the preset minimum precision.

[0018] The initial raster image is drawn based on the width, the height, and the preset minimum precision.

[0019] Optionally, mapping the driving trajectory data to the initial raster image to obtain the target raster image includes:

[0020] The coordinates of each driving trajectory are normalized based on the minimum value among the extreme values ​​of the horizontal coordinate, the minimum value among the extreme values ​​of the vertical coordinate, and the preset minimum precision to obtain the coordinates of each grid map;

[0021] The target raster image is obtained by mapping each of the raster image coordinates to the initial raster image.

[0022] Optionally, determining the pixel type of the foreground pixel based on the neighboring pixels of the foreground pixel includes:

[0023] Within a preset-size neighborhood of the foreground pixel, determine the number of pixels of other foreground pixels besides the current foreground pixel;

[0024] When the number of pixels does not exceed the preset number and is not zero, the current foreground pixel is determined to be the non-node pixel;

[0025] When the number of pixels exceeds the preset number, the current foreground pixel is determined to be the node pixel.

[0026] Optionally, before determining the pixel type of the foreground pixel based on its neighboring pixels in the target raster image for each foreground pixel, the method further includes:

[0027] The target raster image is eroded using a preset structuring element to obtain an eroded raster image;

[0028] Determine whether the number of foreground pixels in the eroded raster image is consistent with the number of foreground pixels in the target raster image;

[0029] If they are inconsistent, the eroded raster image is used as the new target raster image, and the process returns to the step of performing erosion operation on the target raster image using preset structuring elements to obtain the eroded raster image, until the number of foreground pixels in the eroded raster image is consistent with the number of foreground pixels in the target raster image, thus obtaining the eroded target raster image.

[0030] Optionally, generating a target intersection raster map based on the pixels of each node includes:

[0031] Construct an initial intersection raster map based on the initial raster map;

[0032] Each node pixel is mapped to the initial intersection raster image, and the node pixels are grouped and merged according to a preset connectivity rule to obtain a target intersection raster image containing one or more connected regions; each connected region in the target intersection raster image is an intersection region.

[0033] Optionally, the intersection vector map and the road vector map are merged based on the intersection information to obtain a road network vector map, including:

[0034] Connect the trajectory pixels corresponding to the node pixels in the intersection vector map to obtain one or more polygons;

[0035] Connect the trajectory pixels corresponding to the non-node pixels in the road vector map to obtain one or more line segments;

[0036] Determine the intersection positions of each polygon and each line segment, and statistically analyze the intersection information of each intersection position;

[0037] The intersection vector map and the road vector map are merged based on the intersection information to obtain the road network vector map.

[0038] Secondly, the present invention discloses a road network extraction device, comprising:

[0039] The construction module is used to acquire the driving trajectory data of the target vehicle and construct an initial raster map based on the driving trajectory data;

[0040] A mapping module is used to map the driving trajectory data to the initial raster image to obtain a target raster image; in the target raster image, the mapped pixels of the driving trajectory data are foreground pixels;

[0041] A determination module is used to determine the pixel type of each foreground pixel in the target raster image based on the neighboring pixels of the foreground pixel; the pixel type includes node pixels and non-node pixels;

[0042] The first conversion module is used to generate a target intersection raster map based on the pixels of each node, and convert the target intersection raster map into an intersection vector map;

[0043] The second conversion module is used to generate a target road raster image based on each of the non-node pixels, and convert the target road raster image into a road vector map;

[0044] The merging module is used to merge the intersection vector map and the road vector map based on the intersection information of the intersection vector map and the road vector map to obtain a road network vector map.

[0045] Thirdly, the present invention discloses an electronic device, comprising:

[0046] Memory, used to store computer programs;

[0047] A processor, configured to execute the computer program to implement the steps of any of the road network extraction methods described above.

[0048] Fourthly, the present invention discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the road network extraction methods described above.

[0049] This invention provides a road network extraction method, comprising: acquiring driving trajectory data of a target vehicle; constructing an initial raster map based on the driving trajectory data; mapping the driving trajectory data to the initial raster map to obtain a target raster map; in the target raster map, the mapped pixels of the driving trajectory data are foreground pixels; for each foreground pixel in the target raster map, determining the pixel type of the foreground pixel based on the neighboring pixels of the foreground pixel; the pixel type includes node pixels and non-node pixels; generating a target intersection raster map based on each node pixel, and converting the target intersection raster map into an intersection vector map; generating a target road raster map based on each non-node pixel, and converting the target road raster map into a road vector map; merging the intersection vector map and the road vector map based on the intersection information of the intersection vector map and the road vector map to obtain a road network vector map.

[0050] By applying the technical solution provided by this invention, the driving trajectory data of the target vehicle is acquired to construct an initial raster map. This driving trajectory data is then mapped onto the initial raster map to generate a target raster map. For each foreground pixel in the target raster map corresponding to the driving trajectory data, the roads and intersections traversed by the target vehicle can be divided according to their pixel type. Node pixels are used to generate the target intersection raster map, and non-node pixels are used to generate the target road raster map. Thus, the two raster maps can be merged based on the intersection and road intersection information (related information about the intersection positions) to obtain the final road network vector map, achieving road network data extraction. Clearly, this technical solution eliminates the need for cumbersome manual annotation, freeing it from manual dependence and significantly improving the efficiency and accuracy of road network construction. Furthermore, based on the continuous updating of vehicle driving trajectory data, the road network extraction results can be adaptively adjusted in real time, ensuring that the extracted results promptly reflect changes in real-world road conditions. Therefore, this technical solution achieves faster, more efficient, and more accurate real-time road network data extraction.

[0051] The road network extraction device, electronic device, and computer-readable storage medium provided by this invention also have the above-mentioned technical effects, and will not be described in detail here. Attached Figure Description

[0052] To more clearly illustrate the technical solutions in the prior art and the embodiments of the present invention, the accompanying drawings used in the description of the prior art and the embodiments of the present invention will be briefly introduced below. Of course, the accompanying drawings described below with respect to the embodiments of the present invention are only a part of the embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort, and such other drawings also fall within the protection scope of the present invention.

[0053] Figure 1This is a schematic flowchart of a road network extraction method provided in an embodiment of the present invention;

[0054] Figure 2 This is a flowchart illustrating another road network extraction method provided in an embodiment of the present invention;

[0055] Figure 3 This is a schematic diagram of the structure of a road network extraction device provided in an embodiment of the present invention;

[0056] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0057] The core of this invention is to provide a road network extraction method that can achieve faster, more efficient, and more accurate real-time road network data extraction. Another core aspect of this invention is to provide a road network extraction device, electronic device, and computer-readable storage medium, all of which have the aforementioned beneficial effects.

[0058] To provide a clearer and more complete description of the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be introduced below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0059] This invention provides a road network extraction method.

[0060] Please refer to Figure 1 , Figure 1 This is a schematic flowchart of a road network extraction method provided in an embodiment of the present invention. The road network extraction method may include, but is not limited to, the following S101~S106.

[0061] S101: Obtain the driving trajectory data of the target vehicle and construct an initial raster map based on the driving trajectory data.

[0062] This step aims to acquire the target vehicle's driving trajectory data and construct an initial raster map based on this data. This initial raster map refers to the original raster map without any pixel data. Specifically, during the target vehicle's journey, its own driving trajectory information can be acquired in real time and uploaded periodically or in real-time to the road network extraction system for road network data extraction. The road network extraction system can then aggregate all driving trajectory data of the target vehicle within a specific time range and extract the road network data through subsequent steps.

[0063] In one embodiment of the present invention, constructing an initial grid map based on driving trajectory data may include: mapping the driving trajectory data to a UTM coordinate system to obtain driving trajectory coordinates; determining the maximum and minimum values ​​of the horizontal and vertical coordinates among all driving trajectory coordinates; calculating the width of the initial grid map based on the maximum and minimum values ​​of the horizontal coordinates and a preset minimum precision; calculating the height of the initial grid map based on the maximum and minimum values ​​of the vertical coordinates and a preset minimum precision; and drawing the initial grid map based on the width, height, and preset minimum precision.

[0064] This invention provides a method for constructing an initial raster map based on the driving trajectory data of a target vehicle. First, to facilitate subsequent data processing and calculation, the driving trajectory data can be mapped from its initial coordinate system (latitude and longitude coordinate system) to the UTM coordinate system (Universal Transverse Mercator, a globally standardized planar coordinate system), obtaining UTM coordinates, i.e., driving trajectory coordinates. This coordinate transformation ensures that all driving trajectory data uses a unified coordinate system in subsequent analysis, processing, and road network extraction operations, avoiding errors and processing difficulties caused by coordinate inconsistencies, and laying the foundation for accurate road network structure construction. Further, the maximum and minimum values ​​of the horizontal and vertical coordinates are selected from all driving trajectory coordinates, i.e., the maximum and minimum values ​​of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate. These values ​​are then combined with a preset minimum precision to calculate the width and height of the initial raster map, thus determining the size of the initial raster map. This allows the initial raster map to be constructed. The preset minimum precision can be understood as the unit grid size of the initial raster map. Through big data analysis and numerous simulation experiments, considering various factors that may affect the results, it can be determined that when its value is 35, it can effectively balance data processing volume and computational efficiency while meeting the calculation accuracy requirements, ensuring the efficiency and accuracy of the entire structured road network extraction process. Furthermore, the initial raster map width = (maximum x-axis value - minimum x-axis value) / preset minimum precision; the initial raster map height = (maximum y-axis value - minimum y-axis value) / preset minimum precision.

[0065] S102: Map the driving trajectory data to the initial raster image to obtain the target raster image; in the target raster image, the mapped pixels of the driving trajectory data are foreground pixels.

[0066] This step aims to map the target vehicle's driving trajectory data onto the initial raster image to obtain the target raster image. In other words, it determines the coordinate data corresponding to the driving trajectory data in the initial raster image and marks it in the initial raster image. At this time, the raster image pixels corresponding to each marked coordinate (the mapped pixels of the driving trajectory data) are the foreground pixels, and the unmarked raster image pixels are the background pixels.

[0067] In one embodiment of the present invention, mapping driving trajectory data to an initial grid map to obtain a target grid map may include: normalizing the coordinates of each driving trajectory according to the minimum value among the extreme values ​​of the horizontal coordinate, the minimum value among the extreme values ​​of the vertical coordinate, and a preset minimum precision to obtain the coordinates of each grid map; and mapping each grid map coordinate to the initial grid map to obtain the target grid map.

[0068] This invention provides a method for mapping driving trajectory data to an initial raster image. This can be achieved by normalizing the coordinates of each driving trajectory. Specifically, the x-coordinate of the raster image coordinate is calculated as (x-coordinate of driving trajectory coordinate - minimum x-coordinate) / preset minimum precision; the y-coordinate of the raster image coordinate is calculated as (y-coordinate of driving trajectory coordinate - minimum y-coordinate) / preset minimum precision. It is understood that through the above normalization operation, the driving trajectory coordinates are converted into raster image coordinates, which accurately correspond to positions on the raster image. In practical applications, the default color of the initial raster image is white. When mapping each raster image coordinate to the initial raster image, each raster image coordinate can be marked in black to indicate that these positions are valid points, while other positions remain white. This yields the target raster image.

[0069] Furthermore, after mapping each raster coordinate to the initial raster to obtain the target raster, the process can further include: performing an outward dilation operation on the target raster based on a preset number of pixels to obtain a dilated target raster. It should be noted that this dilation operation can be considered a preprocessing step on the target raster, increasing the number of edge pixels to ensure more accurate and complete subsequent statistical analysis, providing a more robust data foundation for subsequent raster-based image processing operations. In one possible implementation, the preset number of pixels can be set to 2, meaning the target raster is dilated outward by two pixels.

[0070] S103: For each foreground pixel in the target raster image, determine the pixel type of the foreground pixel based on the neighboring pixels of the foreground pixel; the pixel type includes node pixels and non-node pixels.

[0071] This step aims to determine the pixel type of the foreground pixel. Specifically, it can be determined by referring to the neighboring pixels of the foreground pixel's location. The neighboring pixels refer to all pixels within the area adjacent to the current foreground pixel. The size of the neighboring area can be customized according to the actual situation, such as a 3×3 neighborhood (i.e., a 9-grid). Among them, the pixel type includes node pixels and non-node pixels. As described later, node pixels are used to generate intersection raster maps, and non-node pixels are used to generate road raster maps (S104 and S105).

[0072] In one embodiment of the present invention, determining the pixel type of a foreground pixel based on the neighborhood pixels of the foreground pixel may include: determining the number of pixels of other foreground pixels besides the current foreground pixel within a preset size neighborhood of the foreground pixel; determining the current foreground pixel as a non-node pixel when the number of pixels does not exceed a preset number and is not zero; and determining the current foreground pixel as a node pixel when the number of pixels exceeds the preset number.

[0073] This invention provides a method for determining the pixel type of a foreground pixel based on the neighboring pixels of the foreground pixel. First, for any target foreground pixel (current foreground pixel), a neighborhood region of the target foreground pixel, i.e., a preset-size neighborhood, is determined; then, the number of pixels of other foreground pixels besides the target foreground pixel within the preset-size neighborhood is counted, and the pixel type of the target foreground pixel is determined based on the number of pixels. Taking a 3×3 neighborhood as an example, the number of black pixels in the 8 surrounding pixels within the 9-grid containing a black pixel (target foreground pixel) is counted, and the black pixel is classified according to the statistical results: (1) If the number of black pixels in the 8 surrounding pixels is 0, the black pixel is judged as an isolated pixel, which is usually image noise or irrelevant tiny details, and does not make a substantial contribution to the topology and network analysis; (2) If the number of black pixels in the 8 surrounding pixels is less than or equal to 2 (preset number) and not 0, it means that the black pixel is in a non-critical position in the image structure, at the edge of the line or a relatively smooth part, and does not have the characteristics of becoming a node, and is classified as a non-node pixel; (3) If the number of black pixels in the 8 surrounding pixels is greater than 2, it means that there are many black pixels connected to the black pixel, which are very likely to be the connection point or branch point of different lines or structures, and are classified as node pixels, which are crucial for describing the topology of the image.

[0074] Furthermore, to ensure accuracy, the above pixel type identification operation can be performed only on background pixels in the target raster image, excluding edge background pixels. In other words, boundary background pixels may not be included in the analysis due to the incompleteness of their neighborhood information, as analyzing them may lead to incorrect judgment results.

[0075] Furthermore, before determining the pixel type of a foreground pixel based on its neighboring pixels for each foreground pixel in the target raster image, the process may further include: performing an erosion operation on the target raster image using a preset structuring element to obtain an eroded raster image; determining whether the number of foreground pixels in the eroded raster image is consistent with the number of foreground pixels in the target raster image; if they are inconsistent, using the eroded raster image as a new target raster image, and returning to the step of performing an erosion operation on the target raster image using a preset structuring element to obtain an eroded raster image, until the number of foreground pixels in the eroded raster image is consistent with the number of foreground pixels in the target raster image, thus obtaining the eroded target raster image.

[0076] This invention provides a raster image thinning scheme, aiming to extract key structural information from a target raster image through further processing, thereby providing a higher-quality data foundation for subsequent road network extraction and analysis. Specifically, the target raster image can be processed using erosion operations and iterative processing methods in the field of image processing to obtain a thinned target raster image, namely the target raster image after the aforementioned erosion processing. It is understood that erosion is a classic image processing technique based on image morphology. It gradually reduces the number of foreground pixels in the image by traversing each pixel in the image with a structuring element and updating pixel values ​​according to predefined rules. The selection of the structuring element is crucial in this process, directly affecting the effect of the erosion operation and the final thinning result. The working principle of the structuring element in the erosion operation is as follows: when the structuring element covers a certain area of ​​the image, the center pixel is retained as a foreground pixel only when all foreground pixels within the structuring element are completely covered; otherwise, it is set as a background pixel (white pixel).

[0077] For example, suppose the current target raster image is a 5×5 image (where 1 represents a foreground pixel and 0 represents a background pixel):

[0078] ;

[0079] The default structural pixel is a 3×3 square structural element:

[0080] ;

[0081] When using the aforementioned 3×3 square structuring element to perform an erosion operation starting from the top left corner of the target raster image, the 3×3 neighborhood of the top left pixel (located in the first row and first column) is:

[0082] ;

[0083] At this point, since all pixels in the neighborhood are foreground pixels, the center pixel (the pixel in the first row and first column) will be retained as a foreground pixel.

[0084] However, for the pixel in the second row and second column, its 3×3 neighborhood is:

[0085] ;

[0086] At this point, since not all pixels in the neighborhood are foreground pixels, the center pixel (the pixel in the second row and second column) will be set as a background pixel.

[0087] In this way, the structuring element slides across the target raster image in each iteration, achieving an erosion effect. Each iteration updates pixel information according to the rules of the erosion operation. The termination condition of the iteration is crucial for the thinning operation. Through multiple experiments, it has been determined that after each iteration, the number of foreground pixels in the image is counted. If the number of foreground pixels no longer changes after several consecutive iterations, the thinning operation is considered to have stabilized.

[0088] It is understandable that the above-mentioned thinning process based on erosion operation has the following important significance: (1) Noise removal: The thinning operation can effectively remove noise that may exist in the image. Isolated single or several foreground pixels will be set as background pixels during the traversal of the structuring element because their surroundings do not meet the coverage conditions of the structuring element, thereby achieving the purpose of noise removal; (2) Object separation: The thinning operation helps to separate different objects and avoid their adhesion. The erosion operation will gradually erode the pixels of the connected parts, making the target object clearer and more distinguishable; (3) Preservation of main structural features: Although the number of foreground pixels gradually decreases, the thinning operation can preserve the main structural features of the target object, which provides great convenience for subsequent further analysis and helps to extract the required road network information more accurately.

[0089] S104: Generate a target intersection raster map based on the pixels of each node, and convert the target intersection raster map into an intersection vector map.

[0090] S105: Generate a target road raster map based on each non-node pixel, and convert the target road raster map into a road vector map.

[0091] The above steps aim to generate intersection maps and road maps based on different types of foreground pixels. As mentioned above, node pixels are used to generate intersection raster maps, and non-node pixels are used to generate road raster maps. Based on this, coordinate system transformations are performed on both to obtain the corresponding vector maps, namely intersection vector maps and road vector maps.

[0092] The process of generating a target intersection raster map based on each node pixel can include: constructing an initial intersection raster map based on an initial raster map; mapping each node pixel to the initial intersection raster map, and grouping and merging the node pixels according to a preset connectivity rule to obtain a target intersection raster map containing one or more connected regions; each connected region in the target intersection raster map is an intersection region. Correspondingly, the process of generating a target road raster map based on each non-node pixel can include: constructing an initial road raster map based on an initial raster map; mapping each non-node pixel to the initial road raster map, and grouping and merging the non-node pixels according to a preset connectivity rule to obtain a target road raster map containing one or more connected regions; each connected region in the target road raster map is a road region.

[0093] It should be noted that the initial raster image, initial intersection raster image, and initial road raster image are essentially the same; they are all raw raster images without any pixel data filling. Constructing the initial intersection raster image and initial road raster image based on the initial raster image aims to ensure that the three raster images have the same size. Furthermore, by using appropriate types of pixel filling and pixel grouping and merging processing, the target intersection raster image and target road raster image can be generated. The grouping and merging processing of foreground pixels can be implemented by referring to pre-selected connectivity rules, such as 4-connectivity or 8-connectivity. For 4-connectivity, a pixel is connected only to the pixels above, below, to the left, and to the right; for 8-connectivity, a pixel is connected to all eight pixels around it.

[0094] For an intersection raster image: Starting from a black pixel (node ​​pixel) in the image, use a depth-first search (DFS) or breadth-first search (BFS) algorithm, based on the selected connectivity rule, to find other connected node pixels. For example, when using 8-connectivity, starting from a black pixel, search its 8 neighboring pixels. If neighboring pixels are also black, they are considered connected and marked as the same group. Then, by continuously expanding the search range, all connected node pixels can be marked as the same group, forming a complete connected region, which represents an intersection. Repeat this operation for all node pixels in the intersection raster image to complete the merging of the intersection connected regions.

[0095] For road raster maps: a similar approach is used, starting from a black pixel (non-node pixel) in the image, searching and marking connected non-node pixels using DFS or BFS algorithms. Then, by continuously expanding the search range, all connected non-node pixels can be marked as the same group, forming a complete connected region, thus completing the merging operation of connected road portions in the road raster map. Each connected region can be considered as part of a road, and different connected regions represent different road segments.

[0096] Furthermore, converting a target intersection raster image into an intersection vector map can include: sequentially performing reverse normalization on each node pixel in the target intersection raster image, mapping from the UTM coordinate system to the latitude and longitude coordinate system, and converting from the latitude and longitude coordinate system to vector graphics to obtain the intersection vector map. Correspondingly, converting a target road raster image into a road vector map can include: sequentially performing reverse normalization on each non-node pixel in the target road raster image, mapping from the UTM coordinate system to the latitude and longitude coordinate system, and converting from the latitude and longitude coordinate system to vector graphics to obtain the road vector map. In other words, the raster image to vector map reconstruction is achieved through reverse operations.

[0097] S106: Merge the intersection vector map and the road vector map based on the intersection information to obtain the road network vector map.

[0098] This step aims to generate a road network vector map based on intersection vector maps and road vector maps. Specifically, it involves merging the intersection vector maps and road vector maps based on their intersection information to obtain the road network vector map.

[0099] In one embodiment of the present invention, merging the intersection vector map and the road vector map based on the intersection information to obtain a road network vector map may include: connecting the trajectory pixels corresponding to node pixels in the intersection vector map to obtain one or more polygons; connecting the trajectory pixels corresponding to non-node pixels in the road vector map to obtain one or more line segments; determining the intersection positions of each polygon and each line segment, and statistically analyzing the intersection information at each intersection position; and merging the intersection vector map and the road vector map based on the intersection information to obtain a road network vector map.

[0100] Specifically, for intersection areas, the boundary pixels of the converted latitude and longitude coordinates (corresponding to the trajectory pixels of each node pixel) can be connected sequentially to form closed polygons. Each polygon represents the geographical area of ​​an intersection, containing the spatial information of the intersection. For road areas, the pixels on the road (corresponding to the trajectory pixels of each non-node pixel) can be connected sequentially to form continuous line segments, which reflect the direction and length of the road, facilitating subsequent topological analysis and determination of connection relationships. Further, the intersection positions of each polygon and each line segment are determined. This process can be achieved through geometric relationships, such as calculating the equations of straight lines, solving for intersection points, and determining the relative positional relationships between line segments and edges. Then, the intersection information at each intersection position is statistically analyzed, such as the connection position, connection method, and connection direction of the intersection and road. Based on this information, the intersection vector map and the road vector map can be merged to obtain the final road network vector map.

[0101] Therefore, by performing intersection determination and recording cross-information on the vector representations of all intersections and roads, a complete road network structure is finally obtained, including the location, direction, and connection relationship of roads, as well as the location of intersections and their connection with roads, forming a complete geographic information network. This completes the entire process from image processing to road network construction, combining the results of image processing with geographic information processing to generate a road network with a complete topological structure and geographic information.

[0102] As can be seen, the road network extraction method provided in this embodiment of the invention acquires the driving trajectory data of the target vehicle to construct an initial raster map, and maps the driving trajectory data onto the initial raster map to generate a target raster map. For each foreground pixel in the target raster map corresponding to the driving trajectory data, the roads and intersections traveled by the target vehicle can be divided according to their pixel type. Node pixels are used to generate the target intersection raster map, and non-node pixels are used to generate the target road raster map. Thus, the two raster maps can be merged based on the intersection and road intersection information (related information about the intersection positions of intersections and roads) to obtain the final road network vector map, achieving road network data extraction. Clearly, this technical solution eliminates the need for cumbersome manual annotation, freeing it from manual dependence and significantly improving the efficiency and accuracy of road network construction. Furthermore, based on the continuous updating of vehicle driving trajectory data, the road network extraction results can be adaptively adjusted in real time to ensure that the road network extraction results reflect real-time changes in road conditions. Therefore, this technical solution achieves faster, more efficient, and more accurate real-time road network data extraction.

[0103] For example, an embodiment of the present invention provides a road network extraction method.

[0104] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating another road network extraction method provided in an embodiment of the present invention. The specific implementation process includes the following steps.

[0105] I. Loading and coordinate transformation of driving trajectory data.

[0106] 1. Data Loading: The system receives uploaded driving trajectory information from the vehicle. This information includes the vehicle's unique ID, timestamp, and latitude / longitude data. The unique ID accurately identifies the vehicle, the timestamp clearly records the vehicle's location at different times, and the latitude / longitude data reflects the vehicle's geographical location. After receiving this trajectory information, the system merges vehicle trajectories within a specific time period. This merge operation aims to aggregate all trajectory points belonging to the same vehicle within a specific time range, forming a complete trajectory set to provide continuous trajectory data for subsequent processing.

[0107] 2. Coordinate Transformation: To facilitate subsequent unified processing and calculation, the merged formal trajectory data will undergo coordinate transformation. Specifically, the original formal trajectory data can be converted from its initial coordinate system to UTM coordinates. For example, the EPSG:4326 coordinate system can be used for transformation. This coordinate transformation ensures that all formal trajectory data uses a unified coordinate system in subsequent analysis, processing, and road network extraction operations, avoiding errors and processing difficulties caused by coordinate inconsistencies, and laying the foundation for accurate road network structure construction.

[0108] II. Generation and Coordinate Processing of Raster Maps

[0109] This step mainly involves extracting key information from the UTM coordinates of the formal trajectory information and generating a raster map of the road network data.

[0110] First, all UTM coordinates contained in the driving trajectory file are traversed. During this process, the maximum and minimum values ​​of the coordinates (maximum xmax, maximum ymax, minimum xmin, minimum ymin) are identified. These maximum and minimum values ​​provide the boundary range for subsequent raster map construction. Second, an important parameter, the minimum processing precision (pix_metrix), is introduced. Then, based on the extracted maximum and minimum values ​​and the minimum processing precision, the raster map dimensions are calculated. The raster map width is calculated as: width = (xmax - xmin) / pix_metrix, and the raster map height is calculated as: height = (ymax - ymin) / pix_metrix. Initially, the default color of the raster map is white, which is the basic state for raster map construction.

[0111] Furthermore, after determining the raster size, the UTM coordinates are normalized: x0 = (x - xmin) / pix_metrix, y0 = (y - ymin) / pix_metrix. Through this normalization operation, the interface converts the original UTM coordinates (x, y) into new coordinates (x0, y0), which accurately correspond to their positions on the raster. These normalized coordinates are marked in black to indicate that these locations are valid points, while other locations remain white. This constitutes the raster of the road network data, denoted as img_grid.

[0112] Furthermore, to avoid insufficient edge pixel counts in step four, an outward dilation operation can be performed on the raster image after generation, for example, dilating it outward by 2 pixels. This dilation operation can be considered a preprocessing of the raster image, increasing the number of edge pixels to ensure more accurate and complete subsequent statistical analysis, providing a more robust data foundation for subsequent raster-based image processing operations.

[0113] III. Raster image refinement.

[0114] This step involves refining the raster image to further process the image and extract key structural information of target objects, providing a higher-quality data foundation for subsequent road network extraction and analysis. Specifically, erosion operations and iterative processing methods from the field of image processing can be used to process the raster image `img_grid`, resulting in a refined raster image `img_grid_thin`.

[0115] IV. Distinguishing between node pixels and non-node pixels.

[0116] This step aims to analyze the refined raster image img_grid_thin to accurately distinguish between node pixels and non-node pixels, laying the foundation for subsequent topology analysis, network structure construction, and other tasks.

[0117] Specifically, the raster image `img_grid_thin` stores pixel information in a two-dimensional matrix format with a `uint8` data type, following the conventional representation of binary images. Black pixels have a value of 0, and white pixels have a value of 255. For each internal pixel in the image, a 3×3 neighborhood (i.e., a 9-grid) centered on that pixel is selected as the analysis region to examine the pixels within that neighborhood in order to infer the characteristics of the current central pixel. Boundary pixels are not included in the analysis because their neighborhood information is incomplete, as analyzing them might introduce incorrect judgments. Therefore, for the internal black pixel, the number of black pixels in the 8 surrounding pixels within its 9-grid is counted, and the pixels are classified according to the statistical results: (1) If the number of black pixels in the 8 surrounding pixels is 0, the black pixel is judged as an isolated pixel, which is usually image noise or irrelevant small details, and does not make a substantial contribution to the topology and network analysis; (2) If the number of black pixels in the 8 surrounding pixels is less than or equal to 2 (preset number) and not 0, it means that the black pixel is in a non-critical position in the image structure, at the edge of the line or a relatively smooth part, and does not have the characteristics of becoming a node, and is classified as a non-node pixel; (3) If the number of black pixels in the 8 surrounding pixels is greater than 2, it means that there are many black pixels connected to the black pixel, which is very likely to be the connection point or branch point of different lines or structures, and is classified as a node pixel, which is crucial for describing the topology of the image.

[0118] V. Raster map segmentation and connected region merging operations.

[0119] This step mainly involves further processing the raster image img_grid_thin, dividing it into an intersection raster image img_skjn_grid and a road raster image img_skrv_grid, and merging the connected regions of each, in preparation for subsequent more in-depth image analysis and geographic information extraction.

[0120] First, the principle of raster image segmentation is as follows: Based on the distinction between node pixels and non-node pixels in step four, this information is applied to the segmentation of the raster image. For any pixel (x, y), if the pixel is classified as a node pixel in step four, the corresponding (x, y) position in img_skjn_grid is set to black (value 0), and the remaining positions are set to white (value 255), generating an intersection raster image; if the pixel is classified as a non-node pixel in step four, the corresponding (x, y) position in img_skrv_grid is set to black (value 0), and the remaining positions are set to white (value 255), generating a road raster image.

[0121] Furthermore, the principle behind connected region merging is that connectivity is divided into 4-connectivity and 8-connectivity. 4-connectivity means that a pixel is connected only to the pixels above, below, to the left, and to the right; 8-connectivity means that a pixel is connected to all eight pixels around it.

[0122] For an intersection raster image: Starting from a black pixel (node ​​pixel), a depth-first search (DFS) or breadth-first search (BFS) algorithm is used to find other connected node pixels based on the selected connectivity rules. For example, when using 8-connectivity, starting from a black pixel, the search searches for its 8 neighboring pixels. If the neighboring pixels are also black, they are considered connected and marked as the same group. Then, by continuously expanding the search range, all connected node pixels are marked as the same group, forming a complete connected region, which represents an intersection. This operation is repeated for all node pixels in the intersection raster image to complete the merging of the connected regions of the intersection.

[0123] For road raster maps, a similar approach is used: starting from a black pixel (a non-node pixel) in the image, connected non-node pixels are searched and marked using a Depth-First Search (DFS) or Breadth-First Search (BFS) algorithm. Then, by continuously expanding the search range, all connected non-node pixels are grouped together, forming a complete connected region, thus completing the merging operation of connected road portions in the road raster map. Each connected region can be considered a part of a road, and different connected regions represent different road segments.

[0124] VI. Raster map coordinate transformation, vector map generation, and cross-information judgment.

[0125] This step is the final step in the entire road network construction process, which involves a series of operations to transform the previously processed raster map information into complete road network information.

[0126] 1. Coordinate transformation.

[0127] First, a pixel-based reverse normalization operation is performed to convert the raster image, previously displayed in pixels, into a real geographic coordinate system. This requires defining the initial position (origin) of the raster image within the UTM coordinate system and the actual geographic distance (pixel resolution) represented by each pixel. Thus, for each pixel, its pixel coordinates can be converted to UTM coordinates through a linear relationship. This operation maps discrete pixel locations to a continuous UTM planar coordinate space, providing a foundation for subsequent geographic information processing.

[0128] Then, the UTM coordinates are converted into latitude and longitude coordinates. Since UTM coordinates are based on the planar projection of the Earth's ellipsoid, converting them to latitude and longitude involves complex geodetic transformations. Based on the projection transformation formula in geodesy, and according to the projection zone, central meridian, and parameters of the Earth's ellipsoid where the UTM coordinates are located, the UTM coordinates on the plane are restored to latitude and longitude coordinates on the Earth's surface, making the coordinates globally universal so that geographic information from different regions can be compatible and processed uniformly.

[0129] 2. Vector map generation.

[0130] The converted intersection raster image (img_skjn_grid) and road raster image (img_skrv_grid) are represented as vector graphics for more accurate geospatial analysis and topological relationship processing. Specifically, the boundary pixels of the converted latitude and longitude coordinates are sequentially connected to form closed polygons. Each polygon represents a geographic area of ​​an intersection, containing its spatial information. For road areas, the pixels on the road are sequentially connected to form continuous polylines, reflecting the road's direction and length, facilitating subsequent topological analysis and connection relationship determination.

[0131] 3. Judgment based on cross-information.

[0132] First, after representing intersections and roads as vector polygons and polylines, geometric relationships are used to determine whether they intersect. From a geometric perspective, intersection determination can be based on the topological and spatial relationships of geometric objects. For polygons (intersections) and polylines (roads), the intersection of the polygon's edges and polyline segments is determined by calculating the equations of the lines, solving for the intersection points, and judging the relative positional relationships between the line segments and edges, thus determining whether they overlap or intersect.

[0133] Furthermore, when intersection polygons and road polylines intersect, it indicates that they are geographically connected. Their connection information is recorded, including the connection location, connection method, and connection direction. This information constitutes an important part of the road network and is a key element in constructing a complete road network topology. For intersections and roads that do not intersect, they can be marked as isolated elements, including dead-end roads, independent road segments, or isolated intersections. This information is recorded to provide a basis for subsequent road network optimization, analysis, and maintenance.

[0134] Therefore, by performing intersection determination and recording cross-information on the vector representations of all intersections and roads, a complete road network structure is finally obtained, including the location, direction, and connection relationship of roads, as well as the location of intersections and their connection with roads, forming a complete geographic information network. This completes the entire process from image processing to road network construction, combining the results of image processing with geographic information processing to generate a road network with a complete topological structure and geographic information.

[0135] As can be seen, the road network extraction method provided in this embodiment of the invention has the following technical advantages: First, by introducing an image erosion algorithm and combining iterative processing with 3×3 square structural elements, the noise removal capability and the preservation effect of the main structural features after raster image refinement are significantly improved. Second, by intelligently distinguishing node pixels from non-node pixels through a 9-grid analysis method and merging connected regions using depth-first search or breadth-first search algorithms, the accuracy and completeness of road network extraction are greatly improved. Finally, in the process of converting the raster image into a standardized vector digital map, a complete road network topology structure is formed by judging the intersection of intersections and roads and recording intersection information. Therefore, the above technical solutions not only significantly reduce the manual cost of data processing but also significantly improve the efficiency and accuracy of road network construction, promoting technological progress and application practices in related fields such as intelligent transportation and vehicle navigation.

[0136] This invention provides a road network extraction device.

[0137] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a road network extraction device provided in an embodiment of the present invention. The road network extraction device may include:

[0138] Module 1 is used to acquire the driving trajectory data of the target vehicle and construct an initial raster map based on the driving trajectory data.

[0139] Mapping module 2 is used to map driving trajectory data to an initial raster image to obtain a target raster image; in the target raster image, the mapped pixels of the driving trajectory data are foreground pixels;

[0140] Module 3 is used to determine the pixel type of each foreground pixel in the target raster image based on the neighboring pixels of the foreground pixel; the pixel type includes node pixels and non-node pixels.

[0141] The first conversion module 4 is used to generate a target intersection raster map based on the pixels of each node, and convert the target intersection raster map into an intersection vector map;

[0142] The second conversion module 5 is used to generate a target road raster map based on each non-node pixel, and convert the target road raster map into a road vector map;

[0143] The merging module 6 is used to merge the intersection vector map and the road vector map based on the intersection information of the intersection vector map and the road vector map to obtain the road network vector map.

[0144] As can be seen, the road network extraction device provided in this embodiment of the invention acquires the driving trajectory data of the target vehicle to construct an initial raster map, and maps the driving trajectory data onto the initial raster map to generate a target raster map. For each foreground pixel in the target raster map corresponding to the driving trajectory data, the roads and intersections traveled by the target vehicle can be divided according to their pixel type. Node pixels are used to generate the target intersection raster map, and non-node pixels are used to generate the target road raster map. Thus, the two raster maps can be merged based on the intersection and road intersection information (related information about the intersection positions of intersections and roads) to obtain the final road network vector map, achieving road network data extraction. Clearly, this technical solution eliminates the need for cumbersome manual annotation, freeing it from manual dependence and significantly improving the efficiency and accuracy of road network construction. Furthermore, based on the continuous updating of vehicle driving trajectory data, the road network extraction results can be adaptively adjusted in real time to ensure that the road network extraction results reflect real-time changes in road conditions. Therefore, this technical solution achieves faster, more efficient, and more accurate real-time road network data extraction.

[0145] In one embodiment of the present invention, the above-mentioned construction module 1 can be specifically used to map driving trajectory data to the UTM coordinate system to obtain driving trajectory coordinates; determine the maximum and minimum values ​​of the horizontal coordinate and the vertical coordinate among all driving trajectory coordinates; calculate the width of the initial grid map based on the maximum and minimum values ​​of the horizontal coordinate and the preset minimum precision; calculate the height of the initial grid map based on the maximum and minimum values ​​of the vertical coordinate and the preset minimum precision; and draw the initial grid map based on the width, height, and preset minimum precision.

[0146] In one embodiment of the present invention, the mapping module 2 can be specifically used to normalize the coordinates of each driving trajectory according to the minimum value of the extreme values ​​of the horizontal coordinate, the minimum value of the extreme values ​​of the vertical coordinate, and the preset minimum precision to obtain the coordinates of each grid map; and to map each grid map coordinate onto the initial grid map to obtain the target grid map.

[0147] In one embodiment of the present invention, the determining module 3 may be specifically used to determine the number of pixels of other foreground pixels besides the current foreground pixel within a preset size neighborhood of the foreground pixel; when the number of pixels does not exceed the preset number and is not zero, the current foreground pixel is determined to be a non-node pixel; when the number of pixels exceeds the preset number, the current foreground pixel is determined to be a node pixel.

[0148] In one embodiment of the present invention, the road network extraction device may further include an erosion module, used to perform an erosion operation on the target raster image using a preset structuring element before determining the pixel type of the foreground pixel based on the neighboring pixels of the foreground pixel for each foreground pixel in the target raster image, to obtain an eroded raster image; determine whether the number of foreground pixels in the eroded raster image is consistent with the number of foreground pixels in the target raster image; if they are inconsistent, use the eroded raster image as a new target raster image, and return to the step of performing an erosion operation on the target raster image using the preset structuring element to obtain an eroded raster image, until the number of foreground pixels in the eroded raster image is consistent with the number of foreground pixels in the target raster image, to obtain the eroded target raster image.

[0149] In one embodiment of the present invention, the first conversion module 4 described above may be specifically used to construct an initial intersection grid map based on the initial grid map; map each node pixel to the initial intersection grid map, and group and merge each node pixel according to a preset connectivity rule to obtain a target intersection grid map containing one or more connected regions; each connected region in the target intersection grid map is an intersection region.

[0150] In one embodiment of the present invention, the merging module 6 can be specifically used to connect the trajectory pixels corresponding to node pixels in the intersection vector map to obtain one or more polygons; connect the trajectory pixels corresponding to non-node pixels in the road vector map to obtain one or more line segments; determine the intersection positions of each polygon and each line segment, and count the intersection information of each intersection position; and merge the intersection vector map and the road vector map according to the intersection information to obtain a road network vector map.

[0151] For a description of the apparatus provided in the embodiments of the present invention, please refer to the above method embodiments; the present invention will not be described in detail here.

[0152] This invention provides an electronic device.

[0153] Please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided by the present invention. The electronic device may include:

[0154] Memory 11 is used to store computer programs;

[0155] The processor 10 is used to execute computer programs to implement the steps of any of the road network extraction methods described above.

[0156] like Figure 4 The diagram shows the structural composition of an electronic device, which may include a processor 10, a memory 11, a communication interface 12, and a communication bus 13. The processor 10, memory 11, and communication interface 12 all communicate with each other through the communication bus 13.

[0157] In this embodiment of the invention, the processor 10 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic devices.

[0158] The processor 10 can call the program stored in the memory 11. Specifically, the processor 10 can execute the operations in the embodiments of the road network extraction method.

[0159] The memory 11 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment of the invention, the memory 11 stores at least a program for implementing the following functions:

[0160] Acquire the driving trajectory data of the target vehicle and construct an initial raster map based on the driving trajectory data; map the driving trajectory data to the initial raster map to obtain the target raster map; in the target raster map, the mapped pixels of the driving trajectory data are foreground pixels; for each foreground pixel in the target raster map, determine the pixel type of the foreground pixel based on the neighboring pixels of the foreground pixel; the pixel type includes node pixels and non-node pixels; generate a target intersection raster map based on each node pixel and convert the target intersection raster map into an intersection vector map; generate a target road raster map based on each non-node pixel and convert the target road raster map into a road vector map; merge the intersection vector map and the road vector map based on the intersection information of the intersection vector map and the road vector map to obtain a road network vector map.

[0161] In one possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.

[0162] In addition, memory 11 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.

[0163] Communication interface 12 can be an interface for the communication module, used to connect with other devices or systems.

[0164] Of course, it should be noted that, Figure 4 The structure shown does not constitute a limitation on the electronic device in the embodiments of the present invention. In practical applications, the electronic device may include more than Figure 4 More or fewer components as shown, or combinations of certain components.

[0165] This invention provides a computer-readable storage medium.

[0166] The computer-readable storage medium provided in this embodiment of the invention stores a computer program, which, when executed by a processor, can implement the steps of any of the road network extraction methods described above.

[0167] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0168] For a description of the computer-readable storage medium provided by the present invention, please refer to the above method embodiments; the present invention will not be described in detail here.

[0169] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0170] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0171] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0172] The technical solution provided by this invention has been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. It should be noted that those skilled in the art can make several improvements and modifications to this invention without departing from the principles of this invention, and these improvements and modifications also fall within the protection scope of this invention.

Claims

1. A road network extraction method, characterized in that, include: Acquire the driving trajectory data of the target vehicle, and construct an initial grid map based on the driving trajectory data; The driving trajectory data is mapped onto the initial raster image to obtain the target raster image; In the target raster image, the mapped pixels of the driving trajectory data are foreground pixels; For each foreground pixel in the target raster image, the pixel type of the foreground pixel is determined based on its neighboring pixels; the pixel type includes node pixels and non-node pixels. A target intersection raster map is generated based on the pixels of each node, and the target intersection raster map is converted into an intersection vector map; A target road raster image is generated based on each of the non-node pixels, and the target road raster image is converted into a road vector map; The intersection vector map and the road vector map are merged based on the intersection information to obtain a road network vector map; Determining the pixel type of the foreground pixel based on its neighboring pixels includes: determining the number of pixels of other foreground pixels besides the current foreground pixel within a preset size neighborhood of the foreground pixel; when the number of pixels does not exceed a preset number and is not zero, determining the current foreground pixel as the non-node pixel; when the number of pixels exceeds the preset number, determining the current foreground pixel as the node pixel. Generating a target intersection raster map based on the pixel values ​​of each node includes: constructing an initial intersection raster map based on the initial raster map; mapping each pixel value of the node to the initial intersection raster map; and grouping and merging each pixel value of the node according to a preset connectivity rule to obtain a target intersection raster map containing one or more connected regions; each connected region in the target intersection raster map is an intersection region. Generating a target road raster map based on each of the non-node pixels includes: constructing an initial road raster map based on the initial raster map; mapping each of the non-node pixels to the initial road raster map, and grouping and merging each of the non-node pixels according to a preset connectivity rule to obtain a target road raster map containing one or more connected regions; each connected region in the target road raster map is a road region; The intersection vector map and the road vector map are merged based on their intersection information to obtain a road network vector map. This process includes: connecting the trajectory pixels corresponding to the node pixels in the intersection vector map to obtain one or more polygons; connecting the trajectory pixels corresponding to the non-node pixels in the road vector map to obtain one or more line segments; determining the intersection positions of each polygon and each line segment, and calculating the intersection information of each intersection position; and merging the intersection vector map and the road vector map based on the intersection information to obtain the road network vector map.

2. The road network extraction method according to claim 1, characterized in that, An initial raster map is constructed based on the driving trajectory data, including: The driving trajectory data is mapped to the UTM coordinate system to obtain the driving trajectory coordinates; Determine the maximum and minimum values ​​of the horizontal and vertical coordinates among all the stated driving trajectory coordinates; The width of the initial raster image is calculated based on the maximum and minimum values ​​of the horizontal coordinates and the preset minimum precision. The height of the initial raster image is calculated based on the maximum and minimum values ​​of the ordinate and the preset minimum precision. The initial raster image is drawn based on the width, the height, and the preset minimum precision.

3. The road network extraction method according to claim 2, characterized in that, Mapping the driving trajectory data to the initial raster image to obtain the target raster image includes: The coordinates of each driving trajectory are normalized based on the minimum value among the extreme values ​​of the horizontal coordinate, the minimum value among the extreme values ​​of the vertical coordinate, and the preset minimum precision to obtain the coordinates of each grid map; The target raster image is obtained by mapping each of the raster image coordinates to the initial raster image.

4. The road network extraction method according to any one of claims 1 to 3, characterized in that, Before determining the pixel type of each foreground pixel in the target raster image based on its neighboring pixels, the method further includes: The target raster image is eroded using a preset structuring element to obtain an eroded raster image; Determine whether the number of foreground pixels in the eroded raster image is consistent with the number of foreground pixels in the target raster image; If they are inconsistent, the eroded raster image is used as the new target raster image, and the process returns to the step of performing erosion operation on the target raster image using preset structuring elements to obtain the eroded raster image, until the number of foreground pixels in the eroded raster image is consistent with the number of foreground pixels in the target raster image, thus obtaining the eroded target raster image.

5. A road network extraction device, characterized in that, include: The construction module is used to acquire the driving trajectory data of the target vehicle and construct an initial raster map based on the driving trajectory data; The mapping module is used to map the driving trajectory data to the initial raster image to obtain the target raster image; In the target raster image, the mapped pixels of the driving trajectory data are foreground pixels; A determination module is used to determine the pixel type of each foreground pixel in the target raster image based on the neighboring pixels of the foreground pixel; The pixel types include node pixels and non-node pixels; The first conversion module is used to generate a target intersection raster map based on the pixels of each node, and convert the target intersection raster map into an intersection vector map; The second conversion module is used to generate a target road raster image based on each of the non-node pixels, and convert the target road raster image into a road vector map; The merging module is used to merge the intersection vector map and the road vector map based on the intersection information of the intersection vector map and the road vector map to obtain a road network vector map; The determining module is specifically used to determine the number of pixels of other foreground pixels besides the current foreground pixel within a preset size neighborhood of the foreground pixel; When the number of pixels does not exceed the preset number and is not zero, the current foreground pixel is determined to be the non-node pixel; when the number of pixels exceeds the preset number, the current foreground pixel is determined to be the node pixel. The first conversion module is specifically used to construct an initial intersection raster map based on the initial raster map; Each node pixel is mapped to the initial intersection raster image, and each node pixel is grouped and merged according to a preset connectivity rule to obtain a target intersection raster image containing one or more connected regions. Each connected region in the target intersection grid map is an intersection region; The second conversion module is specifically used to generate a target road raster map based on each of the non-node pixels, including: constructing an initial road raster map based on the initial raster map; mapping each of the non-node pixels to the initial road raster map, and grouping and merging each of the non-node pixels according to a preset connectivity rule to obtain a target road raster map containing one or more connected regions; each connected region in the target road raster map is a road region; The merging module is specifically used to connect the trajectory pixels corresponding to the node pixels in the intersection vector map to obtain one or more polygons; connect the trajectory pixels corresponding to the non-node pixels in the road vector map to obtain one or more line segments; determine the intersection positions of each polygon and each line segment, and count the intersection information of each intersection position; and merge the intersection vector map and the road vector map according to the intersection information to obtain the road network vector map.

6. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the road network extraction method as described in any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the road network extraction method as described in any one of claims 1 to 4.