Road center line determination method and device, equipment and storage medium
By identifying the road polygonal edge lines, removing short edge lines, and determining the side center points, the problem of low efficiency in determining road center lines in the prior art is solved, and a more efficient calculation process is achieved.
Patent Information
- Application Number
- CN202412000020.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-06-03
AI Technical Summary
When determining the center line of the road fence, the prior art has high computational complexity and low efficiency, and requires multiple screening and deep search filtering.
By identifying the polygonal edge lines corresponding to the road, removing the first edge lines with a short length, obtaining the first side and the second side of the road, then determining the center point of the line segment corresponding to the shortest distance between the contour point on the first side and the contour point on the second side, and finally determining the road center line based on the multiple center points.
This reduces the computational complexity, improves the determination efficiency of the road center line, and simplifies the determination process of the center line.
Smart Images

Figure CN120088315A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of road recognition, and particularly relates to a method, device, equipment, storage medium, and computer program product for determining a road center line. Background Art
[0002] Generally, road fences are usually composed of closed polygons. The existing method for determining the center line of a road fence is to determine the triangular network inside the polygon based on the boundary of the polygon, and determine the center line of the road fence by connecting the center points of the triangles. However, there are often multiple lines after connecting the center points, and it is necessary to further screen the eligible center lines or perform enhanced filtering in combination with the depth search algorithm. The process is complicated and the efficiency of determining the center line is low. Summary of the Invention
[0003] Embodiments of this application provide a method, device, equipment, storage medium, and computer program product for determining a road center line, which can improve the efficiency of determining the road center line.
[0004] In a first aspect, embodiments of this application provide a method for determining a road center line, the method including:
[0005] Obtain a polygon corresponding to the target contour points of a road;
[0006] Identify the side lines of the polygon to obtain a first side line and a second side line of the polygon, where the length of the first side line is less than the length of the second side line;
[0007] Remove the first side line from the polygon to obtain a first side and a second side of the road;
[0008] For each first target contour point among the multiple first contour points on the first side, find a second target contour point with the smallest distance from the first target contour point among the second contour points on the second side; determine the center point between the first target contour point and the second target contour point;
[0009] Based on multiple center points, determine the center line of the road.
[0010] In a second aspect, embodiments of this application provide a device for determining a road center line, the device including:
[0011] An obtaining module, configured to obtain a polygon corresponding to the target contour points of a road;
[0012] An identifying module, configured to identify the side lines of the polygon to obtain a first side line and a second side line of the polygon, where the length of the first side line is less than the length of the second side line;
[0013] A processing module, configured to remove the first side line from the polygon to obtain a first side and a second side of the road;
[0014] The processing module is further configured to, for each first target contour point among the multiple first contour points on the first side, find a second target contour point with the minimum distance from the first target contour point among the second contour points on the second side; and determine the center point between the first target contour point and the second target contour point.
[0015] The processing module is further configured to determine the center line of the road based on the multiple center points.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the method for determining the center line of the road as described in the first aspect is implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method for determining the center line of the road as described in the first aspect is implemented.
[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, and when the instructions in the computer program product are executed by the processor of the electronic device, the electronic device is enabled to execute the method for determining the center line of the road as described in the first aspect.
[0019] An embodiment of the present application provides a method, apparatus, device, storage medium, and computer program product for determining the center line of a road. In the embodiment of the present application, after identifying the polygonal side line corresponding to the road, the relatively short first side line can be removed from the polygon to obtain the first side and the second side of the road. Then, the center point of the line segment corresponding to the shortest distance from the contour point on the first side to the contour point on the second side is determined, and finally, the center line of the road is determined based on the multiple center points. In this way, through the recognition of the polygonal side line, the end sides at both ends of the road can be obtained. After removing the end sides, the two side lines of the road can be obtained, and the center line of the two side lines is the center line of the road. The center line of the two side lines obtained in the present application is obtained through a relatively simple method for determining the center point. Therefore, compared with the method of constructing a triangular mesh inside the polygon and determining the center line of the road fence by connecting the center points of the triangles in the prior art, the calculation complexity is reduced, and the efficiency of determining the center line of the road is improved. Description of the Drawings
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0021] Figure 1It is a schematic structural diagram of a road centerline determination system provided by an embodiment of the present application;
[0022] Figure 2 It is a schematic flowchart of a road centerline determination method provided by an embodiment of the present application;
[0023] Figure 3 It is a schematic diagram of the center point between a first target contour point and a second target contour point provided by an embodiment of the present application;
[0024] Figure 4 It is a schematic diagram of the original contour points of a road provided by an embodiment of the present application;
[0025] Figure 5 It is a schematic diagram of the target contour points of a road provided by an embodiment of the present application;
[0026] Figure 6 It is a schematic diagram of the first side line of a road provided by an embodiment of the present application;
[0027] Figure 7 It is a schematic diagram of the second side line of a road provided by an embodiment of the present application;
[0028] Figure 8 It is a schematic structural diagram of a road centerline determination device provided by an embodiment of the present application;
[0029] Figure 9 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0030] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than limiting the present application. For those skilled in the art, the present application can be implemented without some of these specific details. The following description of the embodiments is only intended to provide a better understanding of the present application by showing examples of the present application.
[0031] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
[0032] Generally, a road fence is usually composed of a closed polygon. The existing method for determining the center line of a road fence is to determine the triangular network inside the polygon according to the boundary of the polygon, and determine the center line of the road fence by connecting the center points of the triangles. However, there are often multiple lines after connecting the center points, and it is necessary to further screen the eligible center lines or combine with a depth search algorithm for enhanced filtering. The process is complicated and the efficiency of determining the center line is low.
[0033] To solve the problems of the existing technology, the embodiments of the present application provide a method, device, equipment, storage medium and computer program product for determining a road center line. After identifying the polygon side lines corresponding to the road, the embodiments of the present application can remove the first side lines with relatively short lengths from the polygon, so as to obtain the first side and the second side of the road. Then, determine the center point of the line segment corresponding to the shortest distance from the contour points on the first side to the contour points on the second side, and finally determine the road center line based on the multiple center points. In this way, through polygon side line recognition, the end sides at both ends of the road can be obtained. After removing the end sides, the two side lines of the road can be obtained, and the center line of the two side lines is the center line of the road. The center lines of the two side lines obtained in the present application are obtained through a relatively simple center point determination method. Therefore, compared with the method of constructing a triangular network inside the polygon and determining the center line of the road fence by connecting the center points of the triangles in the existing technology, the calculation complexity is reduced and the efficiency of determining the road center line is improved.
[0034] First, the road center line determination system provided by the embodiments of the present application will be introduced below.
[0035] Figure 1 shows a schematic structural diagram of a road center line determination system provided by an embodiment of the present application. As Figure 1 shown, the system may include a polygon encryption module 101, a road end identification module 102, a road side extraction module 103 and a road center line calculation module 104.
[0036] The polygon encryption module 101 can be used to add new contour points between the original contour points of the road at a preset interval based on the original contour points of the road, obtain the target contour points of the road, and then obtain the corresponding polygon based on the target contour points.
[0037] The road end recognition module 102 can be used to recognize the side lines of the polygon to obtain the first side line of the polygon. The first side line represents the contour lines corresponding to both ends of the road.
[0038] The road side extraction module 103 can be used to remove the first side line from the polygon to obtain the first side and the second side of the road.
[0039] The road center line calculation module 104 can be used to, for each first target contour point among multiple first contour points on the first side, find the second target contour point with the minimum distance from the second contour points on the second side to determine the center point between the first target contour point and the second target contour point, and obtain the center line of the road based on the center point.
[0040] The following introduces the road center line determination method provided by the embodiments of the present application.
[0041] Figure 2 The flowchart of the road center line determination method provided by an embodiment of the present application is shown. As Figure 2 shown, the method may include the following steps: S201 to S205.
[0042] S201: Obtain the polygon corresponding to the target contour points of the road.
[0043] The target contour points can be used to represent the contour shape of the road, and the polygon corresponding to the target contour points is consistent with the contour shape of the road.
[0044] In some embodiments, obtaining the polygon corresponding to the target contour points of the road can be implemented by the polygon encryption module 101.
[0045] Specifically, it can be by adding new contour points between the original contour points of the road at a preset interval based on the original contour points of the road, obtaining the target contour points of the road, and then obtaining the corresponding polygon based on the target contour points.
[0046] S202: Recognize the side lines of the polygon to obtain the first side line and the second side line of the polygon, and the length of the first side line is less than the length of the second side line.
[0047] Since the lengths of the contour lines corresponding to the two ends of the road are often smaller than those of the contour lines corresponding to the sides of the road, the first side line can be used to represent the contour lines corresponding to the two ends of the road, and the second side line can represent the contour lines corresponding to the sides of the road.
[0048] In some embodiments, identifying the side lines of the polygon to obtain the first side line of the polygon can be implemented by the road end identification module 102.
[0049] Specifically, it can be to obtain a set of first line strings through the turning angles of the contour points on the polygon side lines and the first line string. For each first line string, calculate the cumulative turning angle of the contour points on the first line string respectively to obtain the cumulative turning angle of the first line string. Then, from the set of first line strings, remove the first line strings with a cumulative turning angle less than the first preset angle threshold to obtain a set of second line strings. When the set of second line strings is not empty, cluster and group the line strings in the set of second line strings to obtain a preset number of line string groups. Finally, merge the line strings in each line string group to obtain the third line strings corresponding to all line string groups, and determine the first side line of the polygon according to the turning angles of the contour points on the third line strings.
[0050] In some embodiments, identifying the side lines of the polygon to obtain the second side line of the polygon can be implemented by the road side extraction module 103. Specifically, it can be to extract the second side line by removing the already determined first side line from the polygon.
[0051] S203: Remove the first side line from the polygon to obtain the first side and the second side of the road.
[0052] The first side and the second side can be used to represent the side contour lines of the road, and the first side and the second side are approximately parallel.
[0053] In some embodiments, removing the first side line from the polygon to obtain the first side and the second side of the road can be implemented by the road side extraction module 103.
[0054] S204: For each first target contour point among the multiple first contour points on the first side, find the second target contour point with the smallest distance from the second contour points on the second side; determine the center point between the first target contour point and the second target contour point. The center point between the first target contour point and the second target contour point can be as Figure 3 shown.
[0055] Since the first side and the second side are approximately parallel, for each first target contour point among the multiple first contour points on the first side, find the second target contour point with the minimum distance from the second contour points on the second side, determine the center point between the first target contour point and the second target contour point, and connect these center points, then the center line of the first side and the second side can be obtained, which is the center line of the road.
[0056] In some embodiments, for each first target contour point among the multiple first contour points on the first side, find the second target contour point with the minimum distance from the second contour points on the second side; determining the center point between the first target contour point and the second target contour point can be implemented by the road center line calculation module 104.
[0057] S205: Determine the center line of the road based on multiple center points.
[0058] In some embodiments, determining the center line of the road based on multiple center points can be implemented by the road center line calculation module 104. Specifically, the center line of the road can be obtained by connecting multiple center points.
[0059] In the embodiments of the present application, after identifying the polygonal side lines corresponding to the road, the relatively short first side lines can be removed from the polygon, thereby obtaining the first side and the second side of the road. Then, determine the center point of the line segment corresponding to the shortest distance from the contour points on the first side to the contour points on the second side. Finally, determine the road center line based on these multiple center points. In this way, in the embodiments of the present application, through the identification of the polygonal side lines, the end sides at both ends of the road can be obtained. After removing these end sides, the two side lines of the road can be obtained, and the center line of these two side lines is the center line of the road. And the center line of the two side lines obtained in the present application is obtained through a relatively simple center point determination method. Therefore, compared with the method of constructing a triangular network inside the polygon and determining the center line of the road fence by connecting the center points of the triangles in the prior art, the calculation complexity is reduced, and the determination efficiency of the road center line is improved.
[0060] In some embodiments, S201 may include:
[0061] Obtain the original contour points of the road;
[0062] Add new contour points between the original contour points at a preset interval to obtain the target contour points of the road; the target contour points include the original contour points and the new contour points;
[0063] Obtain a polygon based on the target contour points of the road.
[0064] Among them, the original contour points of the road are relatively sparse, and the original contour points of the road can be asFigure 4 As shown. By encrypting the original contour points of the road, denser target contour points of the road can be obtained. The target contour points of the road can be as Figure 5 shown.
[0065] Among them, the preset spacing Lc can be set artificially. As an example, the preset spacing Lc can be 1 meter.
[0066] By adding new contour points between the original contour points and increasing the density of the road contour points, the accuracy of the polygon corresponding to the road contour points can be improved, ensuring that the polygon is completely consistent with the road contour. At the same time, the increase in contour points increases the data calculation samples, thereby improving the accuracy of determining the road center line.
[0067] As an example, obtaining the original contour points of the road can be to obtain an image of the road and obtain them through an image recognition algorithm.
[0068] As an example, adding new contour points between the original contour points according to the preset spacing to obtain the target contour points of the road can be implemented by the polygon encryption module 101.
[0069] As an example, obtaining a polygon based on the target contour points of the road can be to obtain the corresponding polygon by connecting all the target contour points.
[0070] In some embodiments, in S102, identifying the side lines of the polygon to obtain the first side line of the polygon may include:
[0071] Based on each contour point among the multiple contour points on the polygon, determining the turning angle of the contour point and the first line string to obtain a set of first line strings;
[0072] For each first line string, respectively cumulatively calculating the turning angles of the contour points on the first line string to obtain the cumulative turning angle of the first line string;
[0073] Removing the first line strings with cumulative turning angles less than the first preset angle threshold from the set of first line strings to obtain a set of second line strings;
[0074] In the case where the set of second line strings is not empty, clustering and grouping the line strings in the set of second line strings to obtain a preset number of line string groups;
[0075] Merging the line strings in each line string group to obtain the third line string corresponding to all the line string groups;
[0076] Determining the first side line of the polygon according to the turning angles of the contour points on the third line string.
[0077] Among them, the turning angle of the contour point represents the turning angle of the contour point in the straight-line direction compared with the previous contour point. When the turning angle of the contour point is small, it can generally be considered that the contour point belongs to the contour point on the side line of the polygon. When the turning angle of the contour point is large, it can be considered that the contour point may be the inflection point of the polygon, that is, the endpoints at both ends of the road. Therefore, the two ends of the road, that is, the first side line, can be determined by the turning angle of the contour point.
[0078] The first side line can be used to represent the contour line corresponding to the two ends of the road. The first side line can be as Figure 6 shown. Removing the first side line from the polygon can obtain the second side line, that is, the contour line corresponding to the side of the road. The second side line can be as Figure 7 shown.
[0079] A line string represents an ordered array generated by two or more points and is used to describe map elements, such as the shape of a road. The line string can be realized through high-degree discretization to describe any irregular shape. The first line string can represent the line string obtained by connecting adjacent contour points according to a preset extension distance.
[0080] The cumulative turning angle is used to represent the cumulative value of the turning angles of all contour points on the first line string. The cumulative turning angle can characterize the bending degree of the line string to a certain extent. When the cumulative turning angle of the first line string is less than the first preset angle threshold, it can generally be considered that the first line string belongs to a part of the polygon side line. When the cumulative turning angle of the first line string is greater than the first preset angle threshold, it can be considered that the first line string contains the inflection point of the polygon, and then it contains the two ends of the road, that is, the first side line. Therefore, the first line string that may form the first side line can be screened out by removing the first line string with a cumulative turning angle less than the first preset angle threshold.
[0081] Among them, the first preset angle threshold can be set artificially. For example, the first preset angle threshold can be 120 degrees. When the first preset angle threshold is set appropriately, the set of second line strings obtained by removing the first line strings with a cumulative turning angle less than the first preset angle threshold is generally not empty. Then, the line strings in the set of second line strings are clustered and grouped to obtain a preset number of line string groups. Generally, two line string groups can be obtained, which respectively correspond to the contour lines at both ends of the road.
[0082] The third line string can be used to represent the line string containing the contour lines corresponding to the two ends of the road, that is, the first side line.
[0083] In this embodiment, a set of first line strings is obtained based on the turning angles of the contour points on the polygon side line and the first line string. For each first line string, the turning angles of the contour points on the first line string are respectively cumulatively calculated to obtain the cumulative turning angle of the first line string. Then, from the set of first line strings, the first line strings with a cumulative turning angle less than the first preset angle threshold are removed to obtain a set of second line strings. When the set of second line strings is not empty, the line strings in the set of second line strings are clustered and grouped to obtain a preset number of line string groups. Finally, the line strings in each line string group are merged to obtain the third line string corresponding to all line string groups, and the first side line of the polygon is determined based on the turning angles of the contour points on the third line string. In this way, the first side line of the polygon can be accurately determined, that is, the two ends of the road can be accurately determined.
[0084] As an example, for each of the multiple contour points on the polygon, determining the turning angle of the contour point may be based on respectively constructing a first vector and a second vector with the contour points adjacent to the contour point, and calculating the included angle between the first vector and the second vector to obtain the turning angle of the contour point.
[0085] As an example, for each of the multiple contour points on the polygon, determining the first line string of the contour point may be obtained by connecting the contour points adjacent to it at a preset extension distance with the contour point as the center.
[0086] As an example, the above-mentioned cumulative calculation of the turning angles of the contour points on the first line string may be to calculate the sum of the turning angles of all the contour points on the first line string.
[0087] As an example, the above-mentioned clustering and grouping of the line strings in the set of second line strings to obtain a preset number of line string groups may be to obtain a preset number of line string groups by grouping the line strings with the same contour points into one line string group.
[0088] As an example, the above-mentioned determination of the first side line of the polygon based on the turning angles of the contour points on the third line string may be to first determine the inflection points of the polygon, and obtain the first side line by retaining the contour points and line strings between two inflection points or removing the contour points and line strings at both ends of the third line string that end at the inflection points.
[0089] In some embodiments, in S102, when identifying the side line of the polygon to obtain the first side line of the polygon, it may further include:
[0090] When the set of second line strings is empty, reduce the first preset angle threshold, and return to remove the first line strings with a cumulative turning angle less than the first preset angle threshold from the set of first line strings to obtain the set of second line strings until the first preset angle threshold is equal to the first set value or the set of second line strings is not empty.
[0091] When the setting of the first preset angle threshold is inappropriate, the second set of line strings obtained by removing the first line strings with a cumulative steering angle less than the first preset angle threshold may be an empty set. When the second set of line strings is empty, by reducing the first preset angle threshold, it can be ensured that the second set of line strings contains valid line string data, which is convenient for the subsequent line string clustering and grouping process.
[0092] As an example, to reduce the first preset angle threshold, the first preset angle threshold can be reduced by 5 degrees each time. This is done until the first preset angle threshold is equal to the first set value or the second set of line strings is not empty.
[0093] During the process of reducing the first preset angle threshold, the first preset angle threshold cannot be less than the first set value. As an example, the first set value can be 90 degrees.
[0094] In some embodiments, the above-mentioned process of removing the first line strings with a cumulative steering angle less than the first preset angle threshold from the first set of line strings to obtain the second set of line strings may include:
[0095] When the first preset angle threshold is equal to the first set value and the second set of line strings is empty, increase the preset extension distance, and return to determine the steering angle of each contour point and the first line strings based on each contour point among the multiple contour points on the polygon, so as to obtain the first set of line strings.
[0096] When the first preset angle threshold has been reduced to the first set value and the second set of line strings is still empty, it can be considered whether the setting of the preset extension distance used to generate the first line strings is appropriate. By appropriately increasing the preset extension distance and re-determining the steering angle of the contour points and the first line strings, and implementing the subsequent steps, it can be ensured that the second set of line strings contains valid line string data, which is convenient for the subsequent line string clustering and grouping process.
[0097] As an example, to increase the preset extension distance, the preset extension distance can be increased by 10 meters each time until a second set of line strings containing valid line string data is obtained.
[0098] In some embodiments, in order to accurately determine the steering angle of each contour point, the above-mentioned process of determining the steering angle of each contour point based on each contour point among the multiple contour points on the polygon may include:
[0099] For each contour point, respectively construct a first vector and a second vector based on the contour points adjacent to the contour point;
[0100] Calculate the included angle between the first vector and the second vector to obtain the steering angle of the contour point.
[0101] As an example, for the contour point P, based on the adjacent contour points Pa and Pb of the contour point P, the first vector (P, Pa) and the second vector (P, Pb) can be constructed respectively, and then based on the vector angle formula, the angle r between the first vector (P, Pa) and the second vector (P, Pb) can be calculated, and then the turning angle Pi - r of the contour point P can be obtained.
[0102] In some embodiments, the above determining the first line string of the contour point based on each contour point among multiple contour points on the polygon may include:
[0103] For each contour point, taking each contour point as the center, connecting the adjacent contour points according to a preset extension distance to obtain the first line string of the contour point.
[0104] Wherein, the first line string represents the line string generated by connecting adjacent contour points by each contour point according to a preset extension distance.
[0105] The preset extension distance Le can be set artificially. As an example, the preset extension distance Le can be 10 meters. The setting of the preset extension distance is very important for the subsequent processing of the first line string. If the preset extension distance is set too large or too small, it may lead to an ineffective data set and ultimately the inability to determine the first side line of the polygon.
[0106] By taking each contour point as the center and connecting the adjacent contour points according to a preset extension distance to obtain the first line string of the contour point to generate the second line string set, it is convenient to accurately determine the first side line of the polygon.
[0107] As an example, for the contour point P, taking the contour point P as the center, connecting the adjacent contour points in the front and back directions on the contour line according to the preset extension distance Le to obtain the first line string Strp of the contour point P.
[0108] In some embodiments, determining the first side line of the polygon according to the turning angles of the contour points on the third line string includes:
[0109] Obtain the turning angles of all contour points on the third line string;
[0110] According to the turning angles of the contour points, determine the third contour point and the fourth contour point whose turning angles are greater than the second preset angle threshold;
[0111] In the third line string, retain the third contour point, the fourth contour point, and the contour points and line strings therebetween to obtain the first side line of the polygon.
[0112] Wherein, the second preset angle threshold can be set artificially. As an example, the second preset angle threshold can be 50 degrees.
[0113] The third contour point and the fourth contour point can be used to characterize the inflection points at both ends of the road.
[0114] By retaining the third contour point, the fourth contour point, and the contour points and line strings therebetween, that is, only retaining the contour points and line strings between the inflection points at both ends of the road, the first side line of the polygon can be obtained. In this way, the contour lines corresponding to both ends of the road can be accurately obtained.
[0115] As an example, to obtain the turning angles of all the contour points on the third line string, the first vector and the second vector can be respectively constructed based on the adjacent contour points, and then the included angle between the first vector and the second vector can be calculated to obtain it.
[0116] As an example, according to the turning angles of the contour points, to determine the third contour point and the fourth contour point whose turning angles are greater than the second preset angle threshold, it can be determined by comparing the turning angle of each contour point with the second preset angle threshold.
[0117] Figure 8 It is a schematic structural diagram of a road center line determination device 800 provided by an embodiment of the present application. As Figure 8 shown, the device may include an acquisition module 810, an identification module 820, and a processing module 830.
[0118] The acquisition module 810 is configured to acquire a polygon corresponding to the target contour points of the road;
[0119] The identification module 820 is configured to identify the side lines of the polygon to obtain the first side line and the second side line of the polygon, and the length of the first side line is less than the length of the second side line;
[0120] The processing module 830 is configured to remove the first side line from the polygon to obtain the first side and the second side of the road;
[0121] The processing module 830 is further configured to, for each first target contour point among the multiple first contour points on the first side, find the second target contour point with the smallest distance from the second contour points on the second side; determine the center point between the first target contour point and the second target contour point;
[0122] The processing module 830 is further configured to determine the center line of the road based on the multiple center points.
[0123] In the embodiments of the present application, after identifying the polygonal side lines corresponding to the road, the first side lines with relatively short lengths can be removed from the polygon, thereby obtaining the first side and the second side of the road. Then, the center point of the line segment corresponding to the shortest distance from the contour points on the first side to the contour points on the second side is determined, and finally, the road center line is determined based on the multiple center points. In this way, through the identification of the polygonal side lines, the end side lines at both ends of the road can be obtained in the embodiments of the present application. After removing the end side lines, the two side lines of the road can be obtained, and the center line of the two side lines is the center line of the road. Moreover, the center line of the two side lines in the present application is obtained through a relatively simple center point determination method. Therefore, compared with the method of constructing a triangular mesh inside the polygon and determining the center line of the road fence by connecting the center points of the triangles in the prior art, the calculation complexity is reduced, and the determination efficiency of the road center line is improved.
[0124] In some embodiments, the obtaining module 810 is further configured to obtain the original contour points of the road;
[0125] The processing module 830 is further configured to add new contour points between the original contour points at a preset interval to obtain the contour points of the road; the contour points include the original contour points and the new contour points;
[0126] The processing module 830 is further configured to obtain a polygon based on the contour points of the road.
[0127] In some embodiments, the processing module 830 is further configured to determine the steering angle and the first line string of each contour point among the multiple contour points on the polygon to obtain a set of first line strings;
[0128] The processing module 830 is further configured to cumulatively calculate the steering angles of the contour points on each first line string for each first line string to obtain the cumulative steering angle of the first line string;
[0129] The processing module 830 is further configured to remove the first line strings with a cumulative steering angle less than the first preset angle threshold from the set of first line strings to obtain a set of second line strings;
[0130] The processing module 830 is further configured to perform clustering grouping on the line strings in the set of second line strings when the set of second line strings is not empty to obtain a preset number of line string groups;
[0131] The processing module 830 is further configured to merge the line strings in each line string group to obtain a third line string corresponding to all the line string groups;
[0132] The processing module 830 is further configured to determine the first side line of the polygon according to the steering angles of the contour points on the third line string.
[0133] In some embodiments, the processing module 830 is further configured to, when the second set of line strings is empty, reduce the first preset angle threshold, and return a second set of line strings obtained by removing, from the first set of line strings, the first line strings whose cumulative turning angles are less than the first preset angle threshold, until the first preset angle threshold is equal to the first set value or the second set of line strings is not empty.
[0134] In some embodiments, the processing module 830 is further configured to, when the first preset angle threshold is equal to the first set value and the second set of line strings is empty, increase the preset extension distance, and return, for each contour point among the multiple contour points on the polygon, the turning angle of the contour point and the first line string to obtain the first set of line strings.
[0135] In some embodiments, the processing module 830 is further configured to, for each contour point, respectively construct a first vector and a second vector based on the contour points adjacent to the contour point;
[0136] The processing module 830 is further configured to calculate the included angle between the first vector and the second vector to obtain the turning angle of the contour point.
[0137] In some embodiments, the processing module 830 is further configured to, for each contour point, connect the contour points adjacent to it at a preset extension distance with each contour point as the center to obtain the first line string of the contour point.
[0138] In some embodiments, the obtaining module 810 is further configured to obtain the turning angles of all the contour points on the third line string;
[0139] The processing module 830 is further configured to determine a third contour point and a fourth contour point whose turning angles are greater than the second preset angle threshold according to the turning angles of the contour points;
[0140] The processing module 830 is further configured to, in the third line string, retain the third contour point, the fourth contour point, and the contour points and line strings therebetween to obtain the first side line of the polygon.
[0141] Figure 8 Each module in the shown device can implement Figure 2 the respective steps in and achieve the corresponding technical effects, which will not be elaborated herein for the sake of brevity.
[0142] Figure 9 The figure shows a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application.
[0143] The electronic device may include a processor 901 and a memory 902 storing computer program instructions.
[0144] Specifically, the above-mentioned processor 901 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be an integrated circuit configured to implement one or more of the embodiments of the present application.
[0145] The memory 902 may include a mass storage for data or instructions. By way of example and not limitation, the memory 902 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In a suitable case, the memory 902 may include a removable or non-removable (or fixed) medium. In a suitable case, the memory 902 may be internal or external to the integrated gateway disaster recovery device. In a specific embodiment, the memory 902 is a non-volatile solid-state memory.
[0146] In a specific embodiment, the memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present application.
[0147] The processor 901 reads and executes the computer program instructions stored in the memory 902 to implement any one of the road centerline determination methods in the above embodiments.
[0148] In one example, the electronic device may further include a communication interface 903 and a bus 910. Among them, as Figure 9 shown, the processor 901, the memory 902, and the communication interface 903 are connected through the bus 910 and complete communication with each other.
[0149] The communication interface 903 is mainly used to implement communication between various modules, devices, units, and / or devices in the embodiments of the present application.
[0150] Bus 910 includes hardware, software, or both, and couples components of an electronic device to each other. By way of example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable bus or a combination of two or more of these. Where appropriate, bus 910 may include one or more buses. Although embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.
[0151] In addition, in combination with the road centerline determination method in the above embodiments, embodiments of the present application may provide a computer storage medium to implement. Computer program instructions are stored on the computer storage medium; when the computer program instructions are executed by a processor, any one of the road centerline determination methods in the above embodiments is implemented.
[0152] Embodiments of the present application also provide a computer program product, including a computer program, and when the computer program is executed by a processor, any one of the road centerline determination methods in the above embodiments is implemented.
[0153] It should be clear that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present application.
[0154] The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and so on. When implemented in software, the elements of the present application are programs or code segments for performing the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted via a data signal carried in a carrier wave over a transmission medium or a communication link. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.
[0155] It should also be noted that the exemplary embodiments mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, can be different from the order in the embodiments, or several steps can be executed simultaneously.
[0156] Aspects of the present application have been described above with reference to the flowcharts and / or block diagrams of methods, apparatuses, devices, storage media, and computer program products according to embodiments of the present application. It should be understood that each block in the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each block in the block diagrams and / or flowcharts, and the combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware for performing the specified functions or actions, or by a combination of dedicated hardware and computer instructions.
[0157] The above are only specific embodiments of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules, and units described above can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here. It should be understood that the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present application.
Claims
1. A method for determining a road centerline, characterized in that: include: Get the polygon corresponding to the target contour point of the road; Identify the sideline of the polygon to obtain a first sideline and a second sideline of the polygon, wherein the length of the first sideline is shorter than the length of the second sideline; Removing the first edge line from the polygon to obtain a first side edge and a second side edge of the road; For each first target contour point among the plurality of first contour points on the first side, searching for a second target contour point having the shortest distance from the first target contour point from the second contour points on the second side; determining a center point between the first target contour point and the second target contour point; Based on the plurality of center points, a center line of the road is determined.
2. The method according to claim 1, characterized in that The step of obtaining the polygon corresponding to the contour point of the road includes: Obtaining original contour points of the road; Adding new contour points between the original contour points according to a preset interval to obtain target contour points of the road; the target contour points include the original contour points and the new contour points; The polygon is obtained based on the target contour points of the road.
3. The method according to claim 1, characterized in that Identifying the edge of the polygon and obtaining the first edge of the polygon includes: Based on each contour point among a plurality of contour points on the polygon, determining a steering angle and a first line string of the contour point to obtain a first line string set; For each of the first line strings, respectively, cumulatively calculate the turning angles of the contour points on the first line string to obtain the cumulative turning angles of the first line string; From the first line string set, remove the first line string whose cumulative turning angle is less than the first preset angle threshold to obtain a second line string set; When the second line string set is not empty, clustering and grouping the line strings in the second line string set to obtain a preset number of line string groups; Merging the line strings in each of the line string groups to obtain a third line string corresponding to all of the line string groups; The first side line of the polygon is determined according to the turning angle of the contour points on the third line string.
4. The method according to claim 3, characterized in that Identifying the edge line of the polygon and obtaining the first edge line of the polygon also includes: When the second line string set is empty, reduce the first preset angle threshold, and return to the first line string set, remove the first line string whose cumulative turning angle is less than the first preset angle threshold, and obtain the second line string set, until the first preset angle threshold is equal to the first set value or the second line string set is not empty.
5. The method according to claim 3, characterized in that: The step of removing the first line strings whose cumulative turning angles are less than a first preset angle threshold from the first line string set to obtain a second line string set includes: When the first preset angle threshold is equal to the first set value and the second line string set is empty, the preset extension distance is increased, and the turning angle and the first line string of each contour point among the multiple contour points on the polygon are determined to obtain the first line string set.
6. The method according to claim 3, characterized in that The step of determining the turning angle of each contour point based on a plurality of contour points on the polygon comprises: For each contour point, construct a first vector and a second vector based on contour points adjacent to the contour point; The angle between the first vector and the second vector is calculated to obtain the turning angle of the contour point.
7. The method according to claim 3, characterized in that Based on each contour point of a plurality of contour points on the polygon, determining a first line string of the contour points comprises: For each contour point, each contour point is taken as a center and its adjacent contour points are connected according to a preset extension distance to obtain a first line string of the contour point.
8. The method according to any one of claims 3 to 7, characterized in that: The step of determining the first sideline of the polygon according to the turning angle of the contour point on the third line string comprises: Obtaining the turning angles of all contour points on the third line string; According to the turning angle of the contour point, determining a third contour point and a fourth contour point whose turning angle is greater than a second preset angle threshold; In the third line string, the third contour point and the fourth contour point and the contour points and line strings therebetween are retained to obtain the first side line of the polygon.
9. A road centerline determination device, characterized in that: The device comprises: An acquisition module, used to acquire the polygon corresponding to the target contour point of the road; An identification module, used for identifying the sideline of the polygon, obtaining a first sideline and a second sideline of the polygon, wherein the length of the first sideline is shorter than the length of the second sideline; A processing module, configured to remove the first edge line from the polygon to obtain a first side edge and a second side edge of the road; The processing module is further configured to search, for each first target contour point among the plurality of first contour points on the first side, a second target contour point having the smallest distance from the first target contour point from the second contour points on the second side; and determine a center point between the first target contour point and the second target contour point; The processing module is further used to determine the center line of the road based on the multiple center points.
10. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the road centerline determination method as described in any one of claims 1-8 is implemented.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the road centerline determination method according to any one of claims 1 to 8 is implemented.
12. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the road centerline determination method as described in any one of claims 1-8.