A road center line determination method, device, equipment and storage medium
By acquiring and processing the boundary contours on both sides of the road, and determining the projection points and associated points, the road centerline can be determined quickly and accurately, solving the problems of high complexity and low accuracy in existing technologies, while preserving the original geometry.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA FAW CO LTD
- Filing Date
- 2023-06-15
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies suffer from high algorithm complexity, low efficiency, and poor accuracy when merging vector line data, and the geometric shape representation of the merged line data is also poor.
By obtaining the boundary contours on both sides of the target road, the outer rectangle and projection points are determined. The connecting lines are extended to intersect and determine the associated points. The center line is determined based on the sorting of feature points, thus avoiding data fitting.
It improves the efficiency and accuracy of determining the road centerline, and the merged centerline retains the original geometry.
Smart Images

Figure CN116758138B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for determining the center line of a road. Background Technology
[0002] Spatial calculations of spatial vector point, line, and polygon data are essential in high-precision maps to meet the necessary mapping business requirements, among which spatial merging of road vector line data is particularly critical.
[0003] Currently, existing methods for obtaining centerlines by merging road lines are as follows: One method is to adjust the coefficients of the merged line equation (a cubic polynomial) based on the difference in effective distances between two line data sets; the merged line data is then determined using the adjusted line equation. However, this method is relatively complex to calculate and involves parameter tuning and line fitting, resulting in relatively low accuracy in some scenarios. Another method involves determining multiple dividing points on each line data set; for each dividing point, a closed block corresponding to that dividing point is determined within the two line regions, where the distance from any point in the closed block to the dividing point is less than the distance from any point to other dividing points; the merged line data to be processed is generated based on the adjacent edges between each closed block. However, this method produces merged line data that poorly represents the geometry of the two original data sets. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and storage medium for determining road centerlines, which solves the problems of high algorithm complexity, low efficiency, and poor accuracy in the merging of vector line data in the prior art. This improves the efficiency and accuracy of determining road centerlines, and the merged centerline can perfectly preserve the geometry of the original two lines.
[0005] In a first aspect, embodiments of the present invention provide an adaptive cruise control method, comprising:
[0006] Obtain the first boundary contour line and the second boundary contour line on both sides of the target road, wherein the first boundary contour line is composed of multiple first boundary points and the second boundary contour line is composed of multiple second boundary points;
[0007] Determine a first outer rectangle of the first boundary contour and a first projection point of each first boundary point on the first outer rectangle; and determine a second outer rectangle of the second boundary contour and a second projection point of each second boundary point on the second outer rectangle.
[0008] Extend the line connecting each first boundary point to the corresponding first projection point to determine the first associated point that intersects with the second boundary contour line, and take the midpoint between each first boundary point and the corresponding first associated point as the first feature point corresponding to the first boundary point;
[0009] Extend the line connecting each second boundary point to the corresponding second projection point to determine the second associated point that intersects with the first boundary contour line, and take the midpoint between each second boundary point and the corresponding second associated point as the second feature point corresponding to the second boundary point.
[0010] Based on the changing direction of the boundary contour line, each first feature point and each second feature point are sorted, and based on the sorted feature point sequence, the centerline corresponding to the target road is determined.
[0011] Secondly, embodiments of the present invention also provide an adaptive cruise control device, comprising:
[0012] The boundary contour line acquisition module acquires the first boundary contour line and the second boundary contour line on both sides of the target road, wherein the first boundary contour line is composed of multiple first boundary points and the second boundary contour line is composed of multiple second boundary points;
[0013] The projection point determination module is used to determine the first outer rectangle of the first boundary contour line and the first projection point of each first boundary point on the first outer rectangle, and to determine the second outer rectangle of the second boundary contour line and the second projection point of each second boundary point on the second outer rectangle;
[0014] The first feature point determination module is used to extend the line connecting each first boundary point and the corresponding first projection point to determine the first associated point that intersects with the second boundary contour line, and to take the midpoint between each first boundary point and the corresponding first associated point as the first feature point corresponding to the first boundary point.
[0015] The second feature point determination module is used to extend the line connecting each second boundary point and the corresponding second projection point to determine the second associated point that intersects with the first boundary contour line, and to take the midpoint between each second boundary point and the corresponding second associated point as the second feature point corresponding to the second boundary point.
[0016] The centerline determination module is used to sort each first feature point and each second feature point based on the changing direction of the boundary contour line, and determine the centerline corresponding to the target road based on the sorted feature point sequence.
[0017] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0018] At least one processor;
[0019] and a memory communicatively connected to the at least one processor;
[0020] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the road centerline determination method provided in any embodiment of the present invention.
[0021] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions, which are used to cause a processor to execute the road centerline determination method provided in any embodiment of the present invention.
[0022] The technical solution of this invention involves obtaining first and second boundary contour lines on both sides of a target road; determining a first outer rectangle of the first boundary contour line and a first projection point of each first boundary point on the first outer rectangle, and determining a second outer rectangle of the second boundary contour line and a second projection point of each second boundary point on the second outer rectangle; extending the line connecting each first boundary point to its corresponding first projection point to determine a first associated point intersecting the second boundary contour line, and using the midpoint between each first boundary point and its corresponding first associated point as a first feature point corresponding to the first boundary point; and connecting each second boundary point to its corresponding first projection point. The lines connecting the corresponding second projection points are extended to determine the second associated points that intersect with the first boundary contour line. The midpoint between each second boundary point and the corresponding second associated point is taken as the second feature point corresponding to the second boundary point. Based on the changing direction of the boundary contour line, each first feature point and each second feature point are sorted. Based on the sorted feature point sequence, the center line corresponding to the target road is determined. Thus, the center line corresponding to the road can be quickly and accurately determined by projection and extension intersection method without data fitting, thereby improving the efficiency and accuracy of determining the road center line. Moreover, the merged center line can perfectly preserve the geometry of the original two lines.
[0023] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1This is a flowchart of a method for determining the centerline of a road according to Embodiment 1 of the present invention;
[0026] Figure 2 This is an example diagram of a feature point calculation process according to Embodiment 1 of the present invention;
[0027] Figure 3 This is a flowchart of a method for determining the centerline of a road provided in Embodiment 2 of the present invention;
[0028] Figure 4 This is a flowchart of a road centerline determination device according to Embodiment 3 of the present invention;
[0029] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the road centerline determination method of this invention. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "target," "current," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0032] Example 1
[0033] Figure 1 This is a flowchart illustrating a method for determining a road centerline according to Embodiment 1 of the present invention. This embodiment is applicable to irregular road sections, determining the road centerline based on the boundary lines on both sides of the road. This method can be executed by a road centerline determining device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0034] S110. Obtain the first boundary contour line and the second boundary contour line on both sides of the target road, wherein the first boundary contour line is composed of multiple first boundary points and the second boundary contour line is composed of multiple second boundary points.
[0035] The target road can refer to an irregularly shaped road. The first boundary contour line can be a line connecting discrete points on one side of the target road's boundary line. The second boundary contour line can be a line connecting discrete points on the other side of the target road's boundary line. The first boundary point can be a discrete point on one side of the target road's boundary line. The second boundary point can be a discrete point on the other side of the target road's boundary line.
[0036] Specifically, by sampling the two boundary lines of the target road, a first boundary contour line composed of multiple first boundary points and a second boundary contour line composed of multiple second boundary points can be obtained. It should be noted that the distance between two adjacent first boundary points is random and not fixed. The distance between two adjacent second boundary points is also random and not fixed. The geometric shapes of the first and second boundary contour lines are also different. The lengths of the first and second boundary contour lines can be the same or different. The first boundary contour line can be obtained by connecting the first boundary points with the shortest straight-line distance on one side of the target road boundary line, and the second boundary contour line can be obtained by connecting the second boundary points with the shortest straight-line distance on the other side of the target road boundary line. For example, as shown... Figure 2 As shown, the points of the triangle are the first boundary points, and the corresponding lines are the first boundary contour lines. The points of the rhombus are the second boundary points, and the corresponding lines are the second boundary contour lines.
[0037] S120, determine the first outer rectangle of the first boundary contour and the first projection point of each first boundary point on the first outer rectangle, and determine the second outer rectangle of the second boundary contour and the second projection point of each second boundary point on the second outer rectangle.
[0038] The first enclosing rectangle can refer to the rectangle circumscribed by the first boundary contour line, that is, the rectangle that exactly encloses the first boundary contour line. For example, the first enclosing rectangle can be the largest rectangle that can be enclosed by the x and y coordinates of the first boundary points. The first projection point can be the intersection of the perpendicular lines from each of the first boundary points and any long side of the first enclosing rectangle. The second enclosing rectangle can refer to the rectangle circumscribed by the second boundary contour line, that is, the rectangle that exactly encloses the second boundary contour line. For example, the second enclosing rectangle can be the largest rectangle that can be enclosed by the x and y coordinates of the second boundary points. The second projection point can be the intersection of the perpendicular lines from each of the second boundary points and any long side of the second enclosing rectangle.
[0039] Specifically, based on the x and y coordinates of each first boundary point in the first boundary contour line, a first outer rectangle is determined, and the intersection of the perpendicular line from each first boundary point with the long side of the corresponding outer rectangle is taken as the first projection point. Similarly, based on the x and y coordinates of each second boundary point in the second boundary contour line, a second outer rectangle is determined, and the intersection of the perpendicular line from each second boundary point with the long side of the corresponding outer rectangle is taken as the second projection point. For example, as... Figure 2 As shown, the perpendicular line from the first boundary point intersects the long side of the outer rectangle, and the intersection point of the circles in the figure is the corresponding projection point.
[0040] For example, "determining the first outer rectangle of the first boundary contour line" in S120 may include: determining the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate corresponding to the first boundary contour line based on the coordinate information of each first boundary point; using the minimum value of the horizontal coordinate and the minimum value of the vertical coordinate as the coordinate information of the lower left corner of the first outer rectangle, and using the maximum value of the horizontal coordinate and the maximum value of the vertical coordinate as the coordinate information of the upper right corner of the first outer rectangle, to construct the first outer rectangle corresponding to the first boundary contour line.
[0041] Specifically, the horizontal and vertical coordinates of each first boundary point are compared, and the maximum and minimum horizontal coordinates, maximum and minimum vertical coordinates of the first boundary contour line are determined based on the comparison results. The point formed by the maximum horizontal and vertical coordinates is taken as the upper right corner of the first outer rectangle, and the point formed by the minimum horizontal and vertical coordinates is taken as the lower left corner of the first outer rectangle. A rectangle is constructed based on the upper right and lower left corner coordinates.
[0042] For example, the coordinates of the first boundary point can be (1,2), (2,1), (3,4), or (4,3). If the maximum x-coordinate of the first boundary contour line is determined to be 4, the minimum x-coordinate to be 1, the maximum y-coordinate to be 4, and the minimum y-coordinate to be 1, then (4,4) is used as the upper right corner coordinate of the first outer rectangle, and (1,1) is used as the lower left corner coordinate of the first outer rectangle, thus constructing the first outer rectangle corresponding to the first boundary contour line.
[0043] It should be noted that the process of determining the second outer rectangle can refer to the process of determining the first outer rectangle, and will not be repeated here.
[0044] S130. Extend the line connecting each first boundary point and the corresponding first projection point to determine the first associated point that intersects with the second boundary contour line, and take the midpoint between each first boundary point and the corresponding first associated point as the first feature point corresponding to the first boundary point.
[0045] Here, the first associated point can be the intersection of the extension of the line connecting each first boundary point to its corresponding first projection point and the second boundary contour line. The first feature point can be the road center point corresponding to the first boundary point.
[0046] Specifically, each first boundary point is connected to its corresponding first projection point, and the connecting line is extended bidirectionally until it intersects with the second boundary contour line. The midpoint of the line connecting each intersection point to its corresponding first boundary point is taken as the first feature point corresponding to each first boundary point. For example, as shown... Figure 2 As shown, the points of the trapezoid are the associated points, the points of the hexagon are the midpoints between the points of the triangle and the trapezoid, and the points of the hexagon are the first feature points corresponding to the first boundary points.
[0047] For example, "extending the line connecting each first boundary point to the corresponding first projection point and determining the first associated point intersecting with the second boundary contour line" in S130 may include: determining the distance between each first boundary point and the corresponding first projection point, and determining the target extension distance based on the maximum distance; extending the line connecting each first boundary point to the corresponding first projection point in both directions based on the target extension distance; and determining the intersection point of the extension line corresponding to the first boundary point and the second boundary contour line as the first associated point corresponding to the first boundary point.
[0048] The target extension distance can refer to a preset multiple of the maximum distance between the first boundary point and the first projection point. For example, when the preset multiple is 3, the maximum distance between the first boundary point and the first projection point is 20 meters, then the target extension distance can be 60 meters.
[0049] Specifically, the distance between each first boundary point and its corresponding first projection point is determined, and a preset multiple of the maximum distance, such as 3 times, is used as the target extension distance. The line connecting each first boundary point and its corresponding first projection point is extended bidirectionally to achieve this target extension distance until it intersects with the second boundary contour line. The intersection point at this point is determined as the first associated point corresponding to the first boundary point.
[0050] S140. Extend the line connecting each second boundary point and the corresponding second projection point to determine the second associated point that intersects with the first boundary contour line, and take the midpoint between each second boundary point and the corresponding second associated point as the second feature point corresponding to the second boundary point.
[0051] Specifically, each second boundary point is connected to its corresponding second projection point, and the connecting line is extended in both directions until it intersects with the first boundary contour line. The midpoint of the line connecting each intersection point and its corresponding second boundary point is taken as the second feature point corresponding to each second boundary point.
[0052] For example, the distance between each second boundary point and the corresponding second projection point is determined, and the target extension distance is determined based on the maximum distance. Based on the target extension distance, the line connecting each second boundary point and the corresponding second projection point is extended in both directions. The intersection point of the extension line corresponding to the second boundary point and the second boundary contour line is determined as the second associated point corresponding to the second boundary point.
[0053] It should be noted that the process of determining the second feature point corresponding to the second boundary point is the same as the process of determining the second feature point corresponding to the first boundary point. Please refer to the relevant descriptions above, and they will not be repeated here.
[0054] S150. Based on the changing direction of the boundary contour line, sort each first feature point and each second feature point, and determine the center line corresponding to the target road based on the sorted feature point sequence.
[0055] The direction of change of the boundary outline can refer to the direction from the starting node to the ending node. The centerline can refer to the line segment used to mark the center of the road.
[0056] Specifically, since the identified first and second feature points are unordered, they need to be sorted according to the direction from the start node to the end node. For example, the first and second feature points can be sorted sequentially according to the direction of change of the first or second boundary contour line to obtain a feature point sequence. This feature point sequence can be directly used as the centerline of the target road. In other words, the centerline of the target road is composed of the feature point sequence. Alternatively, the feature points in the sequence can be connected sequentially, and the final line can be used as the centerline of the target road.
[0057] The technical solution of this invention involves obtaining first and second boundary contour lines on both sides of a target road; determining a first outer rectangle of the first boundary contour line and a first projection point of each first boundary point on the first outer rectangle; determining a second outer rectangle of the second boundary contour line and a second projection point of each second boundary point on the second outer rectangle; extending the line connecting each first boundary point to its corresponding first projection point to determine a first associated point intersecting the second boundary contour line; and using the midpoint between each first boundary point and its corresponding first associated point as a first feature point corresponding to the first boundary point; and connecting each second boundary point to its corresponding first feature point. The line connecting the two projection points is extended to determine the second associated point that intersects with the first boundary contour line. The midpoint between each second boundary point and the corresponding second associated point is taken as the second feature point corresponding to the second boundary point. Based on the changing direction of the boundary contour line, each first feature point and each second feature point is sorted. Based on the sorted feature point sequence, the center line corresponding to the target road is determined. Thus, the center line corresponding to the road can be quickly and accurately determined by projection and extension intersection method without data fitting, thereby improving the efficiency and accuracy of determining the road center line. Moreover, the merged center line can perfectly preserve the geometry of the original two lines.
[0058] Based on the above technical solution, the method further includes: if there is an extension line corresponding to the first boundary point of the target that does not intersect with the second boundary contour line, then determine the distance between the first boundary point of the target and each second boundary point, and determine the second boundary point with the smallest distance as the first associated point corresponding to the first boundary point of the target.
[0059] Here, the target first boundary point refers to the first boundary point that does not intersect with the second boundary contour line. Specifically, the distance between each target first boundary point and its corresponding first projection point is determined, and a preset multiple of the maximum distance is used as a threshold. The line connecting each target first boundary point and its corresponding first projection point is extended bidirectionally. If there is a target first boundary point that does not intersect with the second boundary contour line, then the second boundary point with the smallest distance between the target first boundary point and each second boundary point is taken as the first associated point corresponding to the target first boundary point.
[0060] For example, when the target road is L-shaped, the line connecting the first boundary point of the target at the corner and the corresponding first projection point is extended bidirectionally. Since there is no intersection with the second boundary contour line, the second boundary point with the smallest distance between the first boundary point and each second boundary point is selected as the first associated point corresponding to the first boundary point. Alternatively, when the lengths of the first and second boundary contour lines are inconsistent—for example, the first boundary contour line is longer than the second boundary contour line—the extension line corresponding to the starting or ending node of the first boundary contour line may not intersect with the second boundary contour line.
[0061] Example 2
[0062] Figure 3 This is a flowchart of a method for determining a road centerline according to Embodiment 2 of the present invention. This embodiment optimizes the step "determining the direction of change of the boundary contour line" based on the above embodiments. Explanations of terms that are the same as or corresponding to those in the above embodiments will not be repeated here.
[0063] See Figure 3 Another method for determining the road centerline provided in this embodiment specifically includes the following steps:
[0064] S210. Obtain the first boundary contour line and the second boundary contour line on both sides of the target road, wherein the first boundary contour line is composed of multiple first boundary points and the second boundary contour line is composed of multiple second boundary points.
[0065] S220, determine the first outer rectangle of the first boundary contour and the first projection point of each first boundary point on the first outer rectangle, and determine the second outer rectangle of the second boundary contour and the second projection point of each second boundary point on the second outer rectangle.
[0066] S230. Extend the line connecting each first boundary point and the corresponding first projection point to determine the first associated point that intersects with the second boundary contour line, and take the midpoint between each first boundary point and the corresponding first associated point as the first feature point corresponding to the first boundary point.
[0067] S240. Extend the line connecting each second boundary point and the corresponding second projection point to determine the second associated point that intersects with the first boundary contour line, and take the midpoint between each second boundary point and the corresponding second associated point as the second feature point corresponding to the second boundary point.
[0068] S250. Based on the coordinate information of each first feature point, determine the variance of the first abscissa and the variance of the first ordinate corresponding to each first feature point.
[0069] Wherein, the first horizontal coordinate variance can refer to the value used to identify the degree of deviation of the horizontal coordinate of each first feature point from its average value, and the first vertical coordinate variance can refer to the value used to identify the degree of deviation of the vertical coordinate of each first feature point from its average value.
[0070] Specifically, based on the x-coordinate information of each first feature point, the variance of the first x-coordinate corresponding to each first feature point is calculated, and based on the y-coordinate information of each first feature point, the variance of the first y-coordinate corresponding to each first feature point is calculated.
[0071] S260. Based on the coordinate information of each second feature point, determine the variance of the second abscissa and the variance of the second ordinate corresponding to each second feature point.
[0072] The second horizontal axis variance can be a value used to identify the degree of deviation of the horizontal axis of each second feature point from its average value, and the second vertical axis variance can be a value used to identify the degree of deviation of the vertical axis of each second feature point from its average value.
[0073] Specifically, based on the x-coordinate information of each second feature point, the variance of the second x-coordinate corresponding to each second feature point is calculated, and based on the y-coordinate information of each second feature point, the variance of the second y-coordinate corresponding to each second feature point is calculated.
[0074] S270. Compare the variance of the first horizontal coordinate with the variance of the first vertical coordinate, and compare the variance of the second horizontal coordinate with the variance of the second vertical coordinate to determine the direction of change of the boundary contour line.
[0075] Specifically, the variances of the first horizontal coordinate and the first vertical coordinate are compared, as are the variances of the second horizontal coordinate and the second vertical coordinate, and the direction of the coordinate axis corresponding to the larger variance is taken as the direction of change of the boundary contour line.
[0076] For example, S270 may include: if the variance of the first horizontal coordinate is greater than the variance of the first vertical coordinate and the variance of the second horizontal coordinate is greater than the variance of the second vertical coordinate, then the direction of change of the boundary contour line is determined to be the direction of the horizontal coordinate axis; if the variance of the first horizontal coordinate is less than the variance of the first vertical coordinate and the variance of the second horizontal coordinate is less than the variance of the second vertical coordinate, then the direction of change of the boundary contour line is determined to be the direction of the vertical coordinate axis.
[0077] Specifically, if the variance of the first abscissa is greater than the variance of the first ordinate, and the variance of the second abscissa is greater than the variance of the second ordinate, then the abscissa deviation of the first feature point and the second feature point is greater than the ordinate deviation, and the direction of change of the boundary contour of the target road is determined to be the abscissa direction; if the variance of the first abscissa is less than the variance of the first ordinate, and the variance of the second abscissa is less than the variance of the second ordinate, then the abscissa deviation of the first feature point and the second feature point is less than the ordinate deviation, and the direction of change of the boundary contour of the target road is determined to be the abscissa direction.
[0078] For example, if the variance of the first abscissa is 10, the variance of the first ordinate is 1.5, the variance of the second abscissa is 10.5, and the variance of the second ordinate is 1, then the abscissa deviation of the first feature point and the second feature point is greater than the ordinate deviation, and the direction of change of the boundary contour of the target road is the abscissa direction; if the variance of the first abscissa is 1.5, the variance of the first ordinate is 10, and the variance of the second abscissa is 1, and the variance of the second ordinate is 10.5, then the abscissa deviation of the first feature point and the second feature point is less than the ordinate deviation, and the direction of change of the boundary contour of the target road is the abscissa direction.
[0079] S280. Based on the changing direction of the boundary contour line, sort each first feature point and each second feature point, and determine the center line corresponding to the target road based on the sorted feature point sequence.
[0080] For example, the "sorting of each first feature point and each second feature point based on the changing direction of the boundary contour line" in S280 may include: if the changing direction of the boundary contour line is the horizontal axis direction, then sorting each first feature point and each second feature point in ascending order of horizontal coordinate; if the changing direction of the boundary contour line is the vertical axis direction, then sorting each first feature point and each second feature point in ascending order of vertical coordinate.
[0081] Specifically, if the direction of change of the boundary contour line is the same as the direction of the horizontal axis, then the first feature points and the second feature points are sorted according to the size relationship of the horizontal coordinates; if the direction of change of the boundary contour line is the same as the direction of the vertical axis, then the first feature points and the second feature points are sorted according to the size relationship of the vertical coordinates.
[0082] For example, if there is a discrepancy between the first x-coordinate variance and the second y-coordinate variance, or vice versa, indicating that the road may be an L-shaped road with significant variations, then the comparison results are likely inconsistent. In this case, the road can be segmented and sorted according to the direction of change between each pair of adjacent boundary points on the first or second boundary line. For instance, if the direction of change between two adjacent boundary points is along the x-coordinate axis, then the feature points within the x-coordinate range of those two adjacent boundary points are sorted according to the x-coordinate axis. If the direction of change between two adjacent boundary points is along the y-coordinate axis, then the feature points within the x-coordinate range of those two adjacent boundary points are sorted according to the y-coordinate axis.
[0083] The technical solution of this invention, by comparing the variance of the first horizontal coordinate with the variance of the first vertical coordinate, and by comparing the variance of the second horizontal coordinate with the variance of the second vertical coordinate, can more accurately and quickly determine the direction of change of the boundary contour line, thereby further improving the efficiency and accuracy of determining the road centerline.
[0084] Example 3
[0085] Figure 4 This is a schematic diagram of a road center determination device provided in Embodiment 3 of the present invention. Figure 4 As shown, the device specifically includes: a boundary contour line acquisition module 410, a projection point determination module 420, a first feature point determination module 430, a second feature point determination module 440, and a center line determination module 450.
[0086] The boundary contour line acquisition module 410 is used to acquire the first boundary contour line and the second boundary contour line on both sides of the target road. The first boundary contour line is composed of a plurality of first boundary points, and the second boundary contour line is composed of a plurality of second boundary points.
[0087] The projection point determination module 420 is used to determine the first outer rectangle of the first boundary contour line and the first projection point of each first boundary point on the first outer rectangle, and to determine the second outer rectangle of the second boundary contour line and the second projection point of each second boundary point on the second outer rectangle.
[0088] The first feature point determination module 430 is used to extend the line connecting each first boundary point and the corresponding first projection point, determine the first associated point that intersects with the second boundary contour line, and take the midpoint between each first boundary point and the corresponding first associated point as the first feature point corresponding to the first boundary point.
[0089] The second feature point determination module 440 is used to extend the line connecting each second boundary point and the corresponding second projection point to determine the second associated point that intersects with the first boundary contour line, and to take the midpoint between each second boundary point and the corresponding second associated point as the second feature point corresponding to the second boundary point.
[0090] The centerline determination module 450 is used to sort each first feature point and each second feature point based on the changing direction of the boundary contour line, and determine the centerline corresponding to the target road based on the sorted feature point sequence.
[0091] The technical solution of this embodiment involves obtaining the first and second boundary contour lines on both sides of the target road; determining the first outer rectangle of the first boundary contour line and the first projection point of each first boundary point on the first outer rectangle, and determining the second outer rectangle of the second boundary contour line and the second projection point of each second boundary point on the second outer rectangle; extending the line connecting each first boundary point to its corresponding first projection point to determine the first associated point intersecting with the second boundary contour line, and taking the midpoint between each first boundary point and its corresponding first associated point as the first feature point corresponding to the first boundary point; and connecting each second boundary point to its corresponding... The line connecting the second projection points is extended to determine the second associated point that intersects with the first boundary contour line. The midpoint between each second boundary point and the corresponding second associated point is taken as the second feature point corresponding to the second boundary point. Based on the changing direction of the boundary contour line, each first feature point and each second feature point are sorted. Based on the sorted feature point sequence, the center line corresponding to the target road is determined. Thus, the center line corresponding to the road can be quickly and accurately determined by projection and extension intersection method without data fitting, thereby improving the efficiency and accuracy of determining the road center line. Moreover, the merged center line can perfectly retain the geometry of the original two lines.
[0092] Optionally, the projection point determination module 420 includes:
[0093] The outer rectangle determination unit is used to determine the maximum and minimum values of the horizontal coordinate, the maximum and minimum values of the vertical coordinate, and the minimum value of the vertical coordinate corresponding to the first boundary contour line based on the coordinate information of each first boundary point; using the minimum horizontal coordinate and the minimum vertical coordinate as the coordinate information of the lower left corner of the first outer rectangle, and using the maximum horizontal coordinate and the maximum vertical coordinate as the coordinate information of the upper right corner of the first outer rectangle, to construct the first outer rectangle corresponding to the first boundary contour line.
[0094] Optionally, the first feature point determination module 430 includes:
[0095] The first associated point determination unit is used to determine the distance between each first boundary point and the corresponding first projection point, and to determine the target extension distance based on the maximum distance; based on the target extension distance, the line connecting each first boundary point and the corresponding first projection point is extended bidirectionally; and the intersection point of the extension line corresponding to the first boundary point and the second boundary contour line is determined as the first associated point corresponding to the first boundary point.
[0096] Optionally, the first association point determination unit further includes:
[0097] If the extension line corresponding to the first boundary point of the target does not intersect with the second boundary contour line, then the distance between the first boundary point of the target and each second boundary point is determined, and the second boundary point with the smallest distance is determined as the first associated point corresponding to the first boundary point of the target.
[0098] Optionally, the device further includes:
[0099] The first variance determination module is used to determine the first abscissa variance and the first ordinate variance of each first feature point based on the coordinate information of each first feature point.
[0100] The second variance determination module is used to determine the second abscissa variance and the second ordinate variance of each second feature point based on the coordinate information of each second feature point.
[0101] The change direction determination module is used to compare the first abscissa variance with the first ordinate variance, and to compare the second abscissa variance with the second ordinate variance to determine the change direction of the boundary contour line.
[0102] Optionally, the change direction determination module is specifically used for:
[0103] If the variance of the first horizontal coordinate is greater than the variance of the first vertical coordinate, and the variance of the second horizontal coordinate is greater than the variance of the second vertical coordinate, then the direction of change of the boundary contour line is determined to be the direction of the horizontal coordinate axis; if the variance of the first horizontal coordinate is less than the variance of the first vertical coordinate, and the variance of the second horizontal coordinate is less than the variance of the second vertical coordinate, then the direction of change of the boundary contour line is determined to be the direction of the vertical coordinate axis.
[0104] Optionally, the centerline determining module 450 includes:
[0105] The feature point sorting unit is used to sort the first feature points and the second feature points in ascending order of their horizontal coordinates if the direction of change of the boundary contour line is the horizontal axis direction; and to sort the first feature points and the second feature points in ascending order of their vertical coordinates if the direction of change of the boundary contour line is the vertical axis direction.
[0106] The road centerline determination device provided in this embodiment of the invention can execute the road centerline determination method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
[0107] Figure 5A schematic diagram of an electronic device 12 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as desktop computers, workbenches, servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0108] like Figure 5 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0109] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0110] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0111] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 5 Not shown; usually referred to as a "hard drive"). Although Figure 5Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0112] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0113] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with electronic device 12, and / or with any device that enables electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0114] Processing unit 16 executes various functional applications and data processing by running programs stored in system memory 28, such as implementing the steps of a road centerline determination method provided in this embodiment, the method including:
[0115] Obtain the first boundary contour line and the second boundary contour line on both sides of the target road, wherein the first boundary contour line is composed of multiple first boundary points and the second boundary contour line is composed of multiple second boundary points;
[0116] Determine a first outer rectangle of the first boundary contour and a first projection point of each first boundary point on the first outer rectangle; and determine a second outer rectangle of the second boundary contour and a second projection point of each second boundary point on the second outer rectangle.
[0117] Extend the line connecting each first boundary point to the corresponding first projection point to determine the first associated point that intersects with the second boundary contour line, and take the midpoint between each first boundary point and the corresponding first associated point as the first feature point corresponding to the first boundary point;
[0118] Extend the line connecting each second boundary point to the corresponding second projection point to determine the second associated point that intersects with the first boundary contour line, and take the midpoint between each second boundary point and the corresponding second associated point as the second feature point corresponding to the second boundary point;
[0119] Based on the changing direction of the boundary contour line, each first feature point and each second feature point are sorted, and based on the sorted feature point sequence, the centerline corresponding to the target road is determined.
[0120] Of course, those skilled in the art will understand that the processor can also implement the technical solution of the road centerline determination method provided in any embodiment of the present invention.
[0121] This embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the road centerline determination method steps provided in any embodiment of the present invention, the method comprising:
[0122] Obtain the first boundary contour line and the second boundary contour line on both sides of the target road, wherein the first boundary contour line is composed of multiple first boundary points and the second boundary contour line is composed of multiple second boundary points;
[0123] Determine a first outer rectangle of the first boundary contour and a first projection point of each first boundary point on the first outer rectangle; and determine a second outer rectangle of the second boundary contour and a second projection point of each second boundary point on the second outer rectangle.
[0124] Extend the line connecting each first boundary point to the corresponding first projection point to determine the first associated point that intersects with the second boundary contour line, and take the midpoint between each first boundary point and the corresponding first associated point as the first feature point corresponding to the first boundary point;
[0125] Extend the line connecting each second boundary point to the corresponding second projection point to determine the second associated point that intersects with the first boundary contour line, and take the midpoint between each second boundary point and the corresponding second associated point as the second feature point corresponding to the second boundary point;
[0126] Based on the changing direction of the boundary contour line, each first feature point and each second feature point are sorted, and based on the sorted feature point sequence, the centerline corresponding to the target road is determined.
[0127] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0128] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0129] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0130] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0131] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computing device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0132] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for determining the centerline of a road, characterized in that, include: Obtain the first boundary contour line and the second boundary contour line on both sides of the target road, wherein the first boundary contour line is composed of multiple first boundary points and the second boundary contour line is composed of multiple second boundary points; The first bounding rectangle of the first boundary contour line and the first projection point of each first boundary point on the first bounding rectangle are determined, and the second bounding rectangle of the second boundary contour line and the second projection point of each second boundary point on the second bounding rectangle are determined, wherein the first projection point is the intersection of the perpendicular line of each first boundary point with any long side of the first bounding rectangle, and the second projection point is the intersection of the perpendicular line of each second boundary point with any long side of the second bounding rectangle; Extend the line connecting each first boundary point to the corresponding first projection point to determine the first associated point that intersects with the second boundary contour line, and take the midpoint between each first boundary point and the corresponding first associated point as the first feature point corresponding to the first boundary point; Extend the line connecting each second boundary point to the corresponding second projection point to determine the second associated point that intersects with the first boundary contour line, and take the midpoint between each second boundary point and the corresponding second associated point as the second feature point corresponding to the second boundary point. Based on the changing direction of the boundary contour line, each first feature point and each second feature point are sorted, and based on the sorted feature point sequence, the centerline corresponding to the target road is determined.
2. The method according to claim 1, characterized in that, Determining the first outer rectangle of the first boundary contour line includes: Based on the coordinate information of each first boundary point, determine the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate corresponding to the first boundary contour line; Using the minimum horizontal coordinate and the minimum vertical coordinate as the coordinates of the lower left corner of the first outer rectangle, and using the maximum horizontal coordinate and the maximum vertical coordinate as the coordinates of the upper right corner of the first outer rectangle, a first outer rectangle corresponding to the first boundary contour line is constructed.
3. The method according to claim 1, characterized in that, Extend the line connecting each first boundary point to its corresponding first projection point to determine the first associated point intersecting the second boundary contour line, including: Determine the distance between each first boundary point and the corresponding first projection point, and determine the target extension distance based on the maximum distance. Based on the target extension distance, the line connecting each first boundary point and the corresponding first projection point is extended bidirectionally. The intersection point of the extension line corresponding to the first boundary point and the second boundary contour line is determined as the first associated point corresponding to the first boundary point.
4. The method according to claim 3, characterized in that, The method further includes: If the extension line corresponding to the first boundary point of the target does not intersect with the second boundary contour line, then the distance between the first boundary point of the target and each second boundary point is determined, and the second boundary point with the smallest distance is determined as the first associated point corresponding to the first boundary point of the target.
5. The method according to claim 1, characterized in that, The process of determining the direction of change of the boundary contour line includes: Based on the coordinate information of each first feature point, determine the first abscissa variance and the first ordinate variance of each first feature point; Based on the coordinate information of each second feature point, determine the variance of the second horizontal coordinate and the variance of the second vertical coordinate corresponding to each second feature point. The first variance of the horizontal coordinate is compared with the first variance of the vertical coordinate, and the second variance of the horizontal coordinate and the second variance of the vertical coordinate are compared to determine the direction of change of the boundary contour line.
6. The method according to claim 5, characterized in that, Comparing the first variance of the horizontal coordinate with the first variance of the vertical coordinate, and comparing the second variance of the horizontal coordinate with the second variance of the vertical coordinate, to determine the direction of change of the boundary contour line includes: If the variance of the first horizontal coordinate is greater than the variance of the first vertical coordinate, and the variance of the second horizontal coordinate is greater than the variance of the second vertical coordinate, then the direction of change of the boundary contour line is determined to be the direction of the horizontal coordinate axis. If the variance of the first horizontal coordinate is less than the variance of the first vertical coordinate, and the variance of the second horizontal coordinate is less than the variance of the second vertical coordinate, then the direction of change of the boundary contour line is determined to be the direction of the vertical coordinate axis.
7. The method according to claim 1, characterized in that, Based on the direction of change of the boundary contour line, the first feature points and the second feature points are sorted, including: If the direction of change of the boundary contour line is the horizontal axis direction, then sort the first feature points and the second feature points in ascending order of their horizontal coordinates. If the direction of change of the boundary contour line is along the vertical axis, then the first feature points and the second feature points are sorted in ascending order of their vertical coordinates.
8. A road centerline determining device, characterized in that, include: The boundary contour acquisition module acquires the first boundary contour and the second boundary contour on both sides of the target road, wherein the first boundary contour is composed of multiple first boundary points and the second boundary contour is composed of multiple second boundary points; The projection point determination module is used to determine the first outer rectangle of the first boundary contour line and the first projection point of each first boundary point on the first outer rectangle, and to determine the second outer rectangle of the second boundary contour line and the second projection point of each second boundary point on the second outer rectangle, wherein the first projection point refers to the intersection of the perpendicular line of each first boundary point with any long side of the first outer rectangle, and the second projection point refers to the intersection of the perpendicular line of each second boundary point with any long side of the second outer rectangle; The first feature point determination module is used to extend the line connecting each first boundary point and the corresponding first projection point to determine the first associated point that intersects with the second boundary contour line, and to take the midpoint between each first boundary point and the corresponding first associated point as the first feature point corresponding to the first boundary point. The second feature point determination module is used to extend the line connecting each second boundary point and the corresponding second projection point to determine the second associated point that intersects with the first boundary contour line, and to take the midpoint between each second boundary point and the corresponding second associated point as the second feature point corresponding to the second boundary point. The centerline determination module is used to sort each first feature point and each second feature point based on the changing direction of the boundary contour line, and determine the centerline corresponding to the target road based on the sorted feature point sequence.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, which is then executed by the at least one processor to enable the at least one processor to perform the road centerline determination method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the road centerline determination method according to any one of claims 1-7.
Citation Information
Patent Citations
Lane center line determining method and device
CN112115215A
Road center line extraction method and device, storage medium and terminal equipment
CN113112488A