Method for determining a cropping space, data cropping method, device and electronic equipment
By dividing road segments according to the location points of the target route and calculating the clipping space transformation matrix in the high-precision map production process, the problem of inaccurate clipping in the existing technology is solved, which improves the production efficiency of high-precision maps and the assistance effect of intelligent driving.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies fail to accurately determine the clipping space when creating high-precision maps, resulting in inaccurate clipping that affects the decision-making and perception of autonomous vehicles, especially causing severe interference in complex scenarios.
By obtaining the location points of the target route, it is divided into multiple road segments. Based on the location points of the road segments and the clipping range parameters, the transformation matrix of the clipping space is calculated. Taking into account the continuous undulation of the actual elevation and the detection range of the sensors, the gaps between adjacent road segments are corrected to improve accuracy.
The accuracy of the cropping space has been improved, allowing high-precision maps to better match the sensor detection range and visual field of intelligent driving vehicles, thereby improving the production efficiency of high-precision maps and the assistance effect of intelligent driving.
Smart Images

Figure CN116358524B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of high-precision mapping technology, and in particular to a method for determining clipping space, a data clipping method, an apparatus, and an electronic device. Background Technology
[0002] High-precision maps can be created based on point cloud data collected by LiDAR. Since the point cloud data collected by LiDAR covers a large area, existing technologies require cropping the point cloud data or existing map data during the high-precision map creation process to improve efficiency. Therefore, determining the cropping space is a necessary technical step in the high-precision map creation process, and identifying the cropping space that allows for accurate data cropping is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0003] This application provides a method for determining the clipping space, a data clipping method, an apparatus, and an electronic device, which can accurately determine the clipping space for clipping data.
[0004] Firstly, this application provides a method for determining a cutting space, the method comprising:
[0005] Obtain the target route, which consists of a series of location points;
[0006] Based on the location points, the target route is divided into at least two road segments;
[0007] Based on the location points included in the road segment and the set clipping range parameters, the transformation matrix of the clipping space corresponding to the road segment is obtained.
[0008] Optionally, obtaining the transformation matrix of the clipping space corresponding to the road segment based on the location points included in the road segment and the preset clipping range parameters includes:
[0009] Based on the starting point and ending point of the location points included in the road segment, the midpoint of the road segment and the direction vector of the clipping space are obtained.
[0010] The transformation matrix of the clipping space of the road segment is obtained based on the starting point, the midpoint, the direction vector of the clipping space, and the set clipping range parameters.
[0011] Optionally, obtaining the transformation matrix of the clipping space of the road segment based on the starting point, the midpoint, the direction vector of the clipping space, and the set clipping range parameters includes:
[0012] Based on the starting point, the midpoint, and the set cutting range parameters, the size parameters of the cutting space are obtained.
[0013] Based on the midpoint position and the direction vector of the clipping space, obtain the remaining spatial orientation parameters of the clipping space other than the direction vector;
[0014] Based on the size parameters, the direction vector of the clipping space, and the other spatial orientation parameters, a transformation matrix for the clipping space of the road segment is generated.
[0015] Optionally, the cutting range parameters include: upper limit height, lower limit height, horizontal range, and vertical range; the size parameters include: length, height, and width; and obtaining the size parameters of the cutting space based on the starting point, the midpoint, and the set cutting range parameters includes:
[0016] The length parameter is determined based on the starting point, the midpoint, and the longitudinal range value.
[0017] The height parameter is determined based on the upper limit value and the lower limit value.
[0018] The width parameter is determined based on the horizontal range value.
[0019] Optionally, the remaining spatial orientation parameters include: longitudinal vector, transverse vector, and center point position; obtaining the remaining spatial orientation parameters of the clipping space other than the direction vector based on the center point position and the direction vector of the clipping space includes:
[0020] Based on the midpoint position, obtain the longitudinal vector of the clipping space;
[0021] The center point position of the clipping space is obtained based on the vertical vector, the height parameter, and the midpoint position.
[0022] Based on the vertical vector and the direction vector of the clipping space, the horizontal vector of the clipping space is obtained.
[0023] Optionally, after obtaining the transformation matrix of the clipping space corresponding to the road segment, the method further includes:
[0024] Based on the transformation matrix of the clipping space corresponding to the road segment, obtain the clipping space corresponding to the road segment;
[0025] Determine whether there are gaps between the cut spaces of adjacent road segments;
[0026] If gaps exist, the transformation matrix of the clipping space of the adjacent road segment is modified to make the clipping space of the adjacent road segment seamless.
[0027] Optionally, the cut-off space for adjacent road segments includes: Cut-off space B i and B i+1 The determination of whether there is a gap between the cutting spaces of adjacent road segments includes:
[0028] Get the clipping space B i Mid-distance clipping space B i+1 The center point is located at the nearest first vertex;
[0029] Using the clipping space B i Using the direction vector as the normal vector, we obtain the plane passing through the first vertex;
[0030] Get the clipping space B i+1 The middle is close to the cutting space B i The second vertex of the plane;
[0031] The clipping space B is determined based on the vector distance between the second vertex and the plane. i With the cutting space B i+1 Are there any gaps between them?
[0032] Optionally, the step of obtaining the clipping space B i+1 The middle is close to the cutting space B i The second vertex of the plane includes:
[0033] Obtain the cutting space B i+1 The vertex points to the clipping space B i+1 The direction vector of the center point position;
[0034] According to the cutting space B i+1 The vertex points to the clipping space B i+1 The direction vector of the center point position, and the clipping space B i+1 The dot product of the direction vectors is used to obtain the clipping space B. i+1 The center is oriented towards the cutting space B i The second vertex of the plane.
[0035] Optionally, the transformation matrix for correcting the clipping space of the adjacent road segment includes:
[0036] Extend the cut space boundary of the adjacent road segment so that the cut spaces of the adjacent road segments intersect;
[0037] Using the resulting intersection as the vertex of the boundary, the clipping space of the adjacent road segment is regenerated;
[0038] Based on the newly generated clipping space of the adjacent road segment, the transformation matrix of the clipping space of the adjacent road segment is corrected.
[0039] Optionally, dividing the target route into at least two segments based on the location points specifically includes:
[0040] Linear fitting is performed on the location points on the target route to obtain at least two road segments of the target route.
[0041] Optionally, the step of linearly fitting the location points on the target route to obtain at least two road segments of the target route includes:
[0042] Based on a preset angle range and a preset length threshold, the position points on the target route are linearly fitted to obtain at least two road segments of the target route.
[0043] Optionally, the step of linearly fitting the position points on the target route according to a preset included angle interval and a length threshold to obtain at least two road segments of the target route includes:
[0044] Obtain the line segment L corresponding to position point j on the target route. j and line segment l j+1 The included angle between them, line segment L j Length and line segment l j+1 The length of L; j Let l be the line connecting point j and point j-1. j Alternatively, it can be a fitted line segment l′ obtained by linear fitting based on position j and at least one position point preceding said position j. j The l j+1 Let j be the line connecting point j and point j+1; where j is an integer greater than or equal to 2.
[0045] If the line segment L j and line segment l j+1 The included angle between them is outside a preset included angle range, and / or, the line segment L j The length of the line segment l is greater than or equal to a preset length threshold, and / or the line segment l j+1 If the length is greater than or equal to the length threshold, then the L j The linear fitting result of the corresponding location point is taken as a road segment, and location point j is used as the first location point to obtain the next road segment;
[0046] If the line segment L j and line segment l j+1 The included angle between them is located within the included angle range, and the line segment L jThe length of the line segment l is less than the length threshold, and the line segment l j+1 If the length is less than the length threshold, then the L j Linear fitting is performed on the corresponding position point and position point j+1;
[0047] If the location point j+1 is the last location point on the target route, then the linear fitting result is taken as a road segment;
[0048] If the location point j+1 is not the last location point on the target route, then the linear fitting result will be used as the line segment L corresponding to the location point j+1. j+1 Continue making judgments until the last location point on the target route.
[0049] Optionally, the method further includes:
[0050] If the included angle between two adjacent road segments after the division is within the included angle interval, then determine whether there are road segments with residual sum of squares greater than the preset residual sum of squares threshold.
[0051] If there are road segments in the target route whose residual sum of squares is greater than a preset residual sum of squares threshold, then select the target road segment from the road segments whose residual sum of squares is greater than the preset residual sum of squares threshold and split it into multiple road segments;
[0052] Determine if there are adjacent road segments whose sum of length is less than or equal to a preset length threshold;
[0053] If there are adjacent road segments whose sum of length is less than or equal to a preset length threshold, then the location points on the adjacent road segments are linearly fitted to merge them into one road segment.
[0054] Optionally, the method further includes:
[0055] If the included angle between two adjacent road segments in the divided road segments is outside the included angle interval, then the included angle interval is reduced, and the position points on the target route are re-linearly fitted based on the reduced included angle interval and the length threshold to obtain at least two new road segments.
[0056] If there is a road segment in the new road segment whose residual sum of squares is greater than a preset residual sum of squares threshold, then select a target road segment from the road segments whose residual sum of squares is greater than the preset residual sum of squares threshold and split it into multiple road segments.
[0057] Determine if there are adjacent road segments whose sum of length is less than or equal to a preset length threshold;
[0058] If there are adjacent road segments whose sum of length is less than or equal to a preset length threshold, then the location points on the adjacent road segments are linearly fitted to merge them into one road segment.
[0059] Secondly, this application provides a data pruning method for pruning a candidate data set corresponding to a target route, the method comprising:
[0060] Based on the method described in any of the first aspects, obtain the transformation matrix of the segmented clipping space included in the target route;
[0061] Based on the transformation matrix of the clipping space corresponding to the road segment, the data in the candidate dataset corresponding to the target route is clipped to obtain the target dataset corresponding to the target route; the candidate dataset includes: point cloud data and / or map data.
[0062] Optionally, the step of cropping the data in the candidate dataset corresponding to the target route according to the transformation matrix of the cropping space corresponding to the road segment to obtain the target dataset corresponding to the target route includes:
[0063] Obtain the camera transformation matrix and the camera projection matrix;
[0064] Based on the camera transformation matrix and the camera projection matrix, obtain the view projection matrix;
[0065] Based on the transformation matrix of the clipping space corresponding to the road segment and the view projection matrix, obtain the transformation matrix of the clipping space after the road segment is projected.
[0066] Based on the transformation matrix of the clipping space after the road segment is projected, the data in the candidate dataset corresponding to the target route is clipped to obtain the target dataset.
[0067] Thirdly, this application provides a device for determining cutting space, the device comprising:
[0068] The first acquisition module is used to acquire the target route, which consists of a series of location points;
[0069] The processing module is used to divide the target route into at least two road segments based on the location points;
[0070] The second acquisition module is used to acquire the transformation matrix of the clipping space corresponding to the road segment based on the location points included in the road segment and the set clipping range parameters.
[0071] Fourthly, this application provides a data trimming device for trimming a candidate data set corresponding to a target route, the device comprising:
[0072] The acquisition module is used to acquire the transformation matrix of the clipping space of the segmented target route based on the method described in any one of the first aspects.
[0073] The cropping module is used to crop the data in the candidate dataset corresponding to the target route according to the transformation matrix of the cropping space corresponding to the road segment, so as to obtain the target dataset corresponding to the target route; the candidate dataset includes: point cloud data and / or map data.
[0074] Fifthly, this application provides an electronic device, including: a processor and a memory; the processor is communicatively connected to the memory;
[0075] The memory stores computer instructions;
[0076] The processor executes computer instructions stored in the memory to implement the method for determining the clipping space as described in any one of the first aspects, and / or to implement the data clipping method as described in any one of the second aspects.
[0077] In a sixth aspect, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method for determining the clipping space as described in any one of the first aspects, and / or to implement the data clipping method as described in any one of the second aspects.
[0078] In a seventh aspect, this application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the method for determining the clipping space as described in any one of the first aspects, and / or implement the data clipping method as described in any one of the second aspects.
[0079] The clipping space determination method, data clipping method, apparatus, and electronic device provided in this application divide the target route into at least two road segments based on the location points included in the target route. Then, based on the location points included in the road segments and the set clipping range parameters, the transformation matrix of the clipping space corresponding to the road segments is obtained. Since the transformation matrix of the clipping space is determined based on the actual location points of the target route, this method not only takes into account the impact of continuous elevation fluctuations in the real world on high-precision map production, but also simulates the actual detection range and visual field of vehicle sensors during actual driving of intelligent vehicles, thus improving the accuracy of the determined clipping space. Attached Figure Description
[0080] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0081] Figure 1 A flowchart illustrating the first method for determining the cutting space provided in this application embodiment;
[0082] Figure 2 A schematic diagram illustrating a three-dimensional linear fitting method provided in an embodiment of this application;
[0083] Figure 3 A flowchart illustrating the second method for determining the cutting space provided in this application embodiment;
[0084] Figure 4 A flowchart illustrating the third method for determining the clipping space provided in this application embodiment;
[0085] Figure 5 A flowchart illustrating the fourth method for determining the clipping space provided in this application embodiment;
[0086] Figure 6 A schematic diagram illustrating a gap correction method provided in an embodiment of this application;
[0087] Figure 7 A flowchart illustrating the first data cropping method provided in this application embodiment;
[0088] Figure 8 A flowchart illustrating the second data cropping method provided in this application embodiment;
[0089] Figure 9 A schematic diagram of the structure of a cutting space determination device provided in an embodiment of this application;
[0090] Figure 10 This is a schematic diagram of the structure of a data cropping device provided in an embodiment of this application;
[0091] Figure 11 This is a schematic diagram of the structure of an electronic device 110 provided in an embodiment of this application.
[0092] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0093] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0094] The following is an explanation of some of the terms used in this application:
[0095] Point cloud data refers to a set of three-dimensional point data of the road environment collected by LiDAR. The road environment can include the road itself and the ground features within a certain spatial range around the road, such as speed limit and height limit signs, traffic lights, streetlights, etc.
[0096] The travel trajectory of a map data acquisition device refers to the path taken by the device during operation. For a map data acquisition device used to collect and create high-precision map data, it typically includes a laser scanner for collecting point cloud data, a visual sensor for image acquisition, and a positioning device for collecting the travel trajectory. The map data acquisition device can be deployed on a vehicle or integrated into it; that is, the travel trajectory can also refer to the travel trajectory of the vehicle carrying the map data acquisition device.
[0097] Map data: Usually expressed in vector data, which includes points and directional lines. For high-precision maps, it usually refers to the data generated by data collection devices, which are expressed in a geographic spatial coordinate system as lane-level road information and road traffic facilities, expressed in points or lines.
[0098] Linear fitting: Fitting a set of discrete points on a plane or in space to a linear function so as to minimize the sum of the distances from the discrete points to the line represented by the linear function.
[0099] A shader is an editable program used to replace a fixed rendering pipeline to achieve image rendering. Alternatively, a shader can be understood as instructions used by an electronic device when performing image rendering tasks. Shaders include vertex shaders and fragment shaders. Vertex shaders are responsible for calculating the geometric relationships, such as the positional data of the vertices that make up an object, and can be executed when rendering the vertices of map elements. Fragment shaders are primarily responsible for calculating pixel colors, and can be executed when rendering the pixels on the screen.
[0100] Currently, the production of high-precision maps involves creating map data from collected point cloud data, and then rendering this map data to produce a high-precision map. Because point cloud data collected by LiDAR covers a large area, existing technologies require cropping the point cloud data or existing map data during the high-precision map production process to improve efficiency. Therefore, determining the cropping space is a necessary technical step in the high-precision map production process.
[0101] Currently, the clipping space is determined solely using fixed elevations. However, this method does not consider the interference caused by map data in complex scenarios such as upper and lower levels, lane merging and branching, oncoming traffic, and roundabouts, resulting in low accuracy of the clipping space determined by this method. Consequently, the high-precision maps created based on this method cannot match the sensor detection range and visual field of autonomous vehicles under interference-free conditions, affecting the high-precision maps' ability to assist and support decision-making and perception in autonomous driving.
[0102] For example, in scenarios with multiple levels of interchanges, using only a fixed elevation to determine the clipping space may retain the map data of the upper level of the interchange, which could cause the high-precision map created based on it to interfere with the intelligent driving decision-making and perception of autonomous vehicles.
[0103] A viewing cone is the shape of the area that a camera device (such as a camera) can see. In the actual driving process of an intelligent driving vehicle, the actual detection range and visual field of the vehicle's sensors constitute the viewing cone of that sensor. The inventors considered that simulating the detection range and visual field distance of sensors in real-world intelligent driving vehicles would improve the accuracy of the clipping space determined accordingly.
[0104] In view of this, this application provides a method for determining the clipping space. This method determines the clipping space based on the actual driving route. It not only takes into account the impact of continuous elevation fluctuations in the real world on the production of high-precision maps, but also further simulates the actual detection range and visual field of vehicle sensors during the actual driving process of intelligent driving vehicles, thereby improving the accuracy of the determined clipping space.
[0105] The clipping space determination method of this application can be applied to the filtering and clipping of point cloud data and / or map data during map production. This application does not limit the type of map data mentioned above; for example, it can be a high-precision map or a standard-precision map. The clipping space determination method of this application can also be applied to intelligent driving simulation scenarios. For example, it can be used to evaluate the rationality of navigation routes planned by navigation services. The navigation route mentioned here can be, for example, a navigation route used to guide intelligent driving vehicles.
[0106] Subject to compliance, the implementing entity of this application may be an electronic device (e.g., a server), a computer cluster, or a cloud computing platform located in the cloud. The following describes the technical solution of this application in detail using an electronic device as an example, in conjunction with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0107] Figure 1This is a flowchart illustrating a method for determining the cutting space provided in an embodiment of this application. Figure 1 As shown, the method may include the following steps:
[0108] S101. Obtain the target route, which consists of a series of location points.
[0109] The aforementioned target route can be, for example, a navigation route or a driving trajectory, depending on the specific application scenario of this application. The target route can be any route within either a navigation route or a driving trajectory, and this application does not limit it. When the target route is a driving trajectory, the location points can be, for example, trajectory points constituting the driving trajectory; when the target route is a navigation route, the location points can be, for example, shape points, i.e., points generated when creating roads in an electronic map. This application does not limit the number of location points included in the target route.
[0110] The electronic device may store the aforementioned target route, or it may retrieve the target route from other storage media or devices. Other devices may be, for example, servers, or, when the target route is a driving trajectory, map data acquisition devices.
[0111] S102. Based on the location points, divide the target route into at least two segments.
[0112] For example, an electronic device can divide a target route into at least two road segments, each containing the same number of location points, based on a preset number of location points for each road segment. This application does not limit the specific value of the preset number of location points for each road segment.
[0113] Alternatively, the electronic device can obtain at least two road segments of the target route by performing linear fitting on the position points on the target route. For example, the electronic device can perform linear fitting on the position points on the target route that meet preset linear fitting conditions, thereby obtaining at least two road segments of the target route. The aforementioned linear fitting conditions can be determined, for example, based on the included angle and length of adjacent line segments formed by the position points on the target line segment.
[0114] Alternatively, electronic devices can thin out the location points of the target route, and then perform linear fitting on the thinned location points to obtain at least two road segments of the target route.
[0115] S103. Based on the location points included in the road segment and the set clipping range parameters, obtain the transformation matrix of the clipping space corresponding to the road segment.
[0116] This application does not limit the dimensions of the cropping range parameters set above, nor the specific values of the parameters in different dimensions. For example, the cropping range parameters may include one or more of the following: upper limit height value, lower limit height value, horizontal range value, vertical range value, etc.
[0117] This application does not limit the acquisition of the transformation matrix of the clipping space corresponding to the road segment to the location points included in the road segment and the set clipping range parameters; the specific details depend on the contents of the transformation matrix. For example, an electronic device can obtain the midpoint of the road segment and the direction vector of the clipping space based on the starting point and the ending point among the location points included in the road segment; then, based on the starting point, the midpoint, the direction vector of the clipping space, and the set clipping range parameters, it can obtain the transformation matrix of the clipping space of the road segment.
[0118] In this embodiment, the electronic device divides the target route into at least two segments based on the location points included in the target route. Then, based on the location points included in the segment and the set clipping range parameters, it obtains the transformation matrix of the clipping space corresponding to the segment. Since the transformation matrix of the clipping space is determined based on the actual location points of the target route, this method not only takes into account the impact of continuous elevation fluctuations in the real world on high-precision map production, but also further simulates the actual detection range and visual field of the vehicle's sensors during actual driving of an intelligent driving vehicle, thus improving the accuracy of the determined clipping space.
[0119] The following example illustrates how to obtain at least two road segments of the target route, i.e., step S102 in the above embodiment, by performing linear fitting on the location points on the target route.
[0120] It should be understood that the linear fitting method is related to the dimension of the coordinate system used by the current map. For example, if the current map's coordinate system is a three-dimensional coordinate system, then three-dimensional linear fitting can be used; if the current map's coordinate system is a two-dimensional coordinate system, then two-dimensional linear fitting can be used. This application does not limit the specific method of linear fitting for the location points on the target route. For example, when using three-dimensional linear fitting, the electronic device can perform fitting based on the least squares fitting function, or based on a MATLAB fitting function.
[0121] This application does not limit the implementation method of the above-described linear fitting. In some embodiments, the electronic device can, for example, perform linear fitting on the position points on the target route according to a preset angle interval and / or a preset length threshold to obtain at least two road segments of the target route. The angle interval can be set, for example, by the angle threshold. For example, the angle interval can be [π-δ, π+δ], where δ is the angle threshold. That is, the size of the angle interval is positively correlated with the angle threshold. Based on this, this application does not limit the specific value of the angle threshold, the specific length of the above-described angle interval, or the specific value of the length threshold; those skilled in the art can determine these values according to the actual situation.
[0122] For example, Figure 2 A schematic diagram of a three-dimensional linear fitting method provided in an embodiment of this application is shown below. Figure 2 As shown, the electronic device can obtain the line segment L corresponding to the position point j on the target route. j and line segment l j+1 The included angle between them, line segment L j Length and line segment l j+1 The length of . Where j is an integer greater than or equal to 2.
[0123] Among them, l j+1 Let L be the line connecting point j and point j+1. j Let l be the line connecting point j and point j-1. j Alternatively, it can be a fitted line segment l′ obtained by linear fitting based on position j and at least one position point preceding position j. j .
[0124] For example, when j equals 2, then L j Let l be the line connecting point j and point j-1. j When j is greater than 2, and position j cannot be linearly fitted to at least one position point preceding position j, then L j Let l be the line connecting point j and point j-1. j When j is greater than 2, and position j can be linearly fitted to at least one position point preceding position j, then L j A fitted line segment l′ is obtained by linear fitting based on position j and at least one position point preceding position j. j .
[0125] In this implementation, the electronic device obtains the line segment L corresponding to the position point j on the target route. j and line segment l j+1 The included angle between them, line segment L j Length and line segment l j+1 The length of line segment L is determined, and then its relationship with a preset angle range and a preset length threshold is analyzed. j and line segment l j+1 The closer the included angle is to π, the stronger the line segment L is. j The smaller the change in direction between the corresponding position point and position point j+1 on the target route, the more likely L will be changed. j The closer the linear fit is to the actual route trajectory, the better the corresponding location point, and the closer the location point j+1 is to the actual route trajectory. It should be understood that L mentioned here... j The corresponding location point is the one used to obtain L on the target route. j Location point.
[0126] Conversely, if line segment L jand line segment l j+1 If the included angle is smaller, then L j Linear fitting is performed on the corresponding location points, and at location point j+1. The resulting fitted line segment may differ significantly from the actual route, which is detrimental to the accuracy of the subsequent clipping space obtained from the fitted line segment. Furthermore, if line segment L... j or line segment l j+1 If it is too long, then L j The higher the probability that the line segment obtained by linear fitting the corresponding position point and position point j+1 deviates from the actual route.
[0127] Therefore, in this implementation, the electronic device determines the line segment L. j and line segment l j+1 Whether the included angle is outside the included angle range, and whether line segment L j or line segment l j+1 Whether the length is greater than a preset length threshold is used to determine the location point that meets the linear fitting condition.
[0128] If line segment L j and line segment l j+1 The included angle between them is outside the preset included angle range, and / or, line segment L j The length is greater than or equal to a preset length threshold, and / or, line segment l j+1 If the length is greater than or equal to the length threshold, then L will be... j The linear fitting result of the corresponding location point is taken as a road segment, and location point j is taken as the first location point to obtain the next road segment.
[0129] If line segment L j and line segment l j+1 The included angle between them lies within the included angle interval, and line segment L j The length of line segment l is less than the length threshold, and line segment l j+1 If the length is less than the length threshold, then L will be... j Linear fitting is performed on the corresponding position point and position point j+1.
[0130] If location j+1 is the last location on the target route, then the linear fitting result is taken as a road segment.
[0131] If position j+1 is not the last position on the target route, then the linear fitting result will be used as the line segment L corresponding to position j+1. j+1 Continue making judgments until the last location on the target route.
[0132] For example, taking a case where j equals 3 and position 3 can be linearly fitted with the two position points preceding it, L3 is a fitted line segment l′3 obtained by linearly fitting position 3 with the two position points preceding it. The electronic device determines whether the angle between line segment L3 and line segment l4 is outside the included angle range, and whether the length of line segment L3 or line segment l4 is greater than a preset length threshold, thereby determining the position point that satisfies the linear fitting condition. The aforementioned l4 is the line connecting position 4 and position 3.
[0133] If the angle between line segment L3 and line segment l4 is outside the preset angle range, and / or, line segment L j If the length of line segment l3 is greater than or equal to a preset length threshold, and / or the length of line segment l4 is greater than or equal to the length threshold, then the linear fitting result of the position points corresponding to L3 (i.e., position points 1, 2, and 3) is taken as a road segment, and position point 3 is taken as the first position point to obtain the next road segment. L4 and l5 are then evaluated. Here, L4 is the line connecting position points 3 and 4, and l5 is the line connecting position points 4 and 5.
[0134] If the angle between line segments L3 and L4 lies within the included angle interval, and the lengths of both L3 and L4 are less than the length threshold, then a linear fit is performed on the position points corresponding to L3 and L4. If L4 is the last position point on the target route, the linear fit result is taken as a road segment. If L4 is not the last position point on the target route, the linear fit result is used as the line segment L4 corresponding to L4 for further evaluation, i.e., the angle and length relationship between L4 and L5 is evaluated until the last position point on the target route.
[0135] It should be understood that this application does not limit the above-mentioned determination of line segment L. j or line segment l j+1 Whether the included angle is outside the included angle range, and whether line segment L j or line segment l j+1 The execution order of whether the length is greater than the preset length threshold can be as follows: they can be executed simultaneously, or the angle judgment can be executed first and then the length judgment, or the length judgment can be executed first and then the angle judgment.
[0136] In this way, electronic devices can perform linear fitting on the location points on the target route, that is, they can perform linear fitting on location points with small directional differences, so that the generated road segments can better fit the actual target route. Furthermore, the corresponding clipping space obtained from the generated road segments will also be more accurate.
[0137] Optionally, electronic devices can correct the segmentation of the target route. This allows for a secondary check of the segments included in the target route, improving the rationality of the segment division and making it more consistent with the actual route trajectory.
[0138] For example, the conditions that trigger the execution of the correction may include:
[0139] Condition 1: The included angle between two adjacent road segments is outside the included angle interval, and / or, Condition 2: The sum of squared residuals of the road segments is greater than a preset residual sum of squared threshold. It should be noted that the included angle between two adjacent road segments represents the included angle between the line segments corresponding to the two adjacent road segments, and the sum of squared residuals of the road segments refers to the sum of squared residuals of the line segments corresponding to the road segments. This application does not limit the included angle interval, nor does it specify the exact value of the preset residual sum of squared threshold. The method by which the electronic device corrects the road segments of the target route is related to the preset conditions satisfied by at least one road segment of the target route.
[0140] When only one correction condition is included, such as condition 1 or condition 2, the electronic device can, after judgment, apply the corresponding correction method if the condition is met. This correction can be a single correction or an iterative correction. When using an iterative correction method, the electronic device can first perform a single correction, then determine whether the correction condition is met again, iterating until no road segment meets the correction condition, or until a preset number of corrections is reached. This application does not limit the value of the preset number of corrections; those skilled in the art can determine it based on the actual situation.
[0141] When the preset conditions include multiple correction conditions, the electronic device can first determine whether any one of the conditions is met. If it is met, it can perform iterative correction. After the correction is completed, it can determine whether the next condition is met and perform iterative correction according to the corresponding correction method. This process continues until all correction conditions are determined.
[0142] Alternatively, the electronic device can first determine whether any one of the conditions is met. If it is, it performs a correction using the corresponding method, then checks whether the next condition is met, and so on, until all correction conditions have been determined. This process can be executed only once, or iteratively, until no road segment of the target route satisfies any of the conditions, or until a preset number of iterations is reached.
[0143] Alternatively, electronic devices can simultaneously determine whether multiple conditions are met, and then take corresponding corrective measures based on the results.
[0144] As mentioned above, the method and conditions by which electronic devices correct road segments of the target route are related. For example, taking the conditions of first determining whether the angle between two adjacent road segments is outside the included angle range, and then determining whether the sum of squared residuals of the road segments is greater than a preset threshold for the sum of squared residuals as an example, the following two cases may be included:
[0145] Scenario 1: If the angle between any two adjacent road segments in the target route is within the included angle interval, the electronic device determines whether there is a road segment whose residual sum of squares is greater than a preset residual sum of squares threshold. If there is a road segment in the target route whose residual sum of squares is greater than the preset residual sum of squares threshold, the electronic device can select a target road segment (e.g., the road segment with the largest residual sum of squares) from the road segments with residual sums greater than the preset residual sum of squares threshold and split it into multiple road segments. This application does not limit the number of road segments into which the road segment is split, nor the method of splitting. For example, the electronic device can split the road segment into two road segments of equal length, or two road segments containing the same number of location points.
[0146] It should be understood that when the sum of squared residuals of a certain segment in the target route exceeds a preset threshold for the sum of squared residuals, it indicates that linear fitting of the points on the target route corresponding to that segment would result in a linearly fitted line segment that differs significantly from the target route. Therefore, the aforementioned correction method can reduce the sum of squared residuals of the segment, allowing it to fit the target route better. It should be understood that the sum of squared residuals of a certain segment mentioned here refers to the sum of squared residuals of the linearly fitted line segment corresponding to that segment.
[0147] Then, the electronic device can determine whether there are adjacent road segments whose sum of length is less than or equal to a preset length threshold. If there are adjacent road segments whose sum of length is less than or equal to the preset length threshold, the location points on the adjacent road segments are linearly fitted to merge them into one road segment. This application does not limit the specific value of the preset length threshold; those skilled in the art can determine it according to the actual situation.
[0148] The smaller the sum of the lengths of adjacent road segments, the smaller the directional change of the corresponding location point. Therefore, if there are adjacent road segments whose sum of length is less than or equal to a preset length threshold, linear fitting of the location points on these adjacent road segments can also achieve a good fit to the target route. Thus, the above implementation method can improve the fit between the road segments obtained through linear fitting and the actual target route, and can also merge road segments that can be merged, reducing the computational workload of obtaining the transformation matrix of the corresponding clipping space based on the road segments and improving computational efficiency.
[0149] This completes one correction process.
[0150] Case 2: If the included angle between two adjacent road segments in the divided road segments is outside the included angle interval, then the included angle interval is reduced, and the position points on the target route are re-linearly fitted based on the reduced included angle interval and the length threshold to obtain at least two new road segments.
[0151] That is, all points on the target route are refitted to obtain at least two new road segments of the target route. This application does not limit the magnitude of the reduction in the included angle interval; those skilled in the art can determine it according to the actual situation.
[0152] The smaller the angle between adjacent road segments, the better the linear fitting effect will be. Therefore, the above method can further optimize the linear fitting effect, reduce the situation where the angle between two adjacent road segments in the target route is outside the angle range, and make the fitted line segment fit the target route better.
[0153] If a new road segment contains a segment whose sum of squared residuals exceeds a preset threshold, the electronic device selects a target road segment from these segments and splits it into multiple road segments. Then, the electronic device determines if there are adjacent road segments whose sum of length is less than or equal to a preset length threshold. If such adjacent road segments exist, the electronic device performs linear fitting on the location points of these adjacent road segments to merge them into a single road segment.
[0154] This completes one correction process.
[0155] In the above implementation, the electronic device obtains at least two road segments of the target route by linearly fitting the position points on the target route. In this way, the electronic device can fit points with minimal directional changes into a single road segment. Subsequently, the electronic device can obtain the transformation matrix of the clipping space corresponding to the fitted road segment. On the one hand, obtaining at least two road segments of the target route through linear fitting ensures that the obtained road segments fit the target route well, thus making the obtained transformation matrix of the clipping space more accurate. On the other hand, merging points with minimal directional changes into a single road segment reduces the number of road segments, thereby reducing the computational load for obtaining the transformation matrix of the clipping space from the road segments, improving computational efficiency, optimizing the computational process, and enhancing the rationality of road segment division.
[0156] Optionally, before performing the aforementioned linear fitting on the target route, the location points on the target route can be preprocessed. The specific content of the preprocessing depends on the actual application scenario. For example, taking the target route as a driving trajectory, the electronic device can perform noise reduction processing on the location points on the target route before performing linear fitting.
[0157] One possible implementation involves the electronic device calculating the distance and height difference between any two adjacent points on the target route. If the distance between a point and both of its adjacent points exceeds a preset distance threshold, or if the height of a point exceeds a preset height threshold, then that point is removed as noise. This method removes abnormal points from the target route, ensuring that the denoised route accurately reflects the route conditions and guarantees the accuracy of the transformation matrix of the final clipping space.
[0158] The following describes how to obtain the transformation matrix of the clipping space corresponding to the road segment based on the location points included in the road segment and the set clipping range parameters, i.e., step S103 in the above embodiment.
[0159] Figure 3 A flowchart illustrating the second method for determining the clipping space provided in this application embodiment is shown below. Figure 3 As shown, S103 may include the following steps:
[0160] S201. Based on the starting point and ending point of the location points included in the road segment, obtain the midpoint of the road segment and the direction vector of the clipping space.
[0161] For example, the electronic device uses the average coordinates of the starting point and the ending point as the midpoint of the road segment. The direction vector of the aforementioned clipping space is the direction vector from the starting point to the ending point. For details on how to determine the direction vector based on the starting point and the ending point, please refer to the prior art, which will not be elaborated here.
[0162] S202. Based on the starting point, the midpoint of the road segment, the direction vector of the clipping space, and the set clipping range parameters, obtain the transformation matrix of the clipping space of the road segment.
[0163] One possible implementation involves a transformation matrix generation model. The electronic device inputs the starting point, the midpoint of the road segment, the direction vector of the clipping space, and a set clipping range parameter into this model to obtain the transformation matrix of the road segment's clipping space output by the model. This transformation matrix generation model can be any machine learning model, such as a support vector model or a neural network model.
[0164] Another possible implementation is that the electronic device can obtain the size parameters of the clipping space based on the starting point, the midpoint of the road segment, and the set clipping range parameters; then, based on the midpoint and the direction vector of the clipping space, it can obtain the remaining spatial orientation parameters of the clipping space other than the direction vector; and finally, based on the size parameters, the direction vector of the clipping space, and the remaining spatial orientation parameters, it can generate the transformation matrix of the clipping space of the road segment.
[0165] This application does not limit the dimensions included in the above-mentioned size parameters, nor the specific values of the parameters for different dimensions. For example, size parameters may include one or more of length, height, and width parameters.
[0166] Taking the cutting range parameters, including the upper and lower limit of height, the horizontal and vertical range values, and the size parameters, including the length, height, and width parameters, as an example, electronic devices can obtain size parameters in the following ways.
[0167] For example, the electronic device can determine the length parameter based on the starting point, the midpoint of the road segment, and the longitudinal range value. This length parameter can be, for example, half the length of the cutting space or the full length of the cutting space, which can be set by those skilled in the art according to the actual situation.
[0168] For example, when the length parameter is half the length of the cutting space, the electronic device can obtain the length parameter of the cutting space using formula (1).
[0169]
[0170] in, Let be the length parameter of the clipping space of the i-th road segment (referred to as the i-th clipping space). Let C be the distance between the starting point and the midpoint of the i-th road segment. l This represents the vertical range value.
[0171] Electronic devices can determine height parameters based on upper and lower height limits, for example. The height parameter value can be half the height of the cutting space or the full height of the cutting space, which can be set by those skilled in the art according to the actual situation.
[0172] For example, when the height parameter is half the height of the clipping space, the electronic device can, for example, use formula (2) to obtain the height parameter of the clipping space.
[0173]
[0174] in, Let C be the height parameter of the i-th clipping space. t C is the upper limit of the clipping space in height. b This is the lower limit of the height of the clipping space.
[0175] Electronic devices can determine the width parameter based on the horizontal range value. This width parameter can be half the width of the cutting space or the full width of the cutting space, which can be set by those skilled in the art according to the actual situation.
[0176] For example, when the width parameter of the clipping space is half the width of the clipping space, the electronic device may directly use the horizontal range value as the width parameter of the clipping space.
[0177] The other spatial orientation parameters mentioned above may include one or more of the following: the vertical vector of the clipping space, the position of the center point of the clipping space, and the horizontal vector of the clipping space.
[0178] Taking the remaining orientation parameters, including the vertical vector of the clipping space, the position of the center point of the clipping space, and the horizontal vector of the clipping space, as an example, electronic devices can obtain the remaining spatial orientation parameters in the following ways.
[0179] For example, the electronic device obtains the longitudinal vector of the clipping space based on the midpoint of the road segment. This longitudinal vector of the clipping space is the vector perpendicular to the clipping space. In specific implementations, the way the electronic device obtains the longitudinal vector of the clipping space based on the midpoint of the road segment depends on the coordinate system in which the clipping space is located. For example, the vector perpendicular to the plane containing the midpoint of the road segment can be used as the longitudinal vector of the clipping space.
[0180] The electronic device obtains the center point position of the clipping space based on the longitudinal vector and height parameters of the clipping space, as well as the midpoint position of the road segment. For example, the electronic device can obtain the center point position of the clipping space using formula (3).
[0181]
[0182] in, Let i be the center point of the clipping space. Let N be the midpoint of the i-th road segment. i Let be the vertical vector of the i-th clipping space.
[0183] The electronic device obtains the horizontal vector of the clipping space based on the vertical vector of the clipping space and the direction vector of the clipping space. For example, the electronic device can obtain the horizontal vector of the clipping space using formula (4).
[0184] W i =N i ×D i ……(4)
[0185] Among them, W i Let D be the horizontal vector of the i-th clipping space. i Let be the direction vector of the i-th clipping space.
[0186] Subsequently, the electronic device generates the transformation matrix of the clipping space for each road segment based on the size parameters, direction vector, and other spatial orientation parameters of the clipping space corresponding to that road segment. Specific implementation details can be found in existing technologies and will not be elaborated upon here.
[0187] It should be noted that the formula used to obtain the transformation matrix of the clipping space of the road segment is only for illustration. In actual applications, electronic devices may also use other formulas, or use a modified formula of the above formula to obtain the transformation matrix of the clipping space of the road segment. This application does not impose any limitations.
[0188] Another possible implementation involves using clipping space parameters including an upper height limit, a lower height limit, and a lateral range. In this case, the electronic device can, for example, directly use the distance from the starting point to the midpoint of the road segment as the length parameter of the clipping space. Then, referring to the above implementation, the remaining dimensional parameters and spatial orientation parameters of the clipping space are obtained; finally, a transformation matrix for the road segment's clipping space is generated based on the above information.
[0189] Optionally, the cropping range parameters used above can be preset or dynamically set according to configuration information. That is, the electronic device can also receive configuration information for the cropping range parameters and then configure the cropping range according to the configuration information. For example, the electronic device may include an interactive interface through which it obtains the configuration information for the cropping range parameters input by the user, and then configures the cropping range parameters according to the configuration information. In this way, the electronic device can flexibly adjust the specific value of the cropping range parameters according to the actual application scenario, expanding the application scenarios of this application and making the operation flexible and convenient.
[0190] In this embodiment, the electronic device obtains the midpoint of the road segment and the direction vector of the clipping space based on the starting point and ending point of the road segment's location points. Then, based on the starting point, the midpoint, the direction vector of the clipping space, and the set clipping range parameters, it obtains the transformation matrix of the road segment's clipping space. Through this implementation, the electronic device can obtain the transformation matrix of the road segment's clipping space according to the actual route conditions of the target route. This ensures that the obtained transformation matrix of the clipping space matches the detection range and field of view of the sensors during actual driving of the intelligent driving vehicle, improving the accuracy of the determined transformation matrix of the clipping space.
[0191] Optionally, after acquiring the clipping space of at least one segment of the target route, the electronic device can further determine whether there are gaps between the clipping spaces of adjacent segments and perform corresponding processing. Figure 4 A flowchart illustrating the third method for determining the clipping space provided in this application embodiment is shown below. Figure 4As shown, the specific steps may include the following:
[0192] S301. Obtain the clipping space corresponding to the road segment based on the transformation matrix of the clipping space corresponding to the road segment.
[0193] As mentioned above, the transformation matrix of the clipping space is used to characterize the actual position of the clipping space in the map data coordinate system. Therefore, based on the transformation matrix of the clipping space corresponding to a road segment, a unique clipping space corresponding to that road segment can be determined in space. Specific implementation methods can be found in existing technologies and will not be elaborated upon here.
[0194] S302. Determine whether there are gaps between the cut-off spaces of adjacent road sections.
[0195] If there is a gap between the cutting spaces of adjacent road segments in this step, then step S303 is executed.
[0196] The method for determining whether a gap exists depends on the specific definition of a gap in the implementation. For example, a gap can be considered to exist when there is no intersecting area between the two planes; or, a gap can be considered to exist when there is no intersecting area between the two planes and the distance between their opposing planes is greater than a preset distance; or, a gap can be considered to exist when there is a gap between their opposing planes.
[0197] Taking the scenario where a gap is considered to exist between two opposing planes as an example, assume that the clipping space of adjacent road segments includes: clipping space B i and B i+1 In this scenario, electronic devices can determine the existence of gaps in the following ways:
[0198] Figure 5 A flowchart illustrating the fourth method for determining the clipping space provided in this application embodiment is shown below. Figure 5 As shown, determining whether there are gaps between the cut-off spaces of adjacent road segments can include, for example, the following steps:
[0199] S3021, Obtain the cropping space B i Mid-distance clipping space B i+1 The center point is located at the nearest first vertex.
[0200] For example, the electronic device calculates the clipping space B. i Each vertex and clipping space B i+1 The distance from the center point is used to obtain the clipping space B. i Mid-distance clipping space B i+1 The center point is located at the nearest first vertex.
[0201] S3022, Using the trimming space Bi Using the direction vector as the normal vector, we obtain the plane passing through the first vertex.
[0202] S3023, Obtain the cropping space B i+1 B, near the cutting space i The second vertex of the aforementioned plane.
[0203] One possible implementation is that the electronic device obtains the clipping space B. i+1 The vertex points to clip space B i+1 The direction vector of the center point position; then, the electronic device according to the clipping space B i+1 The vertex points to clip space B i+1 The direction vector of the center point, and the clipping space B i+1 The dot product of the direction vectors yields the clipping space B. i+1 B, near the cutting space i The second vertex of the plane.
[0204] For example, the electronic device obtains the clipping space B corresponding to the dot product greater than 0 based on the above dot product. i+1 The vertex is the clipping space B. i+1 B, near the cutting space i The second vertex of the plane. The aforementioned clipping space B. i+1 The direction vector is the direction from the starting point to the ending point of the linearly fitted line segment corresponding to the road segment. This is because it is close to the clipping space B. i The vertices of the aforementioned plane face the clipping space B. i+1 The direction vector of the center point is in clipping space B i+1 The directions of the component vectors of the direction vector and the clipping space B i+1 Since the direction vectors are consistent, if the dot product is greater than 0, it indicates that the vertex is located in clipping space B. i+1 B, near the cutting space i The second vertex of the aforementioned plane.
[0205] Another possible implementation is that the electronic device can also obtain the clipping space B based on the spatial relationship between each vertex and the aforementioned plane. i+1 B, near the cutting space i The second vertex of the aforementioned plane.
[0206] The second vertex mentioned above can be clipping space B. i+1 B, near the cutting space i A vertex or multiple vertices on a plane, for example, the four vertices that make up the plane.
[0207] S3024, Based on the second vertex and clipping space B iThe vector distance between the aforementioned planes determines the clipping space B. i With cutting space B i+1 Are there any gaps between them?
[0208] If the vector distance between the second vertex and the aforementioned plane has different signs, it indicates that the second vertex is located on opposite sides of the plane, rather than on the same side. This means that the plane containing the second vertex and the aforementioned plane partially intersect, i.e., there is a gap between their opposing planes. Therefore, in this step, the electronic device calculates the vector distance between the second vertex and the plane to determine the clipping space B. i With cutting space B i+1 Are there any gaps between them?
[0209] For example, if the clipping space B i If the normal vector of the plane mentioned above and the normal vector of the plane containing the second vertex are out of direction, then if all distances between the second vertex and the plane are less than or equal to 0, then the clipping space B is determined. i With cutting space B i+1 There should be no gap between them; otherwise, a gap will exist. If the cutting space B... i If the normal vector of the plane mentioned above and the normal vector of the plane containing the second vertex are in the same direction, then if the distance between the second vertex and the plane is always greater than or equal to 0, then the clipping space B is determined. i With cutting space B i+1 There should be no gaps between them; otherwise, there would be gaps.
[0210] S303. Modify the transformation matrix of the clipping space of the adjacent road segment to make the clipping space of the adjacent road segment seamless.
[0211] In this step, the way the electronic device corrects the clipping space of adjacent road segments to make the clipping space of the adjacent road segments seamless is related to the way it determines whether there are gaps between adjacent road segments.
[0212] For example, one possible implementation is to consider a gap to exist between the two if they do not have any intersecting areas. Figure 6 This is a schematic diagram of a gap correction method provided in an embodiment of this application, as shown below. Figure 6 As shown, at this time, the correction method may be, for example, to extend the clipping space boundary of the adjacent road segment so that the clipping spaces of the adjacent road segment intersect; then, using the generated intersection point as the vertex of the boundary, the clipping space of the adjacent road segment is regenerated; then, based on the regenerated clipping space of the adjacent road segment, the transformation matrix of the clipping space of the adjacent road segment is corrected.
[0213] Another possible implementation involves the electronic device moving the boundaries of two adjacent clipping spaces toward each other by a preset distance; then, based on the clipping space of the adjacent road segment moved by the preset distance, the transformation matrix of the clipping space of the adjacent road segment is corrected. This application does not limit the specific value of the moving distance, which can be determined by those skilled in the art according to the actual situation.
[0214] Another possible implementation is that after the electronic device moves the boundaries of two adjacent clipping spaces toward each other by a preset distance, it can then execute step S301 to determine whether there is a gap between the two adjacent clipping spaces after the movement. If there is a gap, the boundaries of the two adjacent clipping spaces after the boundary movement are moved toward each other by a preset distance again, and this process is repeated until the electronic device executes step S301 to determine that there is no gap between the two adjacent clipping spaces after the movement. Then, based on the clipping space of the adjacent road segment after the last movement, the transformation matrix of the clipping space of the adjacent road segment is corrected.
[0215] Regarding how to modify the parameters of the transformation matrix of the clip space based on the final clip space, please refer to the implementation methods in the prior art, which will not be elaborated here. For example, the parameters in the transformation matrix of the clip space can be recalculated based on the spatial vertices of the final clip space.
[0216] In this embodiment, the electronic device first determines whether there are gaps between the clipping spaces of adjacent road segments. If gaps exist, the transformation matrix of the clipping space of the adjacent road segments is corrected to ensure that the clipping spaces represented by the transformation matrices of the adjacent road segments are seamless. Through the above operation, unnecessary filtering of data in the candidate dataset due to gaps in the clipping space can be avoided, further improving the accuracy of the generated transformation matrix of the clipping space.
[0217] This application also provides a data pruning method for pruning candidate data sets corresponding to a target route. Figure 7 This is a flowchart illustrating a data cropping method provided in an embodiment of this application, as shown below. Figure 7 As shown, the method may include the following steps:
[0218] S401. Obtain the transformation matrix of the clipping space of the segments included in the target route.
[0219] For specific implementation details, please refer to the implementation method described in the method embodiment of the method for determining the pre-clipping space, which will not be repeated here.
[0220] S402. Based on the transformation matrix of the clipping space corresponding to the road segment, the data in the candidate dataset corresponding to the target route is clipped to obtain the target dataset corresponding to the target route.
[0221] The candidate datasets mentioned above include point cloud data and / or map data. That is, the data included in the target route before pruning.
[0222] This application does not limit the implementation method of cropping data in the candidate dataset corresponding to the target route based on the transformation matrix of the clipping space. For details, please refer to existing technologies for data cropping using clipping space. For example, the electronic device obtains the transformation matrix of the clipping space projected onto the camera coordinate system based on the transformation matrix of the clipping space of the road segment, and then performs cropping processing on the data in the candidate dataset corresponding to the target route accordingly to obtain the target dataset corresponding to the target route. For example, the electronic device projects all points in the candidate dataset corresponding to the target route sequentially onto the clipping spaces of each road segment. If a point is located within any clipping space, it is not cropped; if it is not located within any clipping space, it is cropped. Through the above operations, the target dataset corresponding to the target route can be obtained. The data in the target dataset is the data retained after cropping.
[0223] This application does not limit the further processing methods after obtaining the target dataset corresponding to the target route through the above-described cropping method; the specific processing depends on the actual application scenario. For example, in a map creation scenario, the target dataset can be rendered and displayed after obtaining it. In an intelligent driving simulation scenario, the rationality of the intelligent driving navigation route planning can be judged based on the target dataset after obtaining it.
[0224] For example, Figure 8 A flowchart illustrating the second method for determining the clipping space provided in this application embodiment is shown below. Figure 8 As shown, step S402 may include the following steps:
[0225] S501, Obtain the camera transformation matrix M c And, camera projection matrix M p .
[0226] The above M c Used to characterize the actual position of the camera coordinate system. The camera coordinate system is a three-dimensional Cartesian coordinate system established with the camera's focal center as the origin and the optical axis (i.e., the centerline of the light beam) as the Z-axis. It is equivalent to the observer's observation coordinate system; for example, it could be an observation coordinate system constructed with the display screen used to display a map as the origin. Camera projection matrix M p Used to project the coordinates of any point from the space where the point is currently located to the camera coordinate system.
[0227] In this step, the electronic device acquires the camera transformation matrix M. c And, camera projection matrix M pThis allows for the subsequent projection of the clipping space and data from the candidate dataset onto the camera coordinate system, simulating the observer's actual observation scenario, and cropping the candidate dataset using the clipping space based on the camera coordinate system.
[0228] The camera projection matrix M can be pre-stored in the electronic device. p and the camera transformation matrix M c Alternatively, it can be calculated based on relevant parameters. For details on how to calculate the camera transformation matrix and the camera projection matrix, please refer to existing technologies.
[0229] S502, Based on the camera transformation matrix M c And, camera projection matrix M p Obtain the view projection matrix M vp .
[0230] The above view projection matrix M vp This means that the previous coordinate system can be transformed to a new coordinate system with the view as the origin. In this embodiment, the coordinates of any point can be projected from the coordinate system in which the point is currently located to a matrix in the camera coordinate system.
[0231] One possible implementation is that the electronic device uses the camera transformation matrix M c And, camera projection matrix M p Using formula (5), the view projection matrix M is calculated. vp .
[0232]
[0233] S503. Based on the transformation matrix of the clipping space corresponding to the road segment, and the view projection matrix M vp Obtain the transformation matrix M of the clipping space after the road segment is projected. mvp .
[0234] The above describes the actual location of the clipping space in the camera coordinate system. In this step, the electronic device obtains the transformation matrix M of the clipping space after the road segment is projected. mvp This allows points in the candidate dataset to be projected onto the coordinate system of the projected clipping space.
[0235] One possible implementation is that the electronic device uses formula (6) to obtain the transformation matrix M of the clipping space after the road segment projection. mvp .
[0236] M mvpi =M vp M i ……(6)
[0237] Among them, Mmvpi The transformation matrix representing the clipping space after the projection of the i-th road segment. M i The transformation matrix representing the clipping space of the i-th road segment.
[0238] S504. Based on the transformation matrix of the clipping space after the road segment projection, the data in the candidate dataset corresponding to the target route is clipped to obtain the target dataset.
[0239] The electronic device performs cropping processing on the data in the candidate dataset corresponding to the target route based on the transformation matrix of the cropping space after the road segment projection. The method for obtaining the target dataset is related to the actual application scenario of this application. For example, when the method of this application is applied to the cropping and filtering of point cloud data and / or map data during map production, if it is necessary to render and display the target dataset obtained after cropping, the electronic device can, for example, use a shader to crop the candidate dataset based on the transformation matrix of the cropping space after the road segment projection.
[0240] The aforementioned shader can be, for example, a vertex shader or a fragment shader, depending on the type of data in the candidate dataset. For instance, if the data type in the candidate dataset is vertices, then a vertex shader is used to clip the data for that vertex type. A vertex, for example, can be each point in point cloud data, a point in map data, a line (including only the two endpoints of a line), or each endpoint of a polygon. If the data type in the candidate dataset is fragments, then a fragment shader is used to clip the data. A fragment, for example, can be any point on a line in map data except for its two endpoints, or any point on a polygon except for its endpoints.
[0241] When the method of this application is applied to the judgment of the rationality of navigation route planning, the electronic device can directly perform cropping processing on the data in the candidate dataset corresponding to the target route based on the transformation matrix of the cropping space after the road segment projection, so as to obtain the target dataset.
[0242] Taking the application of the method of this application to the cropping and filtering of point cloud data and / or map data in map production as an example, the electronic device uses a shader to determine whether each point in the candidate dataset needs to be cropped based on the transformation matrix of the cropping space after the road segment projection. If it is determined that the point needs to be cropped, then the point is cropped to obtain the target dataset.
[0243] Regarding the method by which electronic devices use shaders to determine whether arbitrary points in the candidate dataset need to be clipped based on the transformation matrix of the clipping space after road segment projection, for example, the shader could first project the coordinates of the points to be tested in the candidate dataset onto the clipping space after any of the aforementioned road segments, thus obtaining the projected coordinates of the points to be tested. The three components of the coordinates of any point to be tested can be denoted as x, x' ...p y p z p .
[0244] Then, the shader determines x. p y p z p Whether the absolute value is not greater than a preset absolute value threshold. The aforementioned preset absolute value threshold is related to the parameters of the clipping space after the road segment is projected, such as half the length of the clipping space after projection. Taking a 1*1*1 cube as an example, the aforementioned preset absolute value threshold is 0.5.
[0245] If yes, then the point to be detected does not need to be clipped. If not, the electronic device uses the transformation matrix of the clipping space after the next segment is projected to project the point to be detected into the clipping space after the next segment is projected, and determines the x-axis of the point to be detected in that coordinate system. p y p z p The absolute value of the value is checked against a preset absolute value threshold until the corresponding judgment result in the transformation matrix of the clipping space after projection of any road segment is "yes". If the judgment result for the clipping space after projection of all road segments is "no", then the point to be detected needs to be clipped. The shader performs the above judgment and corresponding clipping operation on all points in the candidate dataset to obtain the target dataset. Subsequently, after obtaining the target dataset, the electronic device can also perform rendering and display based on the target dataset.
[0246] When the method of this application is applied to the rationality judgment of navigation route planning, the electronic device performs cropping processing on the data in the candidate dataset corresponding to the target route according to the transformation matrix of the cropping space after the road segment projection. The way to obtain the target dataset can be referred to the way the electronic device obtains the target dataset using shaders, which will not be elaborated here.
[0247] In this embodiment, the electronic device obtains the view projection matrix based on the camera transformation matrix and the camera projection matrix; then, based on the transformation matrix of the clipping space of the road segment and the view projection matrix, it obtains the transformation matrix of the clipping space after the road segment is projected; finally, based on the transformation matrix of the clipping space after the road segment is projected, it performs clipping processing on the data in the candidate dataset corresponding to the target route to obtain the target dataset.
[0248] Using the above method, the electronic device can use the view projection matrix generated based on the camera transformation matrix and the camera projection matrix as a reference matrix to determine whether the data in the candidate dataset exceeds the clipping space, i.e., whether the data in the candidate dataset needs to be clipped. Then, when clipping is needed, that part of the data is clipped, thus obtaining the target dataset. This method is computationally simple and highly feasible.
[0249] Furthermore, the above-mentioned method allows for accurate cropping of candidate datasets. When applied to map creation scenarios, this method not only considers the impact of real-world elevation fluctuations on the data in the candidate dataset, but also filters and selects the horizontal and vertical ranges of the candidate dataset. This enables accurate filtering of data within the candidate dataset, better simulating the sensor detection range and visual field of intelligent driving vehicles in the real world, thus providing better high-precision data to assist and support intelligent driving decision-making and perception. When applied to the rationality judgment of navigation routes, this method can accurately determine whether the navigation route fits the candidate dataset, thereby accurately judging whether the navigation route is reasonably planned.
[0250] Figure 9 This is a schematic diagram of a device for determining cutting space provided in an embodiment of this application. Figure 9 As shown, the device includes: a first acquisition module 11, a processing module 12, and a second acquisition module 13. Optionally, the device may further include the following module: a correction module 14.
[0251] The first acquisition module 11 is used to acquire the target route, which consists of a series of location points.
[0252] The processing module 12 is used to divide the target route into at least two road segments based on the location points.
[0253] The second acquisition module 13 is used to acquire the transformation matrix of the clipping space corresponding to the road segment based on the location points included in the road segment and the set clipping range parameters.
[0254] One possible implementation is that the second acquisition module 13 is specifically used to obtain the midpoint position point and the direction vector of the clipping space of the road segment based on the starting position point and the ending position point among the position points included in the road segment; and to obtain the transformation matrix of the clipping space of the road segment according to the starting position point, the midpoint position point, the direction vector of the clipping space and the set clipping range parameters.
[0255] For example, the second acquisition module 13 is specifically used to acquire the size parameters of the clipping space based on the starting point, the midpoint, and the set clipping range parameters; acquire the remaining spatial orientation parameters of the clipping space other than the direction vector based on the midpoint and the direction vector of the clipping space; and generate the transformation matrix of the clipping space of the road segment based on the size parameters, the direction vector of the clipping space, and the remaining spatial orientation parameters.
[0256] For example, the cutting range parameters include: upper limit height, lower limit height, horizontal range, and vertical range; the size parameters include: length, height, and width. The second acquisition module 13 is specifically used to determine the length parameter based on the starting point, the midpoint, and the vertical range; determine the height parameter based on the upper limit height and the lower limit height; and determine the width parameter based on the horizontal range.
[0257] For example, the remaining spatial orientation parameters include: longitudinal vector, transverse vector, and center point position; the second acquisition module 13 is specifically used to acquire the longitudinal vector of the cutting space based on the center point position; acquire the center point position of the cutting space based on the longitudinal vector, the height parameter, and the center point position; and acquire the transverse vector of the cutting space based on the longitudinal vector and the direction vector of the cutting space.
[0258] One possible implementation is that the correction module 14 is used to obtain the clipping space corresponding to the road segment based on the transformation matrix of the clipping space corresponding to the road segment after the second acquisition module 13 obtains the transformation matrix of the clipping space corresponding to the road segment; determine whether there is a gap between the clipping spaces of adjacent road segments; if there is a gap, correct the transformation matrix of the clipping space of the adjacent road segment so that the clipping space of the adjacent road segment is seamless.
[0259] For example, the clipping space of adjacent road segments includes: Clipping Space B i and B i+1 ; Correction module 14, specifically used to obtain the clipping space B i Mid-distance clipping space B i+1 The center point is located at the nearest first vertex; with clipping space B i Using the direction vector as the normal vector, we obtain the plane passing through the first vertex; and obtain the clipping space B. i+1 The middle is close to the cutting space B i The second vertex of the plane; the clipping space B is determined based on the vector distance between the second vertex and the plane. i With the cutting space B i+1 Are there any gaps between them?
[0260] For example, the correction module 14 is specifically used to obtain the clipping space B. i+1 The vertex points to the clipping space B i+1 The direction vector of the center point position; according to the clipping space B i+1 The vertex points to the clipping space B i+1 The direction vector of the center point position, and the clipping space B i+1 The dot product of the direction vectors is used to obtain the clipping space B. i+1 The center is oriented towards the cutting space B i The second vertex of the plane.
[0261] One possible implementation is that the correction module 14 is specifically used to extend the clipping space boundary of the adjacent road segment so that the clipping spaces of the adjacent road segment intersect; using the generated intersection point as the vertex of the boundary, the clipping space of the adjacent road segment is regenerated; and based on the regenerated clipping space of the adjacent road segment, the transformation matrix of the clipping space of the adjacent road segment is corrected.
[0262] One possible implementation is that the processing module 12 is specifically used to perform linear fitting on the location points on the target route to obtain at least two road segments of the target route.
[0263] For example, the processing module 12 is specifically used to perform linear fitting on the position points on the target route according to a preset included angle interval and a preset length threshold, so as to obtain at least two road segments of the target route.
[0264] For example, processing module 12 is specifically used to obtain the line segment L corresponding to the position point j on the target route. j and line segment l j+1 The included angle between them, line segment L j Length and line segment l j+1 The length of L; j Let l be the line connecting point j and point j-1. j Alternatively, it can be a fitted line segment l′ obtained by linear fitting based on position j and at least one position point preceding said position j. j The l j+1 Let L be the line segment connecting point j and point j+1; where j+1 is an integer greater than or equal to 2; if the line segment L... j and line segment l j+1 The included angle between them is outside a preset included angle range, and / or, the line segment L j The length of the line segment l is greater than or equal to a preset length threshold, and / or the line segment l j+1 If the length is greater than or equal to the length threshold, then the L jThe linear fitting result of the corresponding location point is taken as a road segment, and location point j is taken as the first location point to obtain the next road segment; if the line segment L j and line segment l j+1 The included angle between them is located within the included angle range, and the line segment L j The length of the line segment l is less than the length threshold, and the line segment l j+1 If the length is less than the length threshold, then the L j Linear fitting is performed on the corresponding location point and location point j+1; if location point j+1 is the last location point on the target route, the linear fitting result is taken as a road segment; if location point j+1 is not the last location point on the target route, the linear fitting result is taken as the line segment L corresponding to location point j+1. j+1 Continue making judgments until the last location point on the target route.
[0265] In one possible implementation, the processing module 12 is further configured to: if the included angles of two adjacent road segments in the divided road segments are both within the included angle interval, determine whether there is a road segment whose residual sum of squares is greater than a preset residual sum of squares threshold; if there is a road segment in the target route whose residual sum of squares is greater than the preset residual sum of squares threshold, select a target road segment from the road segments whose residual sum of squares is greater than the preset residual sum of squares threshold and split it into multiple road segments; determine whether there are adjacent road segments whose sum of length is less than or equal to a preset length threshold; if there are adjacent road segments whose sum of length is less than or equal to the preset length threshold, perform linear fitting on the position points of the adjacent road segments to merge them into one road segment.
[0266] In another possible implementation, the processing module 12 is further configured to: if there are two adjacent road segments whose included angle is outside the included angle interval after division, reduce the included angle interval, and re-perform linear fitting on the position points on the target route based on the reduced included angle interval and the length threshold to obtain at least two new road segments; if there are road segments in the new road segments whose residual sum of squares is greater than a preset residual sum of squares threshold, select a target road segment from the road segments whose residual sum of squares is greater than the preset residual sum of squares threshold and split it into multiple road segments; determine whether there are adjacent road segments whose sum of length is less than or equal to a preset length threshold; if there are adjacent road segments whose sum of length is less than or equal to the preset length threshold, perform linear fitting on the position points on the adjacent road segments to merge them into one road segment.
[0267] The data processing apparatus provided in this application embodiment can execute the method for determining the clipping space in the above method embodiment. Its implementation principle and technical effects are similar, and will not be repeated here. It should be noted that the above... Figure 9 The division of modules shown is merely illustrative. This application does not limit the division of modules or the naming of modules.
[0268] Figure 10 This is a schematic diagram of the structure of a data cropping device provided in an embodiment of this application, as shown below. Figure 10 As shown, the device includes: an acquisition module 21 and a cropping module 22. Optionally, the device may also include the following module: a display module 23.
[0269] The acquisition module 21 is used to acquire the transformation matrix of the segmented clipping space included in the target route based on the clipping space determination method described in the foregoing embodiments.
[0270] The cropping module 22 is used to crop the data in the candidate dataset corresponding to the target route according to the transformation matrix of the cropping space corresponding to the road segment, so as to obtain the target dataset corresponding to the target route; the candidate dataset includes point cloud data and / or map data.
[0271] One possible implementation involves a cropping module 22, specifically configured to: obtain a camera transformation matrix and a camera projection matrix; obtain a view projection matrix based on the camera transformation matrix and the camera projection matrix; obtain a transformation matrix of the cropping space after projection of the road segment based on the transformation matrix of the cropping space corresponding to the road segment and the view projection matrix; and crop the data in the candidate dataset corresponding to the target route based on the transformation matrix of the cropping space after projection of the road segment to obtain the target dataset.
[0272] One possible implementation is a display module 23, which is used to render and display based on the target dataset.
[0273] The data trimming device provided in this application embodiment can execute the data trimming method in the above method embodiment. Its implementation principle and technical effects are similar, and will not be repeated here. It should be noted that the above... Figure 10 The division of modules shown is merely illustrative. This application does not limit the division of modules or the naming of modules.
[0274] Figure 11 This is a schematic diagram of the structure of an electronic device 110 provided in an embodiment of this application. Figure 11 As shown, the electronic device 110 may include at least one processor 111 and a memory 112.
[0275] The memory 112 is used to store programs. Specifically, the program may include program code, which includes computer operation instructions.
[0276] The memory 112 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage.
[0277] The processor 111 is used to execute computer execution instructions stored in the memory 112 to implement the method for determining the clipping space, or the data clipping method, as described in the foregoing method embodiments. The processor 111 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0278] The server 110 may also include a communication interface 113, through which it can communicate and interact with external devices, such as map data acquisition devices. In specific implementations, if the communication interface 113, memory 112, and processor 111 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.
[0279] Optionally, in a specific implementation, if the communication interface 113, memory 112, and processor 111 are integrated on a single chip, then the communication interface 113, memory 112, and processor 111 can communicate through an internal interface.
[0280] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores program instructions, which are used for the method of determining the clipping space and / or the data clipping method in the above embodiments.
[0281] This application also provides a program product including executable instructions stored in a readable storage medium. At least one processor of an electronic device can read the executable instructions from the readable storage medium, and the at least one processor executes the executable instructions to cause the electronic device to implement the clipping space determination method and / or data clipping method provided in the various embodiments described above.
[0282] The term "multiple" in this document refers to two or more. The term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the preceding and following related objects; in formulas, " / " indicates a "division" relationship. Additionally, it should be understood that in the description of this application, words such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order.
[0283] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application.
[0284] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for determining a cutting space, characterized in that, The method includes: Obtain the target route, which consists of a series of location points; Based on the location points, the target route is divided into at least two road segments; Based on the location points included in the road segment and the set clipping range parameters, as well as the midpoint location point of the road segment determined based on the location points and the direction vector of the clipping space, the transformation matrix of the clipping space corresponding to the road segment is obtained. The transformation matrix of the clipping space is used to characterize the actual position of the clipping space in the map data coordinate system.
2. The method according to claim 1, characterized in that, The step of obtaining the transformation matrix of the clipping space corresponding to the road segment based on the location points included in the road segment, preset clipping range parameters, the midpoint location point of the road segment determined based on the location points, and the direction vector of the clipping space includes: Based on the starting point and ending point of the location points included in the road segment, the midpoint of the road segment and the direction vector of the clipping space are obtained. The transformation matrix of the clipping space of the road segment is obtained based on the starting point, the midpoint, the direction vector of the clipping space, and the set clipping range parameters.
3. The method according to claim 2, characterized in that, The step of obtaining the transformation matrix of the clipping space of the road segment based on the starting point, the midpoint, the direction vector of the clipping space, and the set clipping range parameters includes: Based on the starting point, the midpoint, and the set cutting range parameters, the size parameters of the cutting space are obtained. Based on the midpoint position and the direction vector of the clipping space, obtain the remaining spatial orientation parameters of the clipping space other than the direction vector; Based on the size parameters, the direction vector of the clipping space, and the other spatial orientation parameters, a transformation matrix for the clipping space of the road segment is generated.
4. The method according to claim 3, characterized in that, The cutting range parameters include: upper limit height, lower limit height, horizontal range, and vertical range. The size parameters include: length, height, and width. Obtaining the size parameters of the cutting space based on the starting point, the midpoint, and the set cutting range parameters includes: The length parameter is determined based on the starting point, the midpoint, and the longitudinal range value. The height parameter is determined based on the upper limit value and the lower limit value. The width parameter is determined based on the horizontal range value.
5. The method according to claim 4, characterized in that, The remaining spatial orientation parameters include: longitudinal vector, transverse vector, and center point position; obtaining the remaining spatial orientation parameters of the clipping space other than the direction vector, based on the center point position and the direction vector of the clipping space, includes: Based on the midpoint position, obtain the longitudinal vector of the clipping space; The center point position of the clipping space is obtained based on the vertical vector, the height parameter, and the midpoint position. Based on the vertical vector and the direction vector of the clipping space, the horizontal vector of the clipping space is obtained.
6. The method according to any one of claims 3-5, characterized in that, After obtaining the transformation matrix of the clipping space corresponding to the road segment, the method further includes: Based on the transformation matrix of the clipping space corresponding to the road segment, obtain the clipping space corresponding to the road segment; Determine whether there are gaps between the cut spaces of adjacent road segments; If gaps exist, the transformation matrix of the clipping space of the adjacent road segment is modified to make the clipping space of the adjacent road segment seamless.
7. The method according to claim 6, characterized in that, The cut-off space of adjacent road segments includes: cut-off space and The determination of whether there is a gap between the cutting spaces of adjacent road segments includes: Get cropping space Mid-distance cutting space The center point is located at the nearest first vertex; To cut space Using the direction vector as the normal vector, we obtain the plane passing through the first vertex; Get cropping space Close to the cutting space The second vertex of the plane; The clipping space is determined based on the vector distance between the second vertex and the plane. With the cutting space Are there any gaps between them? 8. The method according to claim 7, characterized in that, The acquisition of clipping space Close to the cutting space The second vertex of the plane includes: Obtain the clipping space The vertex points to the clipping space. The direction vector of the center point position; According to the cutting space The vertex points to the clipping space. The direction vector of the center point position, and the clipping space The clipping space is obtained by the dot product of the direction vectors. Central orientation towards the cutting space The second vertex of the plane.
9. The method according to claim 6, characterized in that, The transformation matrix for correcting the clipping space of the adjacent road segment includes: Extend the cut space boundary of the adjacent road segment so that the cut spaces of the adjacent road segments intersect; Using the resulting intersection as the vertex of the boundary, the clipping space of the adjacent road segment is regenerated; Based on the newly generated clipping space of the adjacent road segment, the transformation matrix of the clipping space of the adjacent road segment is corrected.
10. The method according to any one of claims 1-5, characterized in that, The process of dividing the target route into at least two segments based on the location points specifically includes: Linear fitting is performed on the location points on the target route to obtain at least two road segments of the target route.
11. The method according to claim 10, characterized in that, The step of linearly fitting the location points on the target route to obtain at least two road segments of the target route includes: Based on a preset angle range and a preset length threshold, the position points on the target route are linearly fitted to obtain at least two road segments of the target route.
12. The method according to claim 11, characterized in that, The step of linearly fitting the position points on the target route based on a preset included angle range and a length threshold to obtain at least two road segments of the target route includes: Obtain the line segment corresponding to position point j on the target route. and line segments The included angle and line segment between Length and line segment The length; the The line connecting point j and point j-1 Alternatively, it can be a fitted line segment obtained by linearly fitting a point j to at least one point preceding the point j. The Let j be the line connecting point j and point j+1; where j is an integer greater than or equal to 2. If the line segment and line segments The included angle between them is outside a preset included angle range, and / or, the line segments The length of the line segment is greater than or equal to a preset length threshold, and / or the line segment If the length is greater than or equal to the length threshold, then the length of the length will be... The linear fitting result of the corresponding location point is taken as a road segment, and location point j is used as the first location point to obtain the next road segment; If the line segment and line segments The included angle between them is located within the included angle range, and the line segment The length of the line segment is less than the length threshold, and the line segment If the length is less than the length threshold, then the length of the length will be... Linear fitting is performed on the corresponding position point and position point j+1; If the location point j+1 is the last location point on the target route, then the linear fitting result is taken as a road segment; If the location j+1 is not the last location on the target route, then the linear fitting result will be used as the line segment corresponding to location j+1. Continue making judgments until the last location point on the target route.
13. The method according to claim 12, characterized in that, The method further includes: If the included angle between two adjacent road segments after the division is within the included angle interval, then determine whether there are road segments with residual sum of squares greater than the preset residual sum of squares threshold. If there are road segments in the target route whose residual sum of squares is greater than a preset residual sum of squares threshold, then select the target road segment from the road segments whose residual sum of squares is greater than the preset residual sum of squares threshold and split it into multiple road segments; Determine if there are adjacent road segments whose sum of length is less than or equal to a preset length threshold; If there are adjacent road segments whose sum of length is less than or equal to a preset length threshold, then the location points on the adjacent road segments are linearly fitted to merge them into one road segment.
14. The method according to claim 12, characterized in that, The method further includes: If the included angle between two adjacent road segments in the divided road segments is outside the included angle interval, then the included angle interval is reduced, and the position points on the target route are re-linearly fitted based on the reduced included angle interval and the length threshold to obtain at least two new road segments. If there is a road segment in the new road segment whose residual sum of squares is greater than a preset residual sum of squares threshold, then select a target road segment from the road segments whose residual sum of squares is greater than the preset residual sum of squares threshold and split it into multiple road segments. Determine if there are adjacent road segments whose sum of length is less than or equal to a preset length threshold; If there are adjacent road segments whose sum of length is less than or equal to a preset length threshold, then the location points on the adjacent road segments are linearly fitted to merge them into one road segment.
15. A data cropping method, characterized in that, The method for cropping the candidate data set corresponding to the target route includes: Based on the method of any one of claims 1-14, obtain the transformation matrix of the segmented clipping space of the target route; Based on the transformation matrix of the clipping space corresponding to the road segment, the data in the candidate dataset corresponding to the target route is clipped to obtain the target dataset corresponding to the target route; the candidate dataset includes: point cloud data and / or map data.
16. The method according to claim 15, characterized in that, The step of cropping the data in the candidate dataset corresponding to the target route according to the transformation matrix of the cropping space corresponding to the road segment to obtain the target dataset corresponding to the target route includes: Obtain the camera transformation matrix and the camera projection matrix; Based on the camera transformation matrix and the camera projection matrix, obtain the view projection matrix; Based on the transformation matrix of the clipping space corresponding to the road segment and the view projection matrix, obtain the transformation matrix of the clipping space after the road segment is projected. Based on the transformation matrix of the clipping space after the road segment is projected, the data in the candidate dataset corresponding to the target route is clipped to obtain the target dataset.
17. A device for determining cutting space, characterized in that, The device includes: The first acquisition module is used to acquire the target route, which consists of a series of location points; The processing module is used to divide the target route into at least two road segments based on the location points; The second acquisition module is used to acquire the transformation matrix of the clipping space corresponding to the road segment based on the location points included in the road segment, the set clipping range parameters, the midpoint location point of the road segment determined based on the location points, and the direction vector of the clipping space. The transformation matrix of the clipping space is used to characterize the actual position of the clipping space in the map data coordinate system.
18. A data cropping device, characterized in that, The device for cropping the candidate data set corresponding to the target route includes: The acquisition module is used to acquire the transformation matrix of the clipping space of the segmented target route based on the method of any one of claims 1-14. The cropping module is used to crop the data in the candidate dataset corresponding to the target route according to the transformation matrix of the cropping space corresponding to the road segment, so as to obtain the target dataset corresponding to the target route; the candidate dataset includes: point cloud data and / or map data.
19. An electronic device, characterized in that, include: Processor and memory; The processor is communicatively connected to the memory; The memory stores computer instructions; The processor executes computer instructions stored in the memory to implement the method as described in any one of claims 1-16.
Citation Information
Patent Citations
Method and device for segmenting point cloud data
CN110378904A
Environmental information generation method and device of vehicle, electronic equipment and storage medium
CN115097487A