Road center line information generation method and device, equipment, medium and program product
By filtering and adjusting road centerline information, the problem of distorted centerlines at T-junctions and crossroads was solved, and accurate generation of road centerlines was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE SHANGHAI ICT CO LTD
- Filing Date
- 2026-01-06
- Publication Date
- 2026-05-01
AI Technical Summary
Existing methods for determining road centerlines result in distortion of the road centerlines when extracting T-junctions or crossroads, making it impossible to accurately match the actual road direction.
By acquiring initial road centerline information, the center locations of roads that meet specific conditions are selected, a rasterized region is established, and the pixel values of the rasterized region are used to select the road reachable raster set. The connecting lines in the initial road centerline information are adjusted to obtain the target road centerline information.
It effectively avoids distortion of the road centerline, improves the accuracy of the road centerline, and conforms to the perception of the road centerline in real-world scenarios.
Smart Images

Figure CN121962358A_ABST
Abstract
Description
Devices, equipment, media, and program products for generating road centerline information Technical Field
[0001] This application relates to the field of surveying and mapping technology, and in particular to a method, apparatus, equipment, medium and program product for generating road centerline information. Background Technology
[0002] For applications in 3D modeling and 2D mapping, extracting road centerlines is an important type of geographic information data. Currently, the main approach is to "obtain road centerlines by using the midpoints of the two endpoints of the planar road vector information automatically extracted based on deep learning".
[0003] In the above methods, when extracting the center line of a T-junction or crossroads, because the center line is formed by directly connecting the midpoints of the endpoints of the road, the midpoint of the center line at the T-junction or crossroads may not match the actual direction of the road. T-junctions typically appear as a "Y" shape, and crossroads typically appear as a "..." shape. "shape.
[0004] In other words, existing methods for determining road centerlines are not accurate when extracting the centerlines of certain types of roads, such as T-junctions or crossroads, and distortion may occur. Summary of the Invention
[0005] This application provides a method, apparatus, device, medium, and program product for generating road centerline information, which can solve the problem that existing methods for determining road centerlines will result in distortion of the road centerline when applied to certain types of roads.
[0006] In a first aspect, embodiments of this application provide a method for generating road centerline information. The method includes: acquiring initial road centerline information in an area to be adjusted, wherein the initial road centerline information includes: road centerlines of all roads in the area to be adjusted; determining a first road center position among all road center positions included in the initial road centerline information based on at least three connecting lines associated with the road center positions in the initial road centerline information, wherein the road center position is the location where at least three road centerlines in the area to be adjusted intersect, and the at least three connecting lines associated with the road center position include: all road centerlines connected to the road center position. The first road center position is defined as the road center position of at least three associated connecting lines that satisfy the following condition: the included angle between two connecting lines is not within a first preset angle range; a first gridded region is established, the first gridded region including at least three connecting lines associated with the first road center position; based on the pixel value of each grid cell in the first gridded region, a road reachable grid set is selected from the first gridded region, the pixel value corresponding to each grid cell in the road reachable grid set is within a preset pixel range; based on the road reachable grid set, the at least three connecting lines associated with the first road center position in the initial road centerline information are updated to obtain the target road centerline information.
[0007] Optionally, the location of the first road center position is a T-junction in the area to be adjusted. The at least three connecting lines associated with the first road center position include a first connecting line and two second connecting lines. The first connecting line and the second connecting lines belong to different roads, while the two second connecting lines belong to the same road. The first road center position includes a first center point, which is the intersection of the at least three connecting lines associated with the first road center position. Updating the at least three connecting lines associated with the first road center position in the initial road centerline information based on the road reachability grid set to obtain the target road centerline information includes: determining a first location point in each of the two second connecting lines, resulting in two first location points, wherein the first location point... The first location point is a point located in the area corresponding to the T-junction, and the second connection line is a point other than the first center point. Based on the two first location points, a third connection line is determined, which connects the two first location points. Taking a point in the first grid as the starting point and a point in the second grid as the ending point, a fourth connection line with the shortest length is determined from the road reachable grid set. The first grid and the second grid are grids in the road reachable grid set. The first grid includes the first center point, and the second grid includes at least one point on the third connection line. The connection line associated with the first road center position in the initial road centerline information is updated to the first connection line, the third connection line, and the fourth connection line to obtain the target road centerline information.
[0008] Optionally, determining the shortest fourth connecting line from the set of road-reachable grids, starting from a point in the first grid and ending at a point in the second grid, includes: performing N grid filtering operations from the set of road-reachable grids to obtain N+1 grids, wherein the N+1 grids include the first grid and the N third grids obtained from the N grid filtering operations, and the i-th filtering operation in the N grid filtering operations includes: determining the (i+1)-th third grid from a plurality of adjacent grids adjacent to the i-th third grid, wherein the (i+1)-th third grid is one of the plurality of adjacent grids. The adjacent grid closest to the third connecting line, the angle between the connecting line between the center point of the (i+1)th third grid and the center point of the ith third grid and the first connecting line is less than a second preset angle. When i equals 1, the ith third grid is the first grid; when i equals N, the (i+1)th third grid is the second grid. Starting from the center point of the first grid and ending at the center point of the second grid, the center points of the N+1 grids are connected sequentially to obtain the fourth connecting line.
[0009] Optionally, the location of the first road center position is an intersection in the area to be adjusted. The at least three connecting lines associated with the first road center position include a fifth connecting line, two sixth connecting lines, and two seventh connecting lines. The two endpoints of the fifth connecting line are a second center point and a third center point, respectively. The two sixth connecting lines belong to the same road, and the two seventh connecting lines belong to another road. The second center point connects one of the sixth connecting lines and one of the seventh connecting lines, and the third center point connects the other sixth connecting line and the other seventh connecting line. The step of updating the at least three connecting lines associated with the first road center position in the initial road centerline information based on the road reachability grid set to obtain the target road centerline information includes: determining a fourth center point in the fifth connecting line, where the fourth center point is the midpoint of the fifth connecting line; and starting from a point in the fourth grid, dividing... Using the points in the fifth, sixth, seventh, and eighth grids as endpoints, determine the eighth, ninth, tenth, and eleventh connecting lines with the shortest lengths from the road reachable grid set, respectively. The fourth, fifth, sixth, seventh, and eighth grids are all grids in the road reachable grid set. The fourth grid includes the fourth center point, the fifth grid includes at least one point on one of the sixth connecting lines, the sixth grid includes at least one point on another sixth connecting line, the seventh grid includes at least one point on one of the seventh connecting lines, and the eighth grid includes at least one point on another seventh connecting line. Update the connecting lines associated with the first road center position in the initial road centerline information to the eighth, ninth, tenth, and eleventh connecting lines to obtain the target road centerline information.
[0010] Optionally, obtaining the initial road centerline information includes: obtaining the outline information of all roads in the area to be adjusted, the outline information including the set of outline points included by the outlines on both sides of the road; performing rasterization processing on the area to be adjusted to obtain a second rasterized area; determining the raster where the outline point of the outline on one side of the first road is located as the ninth raster, the first road being any one of all roads in the area to be adjusted; based on the ninth raster, determining a target outline point from the outline on the other side of the first road, the line connecting the target outline point and the outline point in the ninth raster being the line with the shortest length between the outline point in the ninth raster and the outline on the other side of the first road; determining the midpoint of the line connecting the outline point contained in the ninth raster and the corresponding target outline point as the first road center point corresponding to the first road; generating the initial road centerline information based on the set of first road center points, wherein the set of first road center points includes the first road center points corresponding to all roads in the area.
[0011] Optionally, determining the initial road centerline information based on the first set of road centerpoints corresponding to all roads in the area to be adjusted includes: connecting all the first road centerpoints in the first set of road centerpoints sequentially according to the actual road direction to obtain multiple connecting lines; identifying at least one abnormal connecting line group from the multiple connecting lines, wherein the abnormal connecting line group includes two connected abnormal connecting lines with an included angle greater than a third preset angle; identifying at least one abnormal center point corresponding one-to-one with the at least one abnormal connecting line group, wherein the abnormal center point is the endpoint of the corresponding abnormal connecting line along the road direction, and the abnormal connecting line is the line connecting two abnormal connecting lines in the corresponding abnormal connecting line group; removing the at least one abnormal center point from the first set of road centerpoints to obtain a second set of road centerpoints; and connecting all the road centerpoints in the second set of road centerpoints sequentially according to the actual road direction to obtain the initial road centerline information.
[0012] Secondly, embodiments of this application also provide a device for generating road centerline information. The device includes: a first acquisition module, configured to acquire initial road centerline information in an area to be adjusted, wherein the initial road centerline information includes: road centerlines of all roads in the area to be adjusted; and a first determination module, configured to determine a first road center position among all road center positions included in the initial road centerline information based on at least three connecting lines associated with the road center positions in the initial road centerline information, wherein the road center position is the location where at least three road centerlines in the area to be adjusted intersect, and the at least three connecting lines associated with the road center position include: all road centerlines connected to the road center position. A road center position is defined as follows: the road center position of at least three associated connecting lines satisfies the following condition: the included angle between two connecting lines is not within a first preset angle range; a first rasterization module is used to establish a first rasterization region, the first rasterization region including at least three connecting lines associated with the first road center position; a filtering module is used to filter a road reachable raster set from the first rasterization region based on the pixel value of each raster in the first rasterization region, the pixel value corresponding to each raster in the road reachable raster set being within a preset pixel range; an update module is used to update the at least three connecting lines associated with the first road center position in the initial road centerline information based on the road reachable raster set, to obtain target road centerline information.
[0013] Thirdly, embodiments of this application also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for generating road centerline information as described in the first aspect.
[0014] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for generating road centerline information as described in the first aspect.
[0015] Fifthly, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of the method for generating road centerline information as described in the first aspect.
[0016] In this embodiment, initial road centerline information in the area to be adjusted is obtained. This initial road centerline information includes the road centerlines of all roads in the area to be adjusted. Based on at least three connecting lines associated with the road center positions in the initial road centerline information, a first road center position is determined from all road center positions included in the initial road centerline information. The road center position is the location where at least three road centerlines in the area to be adjusted intersect. The at least three connecting lines associated with the road center position include all road centerlines connected to the road center position. The first road center position is: [the relevant...]. The road center position is defined by at least three connecting lines that satisfy the following conditions: the angle between two connecting lines is not within a first preset angle range; a first gridded region is established, which includes at least three connecting lines associated with the first road center position; based on the pixel value of each grid cell in the first gridded region, a road reachable grid set is selected from the first gridded region, where the pixel value of each grid cell in the road reachable grid set is within a preset pixel range; based on the road reachable grid set, the at least three connecting lines associated with the first road center position in the initial road centerline information are updated to obtain the target road centerline information. By checking whether at least three connecting lines associated with the center position of the road meet the condition that "the included angle between two connecting lines is not within the first preset angle range", at least three connecting lines associated with the center position of the first road in the initial road centerline information of the area to be adjusted need to be selected. Then, the pixel values of the rasterized grid are used to select the grid corresponding to the road to obtain the road reachable grid set. The at least three connecting lines (road center lines) associated with the center position of the first road are adjusted according to the road reachable grid set to obtain the correct road center line and avoid road center line distortion. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 is a flowchart illustrating the method for generating road centerline information according to an embodiment of this application; Figure 2 is a schematic diagram illustrating an area to be adjusted according to an embodiment of this application; Figure 3 is a schematic diagram illustrating the road center position and associated connecting lines of a traditional T-junction; Figure 4 is a schematic diagram illustrating the road center position and associated connecting lines of a T-junction adjusted by the method provided in an embodiment of this application; Figure 5 is a schematic diagram illustrating the road center position and associated connecting lines of a traditional crossroads; Figure 6 is a schematic diagram illustrating the road center position and associated connecting lines of a crossroads adjusted by the method provided in an embodiment of this application; Figure 7 is a structural diagram illustrating a device for generating road centerline information according to an embodiment of this application; Figure 8 is a structural diagram illustrating an electronic device according to an embodiment of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] This application provides a method for generating road centerline information.
[0021] Referring to Figure 1, the method for generating road centerline information provided in this application embodiment includes the following steps: Step 101, obtaining initial road centerline information in the area to be adjusted, wherein the initial road centerline information includes: the road centerlines of all roads in the area to be adjusted.
[0022] As shown in Figure 2, the area shown can be understood as a certain area on the map that needs to be adjusted. It includes lines of two colors: white lines, which represent the outlines of the two sides of the road, and black lines, which are the road centerlines obtained according to the traditional method of generating road centerlines.
[0023] Step 102: Based on at least three connecting lines associated with the road center position in the initial road centerline information, determine a first road center position among all road center positions included in the initial road centerline information. The road center position is the location where at least three road centerlines in the area to be adjusted intersect. The at least three connecting lines associated with the road center position include all road centerlines connected to the road center position. The first road center position is the road center position where the at least three associated connecting lines satisfy the following condition: the included angle between two connecting lines is not within a first preset angle range.
[0024] In this step, the road center position is the location where at least three road centerlines intersect, as shown in Figure 2. In real-world scenarios, the road center position can be the center point of a T-junction or a crossroads. The at least three connecting lines associated with the road center position are the road centerlines of the three roads corresponding to the T-junction (as shown in Figure 2, the area in the upper right corner is a T-junction, including three roads, one of which has a different direction from the other two, and the other two roads are parallel. It should be noted that in real-world scenarios, the two parallel roads may be named the same road or two different roads. In this application, for the sake of consistent understanding, "the two parallel roads" are defined as the same road, only including the two road centerlines).
[0025] After determining the center position of the road and at least three connecting lines, the center position of the first road can be further determined according to the first preset angle range. The first preset angle range can be (80°, 100°) and can be set from 90° towards both ends. The specific value can be adjusted according to the actual situation.
[0026] Figure 3 shows a schematic diagram of the road center position and its at least three associated connecting lines obtained according to a traditional method for generating road center lines. The road center position is point A at the center of a T-junction. The at least three associated connecting lines are AB, AC, and AD. The angles between AB and AC, and between AB and AD, are clearly obtuse, exceeding a first preset angle range. The angle between AD and AC is acute, also outside the first preset angle range. AB, AC, and AD form a Y-shape. In this case, the road center position is the first road center position. It is understandable that the road center line shown in Figure 3 differs from the perception of a road in real-world scenarios. In reality, the perception of the road center line at a T-junction should be as shown in Figure 4. Therefore, it is necessary to adjust this first road center position and its at least three associated connecting lines to make the road center line conform to actual perception.
[0027] Figure 5 shows a schematic diagram of the road center position and its at least three associated connecting lines obtained using another traditional method for generating road center lines. The corresponding actual road is a crossroads. The road center position is the center point of the crossroads (the midpoint of line EF). The at least three associated connecting lines are EF, EI, EJ, FH, and FG. The angles between EF and EI / EJ, and between EF and FH / FG, all exceed the first preset angle range, presenting two Y-shaped connections. In this case, the road center position is the first road center position. It is also understandable that the road center line shown in Figure 5 differs from the perception of roads in real-world scenarios. In real-world scenarios, the perception of the road center line at a crossroads should be as shown in Figure 6. Therefore, it is necessary to adjust this first road center position and its at least three associated connecting lines to make the road center line conform to actual perception.
[0028] Step 103: Establish a first gridded region, which includes at least three connecting lines associated with the center position of the first road.
[0029] The area of the center position of the first road and at least three associated connecting lines is rasterized to obtain the first rasterized area. Each grid can store relevant attributes (such as accessibility, height, obstacle occupancy, type label, etc.), which is helpful for determining the connectivity between two points, distance measurement, collision detection, line of sight determination, etc., and can be directly implemented on the grid array using a simple algorithm.
[0030] Step 104: Based on the pixel value of each grid cell in the first rasterized region, filter out the road reachable grid set from the first rasterized region, wherein the pixel value corresponding to each grid cell in the road reachable grid set is within a preset pixel range.
[0031] In this step, the grid is filtered by the pixel values of the grid in the first grid area. It can be understood that the actual road color is generally uniform and similar, and the pixels of the grid corresponding to the road will be within a certain pixel range, that is, the preset pixel range, so the grid that can reach the road is filtered out, which is equivalent to excluding the grid that does not correspond to the road.
[0032] Step 105: Based on the road reachability grid set, update at least three connecting lines associated with the center position of the first road in the initial road centerline information to obtain the target road centerline information.
[0033] Based on the road reachability grid set, at least three connecting lines associated with the center position of the first road are updated to ensure that the updated at least three connecting lines conform to the perception of the road centerline in the real scene, thus avoiding distortion. The information in the initial road centerline information that is associated with the above-mentioned modifications is updated to obtain the target road centerline information.
[0034] In the method for generating road centerline information provided in this application embodiment, at least three connecting lines associated with the first road centerline position that need to be adjusted are selected from the initial road centerline information of the area to be adjusted by checking whether the condition that "the included angle between two connecting lines is not within the first preset angle range" is met. Then, the pixel values of the rasterized grid are used to select the grid corresponding to the road to obtain a road reachable grid set. The at least three connecting lines (road centerlines) associated with the first road centerline position are adjusted according to the road reachable grid set to obtain the correct road centerline and avoid distortion of the road centerline.
[0035] Optionally, the location of the first road center position is a T-junction in the area to be adjusted. The at least three connecting lines associated with the first road center position include a first connecting line and two second connecting lines. The first connecting line and the second connecting lines belong to different roads, while the two second connecting lines belong to the same road. The first road center position includes a first center point, which is the intersection of the at least three connecting lines associated with the first road center position. Updating the at least three connecting lines associated with the first road center position in the initial road centerline information based on the road reachability grid set to obtain the target road centerline information includes: determining a first location point in each of the two second connecting lines, resulting in two first location points, wherein the first location point... The first location point is a point located in the area corresponding to the T-junction, and the second connection line is a point other than the first center point. Based on the two first location points, a third connection line is determined, which connects the two first location points. Taking a point in the first grid as the starting point and a point in the second grid as the ending point, a fourth connection line with the shortest length is determined from the road reachable grid set. The first grid and the second grid are grids in the road reachable grid set. The first grid includes the first center point, and the second grid includes at least one point on the third connection line. The connection line associated with the first road center position in the initial road centerline information is updated to the first connection line, the third connection line, and the fourth connection line to obtain the target road centerline information.
[0036] The first road center position in this embodiment is as shown in Figure 3. This embodiment will be described with reference to Figure 3: the first connecting line is AB, the two second connecting lines are AD and AC, and the first center point is A.
[0037] The two first position points are C and D. The first position point is a point on the second connecting line and is a turning point of the second connecting line. Taking point D as an example, the turning point means that the direction of AD is different from the road direction corresponding to the second connecting line, while the direction of the road center line extending upward from point D is the same as the corresponding road direction. Therefore, point D can be understood as the turning point between the two situations of the road center line direction "conforming to the actual road direction" and "not conforming to the actual road direction".
[0038] The third connecting line (as shown in Figure 4) is the connecting line obtained by connecting CD. It can be understood that the direction of the third connecting line is the same as the actual road direction corresponding to the second connecting line. After determining the third connecting line, the first grid cell containing the first center point is taken as the starting grid cell, and the second grid cell containing the point on the third connecting line is taken as the ending grid cell. The fourth connecting line with the minimum length between the first grid cell and the second grid cell is determined in the form of grid cells. The minimum length between the first grid cell and the second grid cell means the minimum Euclidean distance.
[0039] As shown in Figure 4, the fourth connecting line connects to the first connecting line to obtain AB in Figure 4, and the third connecting line is DC in Figure 4. The first connecting line, the third connecting line, and the fourth connecting line are determined as the connecting lines associated with the center position of the first road, and the corresponding information is updated in the initial road centerline information to obtain the target road centerline information.
[0040] In this embodiment, the shortest path from the first connecting line to the third connecting line is determined in the above manner, and this path is determined as the new road centerline. This is the same as the perception of T-shaped roads in real-world scenarios, and it addresses the problem of road centerline distortion.
[0041] Optionally, determining the shortest fourth connecting line from the set of road-reachable grids, starting from a point in the first grid and ending at a point in the second grid, includes: performing N grid filtering operations from the set of road-reachable grids to obtain N+1 grids, wherein the N+1 grids include the first grid and the N third grids obtained from the N grid filtering operations, and the i-th filtering operation in the N grid filtering operations includes: determining the (i+1)-th third grid from a plurality of adjacent grids adjacent to the i-th third grid, wherein the (i+1)-th third grid is one of the plurality of adjacent grids. The adjacent grid closest to the third connecting line, the angle between the connecting line between the center point of the (i+1)th third grid and the center point of the ith third grid and the first connecting line is less than a second preset angle. When i equals 1, the ith third grid is the first grid; when i equals N, the (i+1)th third grid is the second grid. Starting from the center point of the first grid and ending at the center point of the second grid, the center points of the N+1 grids are connected sequentially to obtain the fourth connecting line.
[0042] This embodiment can be understood as starting from the first grid cell and continuously searching for the third grid cell with the shortest distance in its neighborhood, eventually reaching the second grid cell. The path of the fourth connection line can be represented by the following formula: F = G + H; where F represents the estimated value of the fourth connection line. The smaller the value of F, the smaller the estimated value of the path of the fourth connection line, and the greater the probability that the fourth connection line is the shortest path. The calculation of G and H is as follows: G: represents the distance from a certain grid cell in the fourth connection line to the first grid cell. For example, the G corresponding to the i-th third grid cell is the sum of the distance from the i-th third grid cell to the (i-1)-th third grid cell and the distance from the (i-1)-th third grid cell to the first grid cell.
[0043] H: Represents the distance from a certain grid cell to the second grid cell in the fourth connection line, for example, the distance from the i-th third grid cell to the second grid cell. In this application, Euclidean distance can be used to calculate the distance from the i-th third grid cell to the second grid cell, ignoring existing obstacles.
[0044] It should be noted that selecting the grid with the smallest F value may not be in line with the actual situation. Therefore, the slope of the connecting line between the (i+1)th third grid and the ith third grid and the first connecting line is calculated (i.e., the angle between the connecting line between the center point of the (i+1)th third grid and the center point of the ith third grid and the first connecting line). Based on experience, if the slope deviation from the first connecting line exceeds 10° (the second preset angle), the point with the second smallest F value is selected, and the above calculation is repeated until the most suitable third grid is selected.
[0045] By calculating the fourth connecting line through finding neighborhoods after rasterization, the shortest distance algorithm naturally avoids obstacles and adapts to arbitrarily complex map structures because the influence of obstacles is eliminated in advance (using a road reachable raster set). Furthermore, the rasterized map structure is uniform and standardized, making it easy to determine adjacent cells, feasible directions, and costs. It eliminates the need for complex polygon vertices and adjacency management, making the code implementation intuitive and greatly simplifying spatial modeling and algorithm implementation, thus improving processing efficiency.
[0046] Optionally, the location of the first road center position is an intersection in the area to be adjusted. The at least three connecting lines associated with the first road center position include a fifth connecting line, two sixth connecting lines, and two seventh connecting lines. The two endpoints of the fifth connecting line are a second center point and a third center point, respectively. The two sixth connecting lines belong to the same road, and the two seventh connecting lines belong to another road. The second center point connects one of the sixth connecting lines and one of the seventh connecting lines, and the third center point connects the other sixth connecting line and the other seventh connecting line. The step of updating the at least three connecting lines associated with the first road center position in the initial road centerline information based on the road reachability grid set to obtain the target road centerline information includes: determining a fourth center point in the fifth connecting line, where the fourth center point is the midpoint of the fifth connecting line; and starting from a point in the fourth grid, dividing... Using the points in the fifth, sixth, seventh, and eighth grids as endpoints, determine the eighth, ninth, tenth, and eleventh connecting lines with the shortest lengths from the road reachable grid set, respectively. The fourth, fifth, sixth, seventh, and eighth grids are all grids in the road reachable grid set. The fourth grid includes the fourth center point, the fifth grid includes at least one point on one of the sixth connecting lines, the sixth grid includes at least one point on another sixth connecting line, the seventh grid includes at least one point on one of the seventh connecting lines, and the eighth grid includes at least one point on another seventh connecting line. Update the connecting lines associated with the first road center position in the initial road centerline information to the eighth, ninth, tenth, and eleventh connecting lines to obtain the target road centerline information.
[0047] In this embodiment, the focus is on the situation at the center of the first road of the intersection shown in Figure 5.
[0048] The fifth center line is EF, the two sixth connecting lines are EI and FH, the two seventh connecting lines are FG and EJ, the second center point is E, and the third center point is F.
[0049] The fourth center point is the midpoint of the fifth connecting line EF.
[0050] Starting from the fourth grid cell where the fourth center point is located, calculate the shortest connecting lines from the fourth grid cell to the grid cells containing the turning points of the two sixth connecting lines (the meaning of the turning points has been explained in the above embodiments and will not be repeated here), and from the fourth grid cell to the grid cells containing the turning points of the two seventh connecting lines (the seventh and eighth grid cells containing G and J). The method for calculating the shortest distance is the same as the method for finding adjacent grid cells in the above embodiment for T-junctions. Finally, the eighth, ninth, tenth, and eleventh connecting lines are obtained as shown in Figure 6. The above eighth, ninth, tenth, and eleventh connecting lines are used as connecting lines associated with the center position of the first road in the case of a crossroads, and the content of the initial road centerline information is updated to obtain the target road centerline information.
[0051] Optionally, obtaining the initial road centerline information includes: obtaining the outline information of all roads in the area to be adjusted, the outline information including the set of outline points included by the outlines on both sides of the road; performing rasterization processing on the area to be adjusted to obtain a second rasterized area; determining the raster where the outline point of the outline on one side of the first road is located as the ninth raster, the first road being any one of all roads in the area to be adjusted; based on the ninth raster, determining a target outline point from the outline on the other side of the first road, the line connecting the target outline point and the outline point in the ninth raster being the line with the shortest length between the outline point in the ninth raster and the outline on the other side of the first road; determining the midpoint of the line connecting the outline point contained in the ninth raster and the corresponding target outline point as the first road center point corresponding to the first road; generating the initial road centerline information based on the set of first road center points, wherein the set of first road center points includes the first road center points corresponding to all roads in the area.
[0052] In this embodiment, the method for obtaining the contour point set can be: 1. Converting the vector data of all roads in the area to be adjusted into raster data; 2. Distinguishing the pixel values of the converted raster data from the background; 3. Obtaining the set of pixel coordinates of the converted vector data. 4. Select a point in set P, construct a pixel grid centered on that point, and count the pixel values of all pixels in the grid except for that point. If a pixel value is a background pixel value, then that point is considered a boundary point. 5. Traverse set P and process all pixels in P according to step 4 to obtain the set of boundary points. 6. Convert all boundary points from raster to vector to obtain the road outline. 7. Calculate the inflection points in the road outline to obtain the set of road outline points.
[0053] After obtaining the set of contour points, based on the grid size of the second rasterized region, multiple ninth grids are selected from the grids containing the contour points of one side of the first road's contour line. For each ninth grid, a 3x3 grid is constructed with it as the center, and the Euclidean distance from the points in the 3x3 grid to the other end of the contour line is calculated. The point with the shortest distance is selected as the center point for the next calculation. If multiple points have the shortest distance, the distance to the previous center point is calculated, and the point with the smallest distance from the previous center point is selected as the center point for the next calculation. By calculating the minimum Euclidean distance from adjacent grids to the contour line on the other side of the first road, the target contour point is finally obtained. Further, the midpoint of the line connecting the ninth grid and the corresponding target contour point is determined as the road center point. Multiple first road center points can be determined based on multiple ninth grids. By performing the above processing on all roads, the first road center points corresponding to all roads in the area to be adjusted can be obtained, which is the set of first road center points.
[0054] After determining the set of center points of the first road, connect all the center points of the first road in sequence to obtain the road centerline.
[0055] In this embodiment, another point is determined by connecting the contour points on one side of the contour line to the shortest Euclidean distance on the other side of the contour line. Then, the road center point is determined based on the contour points on one side of the contour line and the calculated other point. Compared with the prior art, which calculates the center points of contour points on both sides of the road to obtain the road center point, this method avoids the situation where contour points on both sides of the road cannot correspond when the road extraction result is irregular, since the essence of contour points is the inflection point of the road contour line. This improves the accuracy of the determined road center point, which is equivalent to improving the accuracy of the road centerline.
[0056] Optionally, determining the initial road centerline information based on the first set of road centerpoints corresponding to all roads in the area to be adjusted includes: connecting all the first road centerpoints in the first set of road centerpoints sequentially according to the actual road direction to obtain multiple connecting lines; identifying at least one abnormal connecting line group from the multiple connecting lines, wherein the abnormal connecting line group includes two abnormal connecting lines that are connected and have an included angle greater than a third preset angle; identifying at least one abnormal center point corresponding to the at least one abnormal connecting line group, wherein the abnormal center point is the endpoint of the corresponding abnormal connecting line along the road direction, and the abnormal connecting line is the line connecting two abnormal connecting lines in the corresponding abnormal connecting line group; removing the at least one abnormal center point from the first set of road centerpoints to obtain a second set of road centerpoints; and connecting all the road centerpoints in the second set of road centerpoints sequentially according to the actual road direction to obtain the initial road centerline information.
[0057] In this embodiment, all the first road center points in the first road center point set are connected sequentially according to the road direction to obtain multiple connecting lines, and the included angle between two adjacent connecting lines is calculated (in this embodiment, since the slope and included angle are corresponding, the included angle can be represented by the slope).
[0058] The slope can be calculated by individually calculating the slope of each connecting line relative to the origin: ;in, These are the x-axis and y-axis coordinate parameters of the two center points of the connecting line, respectively.
[0059] By comparing the slopes of two adjacent connecting lines relative to the origin, the included angle between the connecting lines can be determined. If the included angle is greater than a third preset angle, the two connecting lines are identified as an abnormal connecting line group.
[0060] An abnormal connection group consists of two abnormal connection lines, each with a starting point, a transition point, and an ending point. Connecting the two abnormal connection lines forms an abnormal line. For each abnormal line, the ending point (abnormal center point) is deleted, leaving only one abnormal connection line in the abnormal connection group. The abnormal center point is also removed from the first set of road center points. Based on the above steps, all abnormal center points are removed, resulting in a second set of road center points. All road center points in the second set are then connected sequentially according to the actual road direction to obtain the initial road centerline information.
[0061] By using the method described in this embodiment, possible anomalies in the road centerline can be eliminated, thereby improving the accuracy of the road centerline.
[0062] Referring to Figure 7, Figure 7 is a structural diagram of a road centerline information generation device provided in an embodiment of this application. As shown in Figure 7, the device 700 includes: a first acquisition module 701, used to acquire initial road centerline information in an area to be adjusted, wherein the initial road centerline information includes: the road centerlines of all roads in the area to be adjusted; and a first determination module 702, used to determine a first road center position based on at least three connecting lines associated with the road center positions in the initial road centerline information, among all road center positions included in the initial road centerline information, wherein the road center position is the location where at least three road centerlines in the area to be adjusted intersect, and the at least three connecting lines associated with the road center position include: all road centerlines connected to the road center position, and the first road center position is: the associated... The road center position is defined by at least three connecting lines satisfying the following conditions: the included angle between two connecting lines is not within a first preset angle range; a first rasterization module 703 is used to establish a first rasterization region, the first rasterization region including at least three connecting lines associated with the first road center position; a filtering module 704 is used to filter out a road reachable raster set from the first rasterization region based on the pixel value of each raster in the first rasterization region, the pixel value corresponding to each raster in the road reachable raster set being within a preset pixel range; an update module 705 is used to update the at least three connecting lines associated with the first road center position in the initial road centerline information based on the road reachable raster set, to obtain the target road centerline information.
[0063] Optionally, the location of the first road center position is a T-junction in the area to be adjusted. The at least three connecting lines associated with the first road center position include a first connecting line and two second connecting lines. The first connecting line and the second connecting lines belong to different roads, while the two second connecting lines belong to the same road. The first road center position includes a first center point, which is the intersection of the at least three connecting lines associated with the first road center position. The update module 705 is further configured to: determine a first position point in each of the two second connecting lines, resulting in two first position points. The first position point is the point on the corresponding second connecting line located in the area corresponding to the T-junction. Furthermore, the first location point is a location point other than the first center point; based on the two first location points, a third connecting line is determined, which connects the two first location points; taking a point in the first grid as the starting point and a point in the second grid as the ending point, a fourth connecting line with the shortest length is determined from the road reachable grid set, where the first grid and the second grid are grids in the road reachable grid set, the first grid includes the first center point, and the second grid includes at least one point on the third connecting line; the connecting line associated with the first road center position in the initial road centerline information is updated to the first connecting line, the third connecting line, and the fourth connecting line to obtain the target road centerline information.
[0064] Optionally, the update module 705 is further configured to: perform N grid filtering operations from the road reachable grid set to obtain N+1 grids, wherein the N+1 grids include the first grid and the N third grids obtained from the N grid filtering operations, and the i-th filtering operation in the N grid filtering operations includes: determining the i+1-th third grid from a plurality of adjacent grids adjacent to the i-th third grid, wherein the i+1-th third grid is the adjacent grid closest to the third connecting line among the plurality of adjacent grids, and the angle between the connecting line between the center point of the i+1-th third grid and the center point of the i-th third grid and the first connecting line is less than a second preset angle; when i equals 1, the i-th third grid is the first grid, and when i equals N, the i+1-th third grid is the second grid; and connecting the center points of the N+1 grids sequentially with the center point of the first grid as the starting point and the center point of the second grid as the ending point to obtain the fourth connecting line.
[0065] Optionally, the location of the first road center position is an intersection in the area to be adjusted. The at least three connecting lines associated with the first road center position include a fifth connecting line, two sixth connecting lines, and two seventh connecting lines. The two endpoints of the fifth connecting line are a second center point and a third center point, respectively. The two sixth connecting lines belong to the same road, and the two seventh connecting lines belong to another road. The second center point connects one of the sixth connecting lines and one of the seventh connecting lines, and the third center point connects the other sixth connecting line and the other seventh connecting line. The update module 705 is further configured to: determine a fourth center point in the fifth connecting line, where the fourth center point is the midpoint of the fifth connecting line; and take a point in the fourth grid as the starting point, and points in the fifth, sixth, seventh, and eighth grids as the ending points, respectively. The eighth, ninth, tenth, and eleventh connecting lines with the shortest lengths are determined from the road reachability grid set. The fourth, fifth, sixth, seventh, and eighth grids are all grids in the road reachability grid set. The fourth grid includes the fourth center point, the fifth grid includes at least one point on one of the sixth connecting lines, the sixth grid includes at least one point on another sixth connecting line, the seventh grid includes at least one point on one of the seventh connecting lines, and the eighth grid includes at least one point on another seventh connecting line. The connecting lines associated with the first road center position in the initial road centerline information are updated to the eighth, ninth, tenth, and eleventh connecting lines to obtain the target road centerline information.
[0066] Optionally, the first acquisition module 701 is further configured to: acquire the contour line information of all roads in the area to be adjusted, the contour line information including the set of contour points included by the contour lines on both sides of the road; perform rasterization processing on the area to be adjusted to obtain a second rasterized area; determine the grid where the contour point of the contour line on one side of the first road is located as the ninth grid, the first road being any one of all roads in the area to be adjusted; based on the ninth grid, determine a target contour point from the contour line on the other side of the first road, the line connecting the target contour point and the contour point in the ninth grid being the line with the shortest length between the contour point in the ninth grid and the contour line on the other side of the first road; determine the midpoint of the line connecting the contour point contained in the ninth grid and the corresponding target contour point as the first road center point corresponding to the first road; and generate the initial road centerline information based on the set of first road center points, wherein the set of first road center points includes the first road center points corresponding to all roads in the area.
[0067] Optionally, the first acquisition module 701 is further configured to: connect all the first road center points in the first road center point set sequentially according to the actual road direction to obtain multiple connecting lines; determine at least one abnormal connecting line group among the multiple connecting lines, wherein the abnormal connecting line group includes two abnormal connecting lines that are connected and have an included angle greater than a third preset angle; determine at least one abnormal center point that corresponds one-to-one with the at least one abnormal connecting line group, wherein the abnormal center point is the endpoint of the corresponding abnormal connecting line along the road direction, and the abnormal connecting line is the line connecting two abnormal connecting lines in the corresponding abnormal connecting line group; remove the at least one abnormal center point from the first road center point set to obtain a second road center point set; and connect all the road center points in the second road center point set sequentially according to the actual road direction to obtain the initial road centerline information.
[0068] The road centerline information generation apparatus 700 provided in this application embodiment can be used to execute the steps of all embodiments of the method shown in FIG1, and therefore can achieve the same technical effect, which will not be described again here.
[0069] This application embodiment also provides an electronic device. Since the principle of the electronic device in solving the problem is similar to the method for generating road centerline information in this application embodiment, the implementation of this electronic device can refer to the implementation of the above-described method for generating road centerline information, and repeated details will not be elaborated further. As shown in Figure 8, the electronic device of this application embodiment includes: a processor 800, configured to read a program in a memory 820 and execute the following processes: obtaining initial road centerline information in an area to be adjusted, wherein the initial road centerline information includes: the road centerlines of all roads in the area to be adjusted; determining a first road center position among all road center positions included in the initial road centerline information based on at least three connecting lines associated with the road center positions in the initial road centerline information, wherein the road center position is the location where at least three road centerlines intersect in the area to be adjusted, and the at least three connecting lines associated with the road center position include: a first road center position connected to the road center position. There is a road centerline, and the first road center position is defined as the road center position where at least three associated connecting lines satisfy the following condition: the included angle between two connecting lines is not within a first preset angle range; a first gridded region is established, which includes at least three connecting lines associated with the first road center position; based on the pixel value of each grid cell in the first gridded region, a road reachable grid set is selected from the first gridded region, where the pixel value corresponding to each grid cell in the road reachable grid set is within a preset pixel range; based on the road reachable grid set, the at least three connecting lines associated with the first road center position in the initial road centerline information are updated to obtain the target road centerline information.
[0070] In Figure 8, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 800 and memory represented by memory 820. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides the interface. Processor 800 is responsible for managing the bus architecture and general processing, and memory 820 can store data used by processor 800 during operation.
[0071] Optionally, the location of the first road center position is a T-junction in the area to be adjusted. The at least three connecting lines associated with the first road center position include a first connecting line and two second connecting lines. The first connecting line and the second connecting lines belong to different roads, and the two second connecting lines belong to the same road. The first road center position includes a first center point, which is the intersection of the at least three connecting lines associated with the first road center position. The processor 800 is configured to read the program in the memory 820 and execute the following process: In each of the two second connecting lines, a first position point is determined, resulting in two first position points. The first position point is where the corresponding second connecting line is located at the T-junction. The points in the corresponding area, and the first location point is a location point other than the first center point; based on the two first location points, a third connecting line is determined, the third connecting line connecting the two first location points; taking the point in the first grid as the starting point and the point in the second grid as the ending point, a fourth connecting line with the shortest length is determined from the road reachable grid set, the first grid and the second grid are grids in the road reachable grid set, the first grid includes the first center point, and the second grid includes at least one point on the third connecting line; the connecting line associated with the first road center position in the initial road centerline information is updated to the first connecting line, the third connecting line and the fourth connecting line to obtain the target road centerline information.
[0072] Optionally, the processor 800 is configured to read a program from the memory 820 and execute the following process: performing N grid filtering operations from the road reachable grid set to obtain N+1 grids, wherein the N+1 grids include the first grid and N third grids obtained from the N grid filtering operations, and the i-th filtering operation in the N grid filtering operations includes: determining the i+1-th third grid from a plurality of adjacent grids adjacent to the i-th third grid, wherein the i+1-th third grid is the adjacent grid closest to the third connecting line among the plurality of adjacent grids, and the angle between the connecting line between the center point of the i+1-th third grid and the center point of the i-th third grid and the first connecting line is less than a second preset angle; when i equals 1, the i-th third grid is the first grid, and when i equals N, the i+1-th third grid is the second grid; and connecting the center points of the N+1 grids sequentially with the center point of the first grid as the starting point and the center point of the second grid as the ending point to obtain the fourth connecting line.
[0073] Optionally, the location of the first road center position is an intersection in the area to be adjusted. The at least three connecting lines associated with the first road center position include a fifth connecting line, two sixth connecting lines, and two seventh connecting lines. The two endpoints of the fifth connecting line are a second center point and a third center point, respectively. The two sixth connecting lines belong to the same road, and the two seventh connecting lines belong to another road. The second center point connects one of the sixth connecting lines and one of the seventh connecting lines, and the third center point connects the other sixth connecting line and the other seventh connecting line. The processor 800 is used to read the program in the memory 820 and execute the following process: determining a fourth center point in the fifth connecting line, where the fourth center point is the midpoint of the fifth connecting line; taking a point in the fourth grid as the starting point, and starting from the fifth grid, sixth grid, seventh grid, and... The points in the eight grids are the endpoints. From the set of road reachable grids, the eighth, ninth, tenth, and eleventh connecting lines with the shortest lengths are determined respectively. The fourth, fifth, sixth, seventh, and eighth grids are all grids in the set of road reachable grids. The fourth grid includes the fourth center point. The fifth grid includes at least one point on one of the sixth connecting lines. The sixth grid includes at least one point on another sixth connecting line. The seventh grid includes at least one point on one of the seventh connecting lines. The eighth grid includes at least one point on another seventh connecting line. The connecting lines associated with the first road center position in the initial road centerline information are updated to the eighth, ninth, tenth, and eleventh connecting lines to obtain the target road centerline information.
[0074] Optionally, the processor 800 is configured to read a program from the memory 820 and execute the following processes: acquiring the contour line information of all roads in the area to be adjusted, the contour line information including the set of contour points included by the contour lines on both sides of the road; performing rasterization processing on the area to be adjusted to obtain a second rasterized area; determining the grid where the contour point of the contour line on one side of the first road is located as the ninth grid, the first road being any one of all roads in the area to be adjusted; based on the ninth grid, determining a target contour point from the contour line on the other side of the first road, the line connecting the target contour point and the contour point in the ninth grid being the line with the shortest length between the contour point in the ninth grid and the contour line on the other side of the first road; determining the midpoint of the line connecting the contour point contained in the ninth grid and the corresponding target contour point as the first road center point corresponding to the first road; generating the initial road centerline information based on the set of first road center points, wherein the set of first road center points includes the first road center points corresponding to all roads in the area.
[0075] Optionally, the processor 800 is configured to read a program from the memory 820 and execute the following processes: connecting all first road center points in the first road center point set sequentially according to the actual road direction to obtain multiple connecting lines; identifying at least one abnormal connecting line group from the multiple connecting lines, wherein the abnormal connecting line group includes two connected abnormal connecting lines with an included angle greater than a third preset angle; identifying at least one abnormal center point corresponding one-to-one with the at least one abnormal connecting line group, wherein the abnormal center point is the endpoint of the corresponding abnormal connecting line along the road direction, and the abnormal connecting line is the line connecting two abnormal connecting lines in the corresponding abnormal connecting line group; removing the at least one abnormal center point from the first road center point set to obtain a second road center point set; and connecting all road center points in the second road center point set sequentially according to the actual road direction to obtain the initial road centerline information.
[0076] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described method embodiment for generating road centerline information, and achieves the same technical effect. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0077] This application also provides a computer program product, including computer instructions. When executed by a processor, the computer instructions implement the various processes of the method embodiment for generating road centerline information shown in FIG1 above, and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0078] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0079] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0080] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for generating road centerline information, characterized in that, The method includes: acquiring initial road centerline information in the area to be adjusted, wherein the initial road centerline information includes: the road centerlines of all roads in the area to be adjusted; determining a first road center position among all road center positions included in the initial road centerline information based on at least three connecting lines associated with the road center positions in the initial road centerline information, wherein the road center position is the location where at least three road centerlines in the area to be adjusted intersect, and the at least three connecting lines associated with the road center position include: all road centerlines connected to the road center position, and the first road center position is: the location where at least three road centerlines in the area to be adjusted intersect. The road center position is defined by at least three connecting lines that satisfy the following conditions: the angle between two connecting lines is not within a first preset angle range; a first gridded region is established, which includes at least three connecting lines associated with the first road center position; based on the pixel value of each grid cell in the first gridded region, a road reachable grid set is selected from the first gridded region, where the pixel value of each grid cell in the road reachable grid set is within a preset pixel range; based on the road reachable grid set, the at least three connecting lines associated with the first road center position in the initial road centerline information are updated to obtain the target road centerline information.
2. The method according to claim 1, characterized in that, The first road center position is located at a T-junction in the area to be adjusted. The at least three connecting lines associated with the first road center position include a first connecting line and two second connecting lines. The first connecting line and the second connecting lines belong to different roads, while the two second connecting lines belong to the same road. The first road center position includes a first center point, which is the intersection of the at least three connecting lines associated with the first road center position. The step of updating the at least three connecting lines associated with the first road center position in the initial road centerline information based on the road reachability grid set to obtain target road centerline information includes: determining a first location point in each of the two second connecting lines, resulting in two first location points, wherein the first location point is the intersection of the first road center position. The corresponding second connecting line is located at a point in the area corresponding to the T-junction, and the first position point is a point other than the first center point; based on the two first position points, a third connecting line is determined, which connects the two first position points; taking a point in the first grid as the starting point and a point in the second grid as the ending point, a fourth connecting line with the shortest length is determined from the road reachable grid set, where the first grid and the second grid are grids in the road reachable grid set, the first grid includes the first center point, and the second grid includes at least one point on the third connecting line; the connecting line associated with the first road center position in the initial road centerline information is updated to the first connecting line, the third connecting line, and the fourth connecting line to obtain the target road centerline information.
3. The method according to claim 2, characterized in that, The step of determining the shortest fourth connecting line from the set of accessible road grids, starting from a point in the first grid and ending at a point in the second grid, includes: performing N grid filtering operations from the set of accessible road grids to obtain N+1 grids, wherein the N+1 grids include the first grid and the N third grids obtained from the N grid filtering operations, and the i-th filtering operation in the N grid filtering operations includes: determining the (i+1)-th third grid from a plurality of adjacent grids adjacent to the i-th third grid, wherein the (i+1)-th third grid is the distance between the plurality of adjacent grids. The adjacent grid closest to the third connecting line, the angle between the connecting line between the center point of the (i+1)th third grid and the center point of the ith third grid and the first connecting line is less than a second preset angle. When i equals 1, the ith third grid is the first grid; when i equals N, the (i+1)th third grid is the second grid. Starting from the center point of the first grid and ending at the center point of the second grid, the center points of the N+1 grids are connected sequentially to obtain the fourth connecting line.
4. The method according to claim 1, characterized in that, The first road center position is located at an intersection in the area to be adjusted. At least three connecting lines associated with the first road center position include a fifth connecting line, two sixth connecting lines, and two seventh connecting lines. The two endpoints of the fifth connecting line are a second center point and a third center point, respectively. The two sixth connecting lines belong to the same road, and the two seventh connecting lines belong to another road. The second center point connects one of the sixth connecting lines and one of the seventh connecting lines, and the third center point connects the other sixth connecting line and the other seventh connecting line. The step of updating the at least three connecting lines associated with the first road center position in the initial road centerline information based on the road reachability grid set to obtain the target road centerline information includes: determining a fourth center point in the fifth connecting line, where the fourth center point is the midpoint of the fifth connecting line; taking a point in the fourth grid as the starting point, and respectively... Points in the fifth, sixth, seventh, and eighth grids are used as endpoints. From the set of road-reachable grids, the eighth, ninth, tenth, and eleventh connecting lines with the shortest lengths are determined, respectively. The fourth, fifth, sixth, seventh, and eighth grids are all grids in the set of road-reachable grids. The fourth grid includes the fourth center point; the fifth grid includes at least one point on one of the sixth connecting lines; the sixth grid includes at least one point on another sixth connecting line; the seventh grid includes at least one point on one of the seventh connecting lines; and the eighth grid includes at least one point on another seventh connecting line. The connecting lines associated with the first road center position in the initial road centerline information are updated to the eighth, ninth, tenth, and eleventh connecting lines to obtain the target road centerline information.
5. The method according to any one of claims 1 to 4, characterized in that, The step of obtaining initial road centerline information includes: obtaining the outline information of all roads in the area to be adjusted, wherein the outline information includes the set of outline points included by the outlines on both sides of the road; performing rasterization processing on the area to be adjusted to obtain a second rasterized area; determining the raster where the outline point of the outline on one side of the first road is located as the ninth raster, wherein the first road is any one of the roads in the area to be adjusted; based on the ninth raster, determining a target outline point from the outline on the other side of the first road, wherein the line connecting the target outline point and the outline point in the ninth raster is the line with the shortest length between the outline point in the ninth raster and the outline on the other side of the first road; determining the midpoint of the line connecting the outline point contained in the ninth raster and the corresponding target outline point as the first road center point corresponding to the first road; and generating the initial road centerline information based on the set of first road center points, wherein the set of first road center points includes the first road center points corresponding to all roads in the area.
6. The method according to claim 5, characterized in that, The step of determining the initial road centerline information based on the first set of road centerpoints corresponding to all roads in the area to be adjusted includes: connecting all the first road centerpoints in the first set of road centerpoints sequentially according to the actual road direction to obtain multiple connecting lines; identifying at least one abnormal connecting line group from the multiple connecting lines, wherein the abnormal connecting line group includes two abnormal connecting lines that are connected and have an included angle greater than a third preset angle; identifying at least one abnormal center point corresponding to the at least one abnormal connecting line group, wherein the abnormal center point is the endpoint of the corresponding abnormal connecting line along the road direction, and the abnormal connecting line is the line connecting two abnormal connecting lines in the corresponding abnormal connecting line group; removing the at least one abnormal center point from the first set of road centerpoints to obtain a second set of road centerpoints; and connecting all the road centerpoints in the second set of road centerpoints sequentially according to the actual road direction to obtain the initial road centerline information.
7. A device for generating road centerline information, characterized in that, The device for generating road centerline information includes: a first acquisition module, configured to acquire initial road centerline information in the area to be adjusted, wherein the initial road centerline information includes: the road centerlines of all roads in the area to be adjusted; and a first determination module, configured to determine a first road center position among all road center positions included in the initial road centerline information based on at least three connecting lines associated with the road center positions in the initial road centerline information, wherein the road center position is the location where at least three road centerlines in the area to be adjusted intersect, and the at least three connecting lines associated with the road center position include: all road centerlines connected to the road center position, and the first road center position is: The road center position is defined by at least three associated connecting lines satisfying the following conditions: the angle between two connecting lines is not within a first preset angle range; a first rasterization module is used to establish a first rasterization region, which includes at least three connecting lines associated with the first road center position; a filtering module is used to filter a road reachable raster set from the first rasterization region based on the pixel value of each raster in the first rasterization region, wherein the pixel value corresponding to each raster in the road reachable raster set is within a preset pixel range; and an update module is used to update the at least three connecting lines associated with the first road center position in the initial road centerline information based on the road reachable raster set to obtain the target road centerline information.
8. An electronic device, characterized in that, The system includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for generating road centerline information as described in any one of claims 1 to 6.
9. 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 method for generating road centerline information as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, It includes computer instructions, which, when executed by a processor, implement the steps of the method for generating road centerline information as described in any one of claims 1 to 6.