Motor vehicle rectangular frame fitting method and device based on L-shaped point cloud and computer readable storage medium
By rastering and downsampling, filtering and sorting L-shaped point cloud data, combining vector direction angles and actual sizes, the problem of rectangular frame fitting in the existing technology is solved, and high efficiency is achieved Fitting the rectangular frame close to the barrier vehicle.
Patent Information
- Application Number
- CN202411238983.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2025-01-03
AI Technical Summary
The existing motor vehicle rectangular box fitting method based on L-shaped point cloud cannot fit the obstacle vehicle and has low computational efficiency. It is mainly because the eigenvectors of point sets introduce the concepts of mean and variance, which leads to the fitting box not being close to it, and the search algorithm It requires multiple iterations to make a lot of calculation.
By obtaining the L-shaped point cloud data detected by the vehicle radar, rasterize and downsample, filter out the target point cloud collection of obstacle vehicles, reorder and calculate the vector direction angle, and filter out the vehicle body and vehicle endpoint cloud collection. Solve the vertices of the rectangular frame based on the actual size to achieve close fit.
It effectively reduces the amount of data calculation, improves the fitted rectangular frame, and enables the fitted rectangular frame to be close to the obstacle vehicle, improving the recognition accuracy and processing speed.
Smart Images

Figure CN119251796A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of motor vehicle obstacle detection, and in particular to a motor vehicle rectangular frame fitting method, device and computer-readable storage medium based on L-shaped point cloud. Background Art
[0002] In order to accurately identify obstacle vehicles around the body of a motor vehicle when it is driving, so as to judge whether the obstacle vehicle affects the driving of the motor vehicle, existing motor vehicles usually use on-board radar to detect obstacle vehicles and generate L-shaped point cloud data, and then use a motor vehicle rectangular frame fitting method based on the L-shaped point cloud to fit the L-shaped point cloud data to generate a fitting rectangular frame of the obstacle vehicle, thereby realizing the identification of the obstacle vehicle.
[0003] There are two main existing motor vehicle rectangular frame fitting methods based on L-shaped point clouds: a rectangular fitting method based on principal component analysis and a rectangular fitting method based on search algorithm approximation. However, the former introduces the concepts of mean and variance of all points due to the use of the feature vector of the point set, which will cause the generated fitting frame to be unable to fit the obstacle vehicle closely. The latter requires multiple iterations during calculation and all point cloud data must be involved in the calculation in each iteration, which results in a large amount of calculation and low fitting efficiency. Summary of the invention
[0004] The technical problem to be solved by the embodiments of the present invention is to provide a motor vehicle rectangular frame fitting method based on L-shaped point cloud, wherein the fitted rectangular frame closely fits the obstacle vehicle and has high fitting efficiency.
[0005] A further technical problem to be solved by an embodiment of the present invention is to provide a motor vehicle rectangular frame fitting device based on an L-shaped point cloud, wherein the fitted rectangular frame fits closely to the obstacle vehicle and has high fitting efficiency.
[0006] A further technical problem to be solved by an embodiment of the present invention is to provide a computer-readable storage medium for storing a computer program that can fit a rectangular frame closely to an obstacle vehicle with high fitting efficiency.
[0007] In order to solve the above technical problems, the embodiment of the present invention provides the following technical solutions: a motor vehicle rectangular frame fitting method based on L-shaped point cloud, comprising the following steps: Acquire L-shaped point cloud data generated by the vehicle-mounted radar detecting obstacle vehicles around the motor vehicle, and rasterize the L-shaped point cloud data to generate a point cloud grid network; Downsampling the original point cloud in the point cloud grid network to generate a target point cloud, screening all the target point clouds in the point cloud grid network to obtain a target point cloud set of the outer envelope of the obstacle vehicle, and reordering each of the target point clouds in the target point cloud set according to a predetermined sorting rule to generate an optimized point cloud set; Sequentially calculating the vector direction angles of two adjacent target point clouds in the optimized point cloud set to obtain a total direction angle set, and filtering out a body point cloud set corresponding to the body of the obstacle vehicle and a vehicle end point cloud set corresponding to the vehicle end of the obstacle vehicle from the optimized point cloud set based on the total direction angle set, and filtering out a body direction angle set corresponding to the body point cloud set from the total direction angle set; Calculating the direction angle mean of each vector direction angle in the vehicle body direction angle set, and solving the first vertex of the target fitting rectangular box of the obstacle vehicle in the plane coordinate system where the point cloud grid network is located based on the direction angle mean, the vehicle body point cloud set and the vehicle end point cloud set; and The remaining vertices of the target fitting rectangular frame in the plane coordinate system are obtained based on the first vertex and the actual size of the obstacle vehicle, and the target fitting rectangular frame of the obstacle vehicle is obtained based on the fitting of all the vertices.
[0008] Furthermore, downsampling the original point cloud in the point cloud grid network to generate the target point cloud specifically refers to: calculating the mean coordinate point of all original point clouds in the same grid in the point cloud grid network, and taking the mean coordinate point as the target point cloud.
[0009] Furthermore, the screening of all the target point clouds in the point cloud grid network to obtain a target point cloud set of the outer envelope of the obstacle vehicle specifically includes: Filtering out the target point clouds with the smallest row numbers in each column grid from the point cloud grid network as the first point cloud set; Extracting the minimum and maximum values of the horizontal coordinates of the original point cloud from the point cloud grid network, comparing the absolute value of the minimum value of the horizontal coordinate with the absolute value of the maximum value, and when the absolute value of the minimum value of the horizontal coordinate is less than the absolute value of the maximum value, selecting the target point clouds with the smallest column number in each row of the grid from the point cloud grid network as the second point cloud set, otherwise selecting the target point clouds with the largest column number in each row of the grid from the point cloud grid network as the second point cloud set; and The union of the first point cloud set and the second point cloud set is used as the target point cloud set.
[0010] Furthermore, the predetermined sorting rule is: sorting in ascending order of column numbers first, and for columns with the same column numbers, sorting in descending order of row numbers.
[0011] Further, the step of respectively selecting a body point cloud set corresponding to the body of the obstacle vehicle and a vehicle end point cloud set corresponding to the vehicle end of the obstacle vehicle from the optimized point cloud set based on the total direction angle set, and selecting a body direction angle set corresponding to the body point cloud set from the total direction angle set specifically includes: Calculating the angle difference between two adjacent vector direction angles in the total direction angle set in sequence, comparing the angle difference with a preset difference, and taking the target point cloud corresponding to the angle difference greater than the preset difference in the optimized point cloud set as the target inflection point; Splitting the optimized point cloud set into two sub-point cloud sets with the target inflection point as a dividing point, comparing the number of target point clouds contained in the two sub-point cloud sets, and taking the sub-point cloud set containing a larger number of target point clouds as the vehicle body point cloud set and the other sub-point cloud set as the vehicle end point cloud set; and A corresponding vehicle body direction angle set is filtered out from the total direction angle set based on the vehicle body point cloud set.
[0012] Furthermore, the step of solving the first vertex of the target fitting rectangular box of the obstacle vehicle in the plane coordinate system where the point cloud grid network is located based on the direction angle mean, the vehicle body point cloud set and the vehicle end point cloud set specifically includes: Constructing a first predetermined straight line and a second predetermined straight line in the plane coordinate system where the point cloud grid network is located, respectively, wherein the slope of the first predetermined straight line is the tangent value of the mean value of the direction angle and passes through a first predetermined far point located below the point cloud grid network and separated from the point cloud grid network by a predetermined distance, and the second predetermined straight line is perpendicular to the first predetermined straight line and passes through a second predetermined far point located below the point cloud grid network and separated from the point cloud grid network by a predetermined distance; Selecting the target point cloud with the smallest actual distance from the first predetermined straight line from the vehicle body point cloud set as the first reference point cloud, and selecting the target point cloud with the smallest actual distance from the second predetermined straight line from the vehicle end point cloud set as the second reference point cloud; and A third predetermined straight line perpendicular to the first predetermined straight line is constructed in a plane coordinate system through the first reference point cloud, and a fourth predetermined straight line perpendicular to the second predetermined straight line is constructed in a plane coordinate system through the second reference point cloud, and the intersection of the third predetermined straight line and the fourth predetermined straight line is used as the first vertex of the target fitting rectangular box of the obstacle vehicle.
[0013] Further, the first predetermined far point and the second predetermined far point are respectively selected in the plane coordinate system by the following method: Extracting the minimum and maximum values of the horizontal coordinates of the original point cloud and the minimum value of the vertical coordinates of the original point cloud from the point cloud grid network; and Any coordinate point in the plane coordinate system that satisfies the following conditions is selected as the first predetermined far point and the second predetermined far point: the horizontal coordinate is between the minimum value and the maximum value of the horizontal coordinate of the original point cloud, the vertical coordinate is less than the minimum value of the vertical coordinate of the original point cloud and the distance from the minimum value of the vertical coordinate of the original point cloud is not less than a predetermined distance.
[0014] Furthermore, the step of obtaining the remaining vertices of the target fitting rectangular frame in the plane coordinate system based on the first vertex and the actual size of the obstacle vehicle specifically includes: In the plane coordinate system, taking the first vertex as the starting point, respectively move along the third predetermined straight line and the fourth predetermined straight line by corresponding lengths according to the length and width of the obstacle vehicle to obtain the second vertex and the third vertex of the target fitting rectangular frame; constructing a fifth predetermined straight line perpendicular to the third predetermined straight line through the second vertex, and constructing a sixth predetermined straight line perpendicular to the fourth predetermined straight line through the third vertex; and The intersection point of the fifth predetermined straight line and the sixth predetermined straight line is used as the fourth vertex of the target fitting rectangular frame.
[0015] On the other hand, in order to solve the above-mentioned further technical problems, an embodiment of the present invention provides the following technical solutions: a motor vehicle rectangular frame fitting device based on an L-shaped point cloud, connected to a vehicle-mounted radar, the device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the motor vehicle rectangular frame fitting method based on the L-shaped point cloud as described in any one of the above items.
[0016] On the other hand, in order to solve the above-mentioned further technical problems, an embodiment of the present invention provides the following technical solutions: a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the motor vehicle rectangular frame fitting method based on the L-shaped point cloud as described in any one of the above items.
[0017] After adopting the above technical scheme, the embodiment of the present invention has at least the following beneficial effects: the embodiment of the present invention rasterizes the L-shaped point cloud data to generate a point cloud grid network, and downsamples the original point cloud in the point cloud grid network to generate a target point cloud, and only screens all the downsampled target point clouds in the point cloud grid network to obtain a target point cloud set of the outer envelope of the obstacle vehicle, thereby effectively reducing the amount of data calculation and improving data processing efficiency; after further re-sorting the target point cloud to generate an optimized point cloud set, the vector direction angles of two adjacent target point clouds in the optimized point cloud set are calculated in turn, thereby obtaining a target point cloud set based on the vector angle principle. A body point cloud set corresponding to the body of the obstacle vehicle and a vehicle end point cloud set corresponding to the vehicle end of the obstacle vehicle are respectively screened out from the optimized point cloud set, so that the fitted target fitting rectangular frame can fit the body of the obstacle vehicle; then, by calculating the direction angle mean of each vector direction angle in the body direction angle set, the body point cloud set and the vehicle end point cloud set are combined to first solve the first vertex of the target fitting rectangular frame of the obstacle vehicle in the plane coordinate system where the point cloud grid network is located; finally, the remaining vertices of the target fitting rectangular frame can be solved in combination with the actual size of the obstacle vehicle, thereby completing the fitting of the target fitting rectangular frame of the obstacle vehicle. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The present invention is a flowchart of the steps of an optional embodiment of the method for fitting a rectangular frame of a motor vehicle based on an L-shaped point cloud.
[0019] Figure 2 This is a schematic diagram of the fitting principle of a target fitting rectangular frame of an optional embodiment of the motor vehicle rectangular frame fitting method based on L-shaped point cloud of the present invention.
[0020] Figure 3 The present invention is a schematic diagram of an optional embodiment of a motor vehicle rectangular frame fitting device based on an L-shaped point cloud.
[0021] Figure 4 This is a functional module diagram of an optional embodiment of the vehicle rectangular frame fitting device based on L-shaped point cloud of the present invention. DETAILED DESCRIPTION
[0022] The present application is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following illustrative embodiments and descriptions are only used to explain the present invention and are not intended to limit the present invention. In addition, the embodiments and features in the embodiments of the present application may be combined with each other without conflict.
[0023] like Figure 1 As shown, an optional embodiment of the present invention provides a motor vehicle rectangular frame fitting method based on an L-shaped point cloud, comprising the following steps: S1: Acquire L-shaped point cloud data generated by the vehicle-mounted radar 1 detecting obstacle vehicles around the motor vehicle, and rasterize the L-shaped point cloud data to generate a point cloud grid network; S2: downsampling the original point cloud in the point cloud grid network to generate a target point cloud, screening all the target point clouds in the point cloud grid network to obtain a target point cloud set of the outer envelope of the obstacle vehicle, and reordering each of the target point clouds in the target point cloud set according to a predetermined sorting rule to generate an optimized point cloud set; S3: sequentially calculating the vector direction angles of two adjacent target point clouds in the optimized point cloud set to obtain a total direction angle set, and filtering out a body point cloud set corresponding to the body of the obstacle vehicle and a vehicle end point cloud set corresponding to the vehicle end of the obstacle vehicle from the optimized point cloud set based on the total direction angle set, and filtering out a body direction angle set corresponding to the body point cloud set from the total direction angle set; S4: calculating the direction angle mean of each vector direction angle in the vehicle body direction angle set, and solving the first vertex of the target fitting rectangular box of the obstacle vehicle in the plane coordinate system where the point cloud grid network is located based on the direction angle mean, the vehicle body point cloud set and the vehicle end point cloud set; and S5: obtaining the remaining vertices of the target fitting rectangular frame in the plane coordinate system based on the first vertex and the actual size of the obstacle vehicle, and obtaining the target fitting rectangular frame of the obstacle vehicle based on fitting of all the vertices.
[0024] In the embodiment of the present invention, the L-shaped point cloud data is rasterized to generate a point cloud grid network, and the original point cloud in the point cloud grid network is downsampled to generate a target point cloud, and only all the downsampled target point clouds in the point cloud grid network are screened to obtain a target point cloud set of the outer envelope of the obstacle vehicle, thereby effectively reducing the amount of data calculation and improving data processing efficiency; after further reordering the target point clouds to generate an optimized point cloud set, the vector direction angles of two adjacent target point clouds in the optimized point cloud set are calculated in turn, so as to respectively screen out the target point clouds from the optimized point cloud set based on the vector angle principle. A body point cloud set corresponding to the body of the obstacle vehicle and a vehicle end point cloud set corresponding to the vehicle end of the obstacle vehicle are obtained, so that the fitted target fitting rectangular frame can fit the body of the obstacle vehicle; then, by calculating the direction angle mean of each vector direction angle in the body direction angle set, the body point cloud set and the vehicle end point cloud set are combined to first solve the first vertex of the target fitting rectangular frame of the obstacle vehicle in the plane coordinate system where the point cloud grid network is located; finally, the remaining vertices of the target fitting rectangular frame can be solved in combination with the actual size of the obstacle vehicle, thereby completing the fitting of the target fitting rectangular frame of the obstacle vehicle.
[0025] In the specific implementation, in step S1, the L-type point cloud data obtained from the vehicle-mounted radar 1 is recorded as a set P={p1, p2, p3…pn}; when the L-type point cloud data is rasterized, each grid has the same size, with a length of L1 and a width of L2; the coordinate extreme values of the original point cloud in the point cloud grid network generated after rasterization are recorded as {max_x, min_x, max_y, min_y}, respectively, then the number of grid rows in the point cloud grid network is recorded as Line_num, and the number of grid columns is recorded as Column_num, wherein the calculation is first as follows: Line = (max_y-min_y) / L1; Column = (max_x-min_x) / L2; Rounding Line upwards will yield Line_num, i.e. Line_num = 1 + (the integer part of Line); Rounding up Column will give Column_num, that is, Column_num = 1 + (the integer part of Column); The point cloud pi of the L-type point cloud data is projected to the projection coordinates in the point cloud grid network, that is, the original point cloud is recorded as (Xi, Yi), and its row number and column number in the point cloud grid network are recorded as (Li, Ci), where Li represents the row number and Ci represents the column number; Temp_L=(Yi-min_y) / L1; If the fractional part of Temp_L is not 0, let Li = 1 + (the integer part of Temp_L); If the decimal part of Temp_L is 0, let Li=Temp_L; If Temp_L is 0, set Li=1; Temp_C = (Xi-min_x) / L2; If the decimal part of Temp_C is not 0, let Ci=1+(the integer part of Temp_C); If the decimal part of Temp_C is 0, let Ci=Temp_C; If Temp_C is 0, set Ci=1.
[0026] In an optional embodiment of the present invention, downsampling the original point cloud in the point cloud grid network to generate the target point cloud specifically refers to: calculating the mean coordinate point of all original point clouds in the same grid in the point cloud grid network, and using the mean coordinate point as the target point cloud. In this embodiment, according to the row number and column number of each original point cloud in the point cloud grid network, by solving the corresponding mean coordinate point for all original point clouds in the same grid, downsampling can be achieved, reducing the amount of calculation and improving fitting efficiency.
[0027] In a specific embodiment, it is assumed that there are N original point clouds in the grid of the Lth row and the Cth column of the point cloud grid network, and the point set is recorded as Plc={plc1, plc2, plc3…plcn}, then the mean coordinate point in the grid is recorded as (lc_x, lc_y), where: lc_x=(Xplc1+Xplc2+…+Xplcn) / N; lc_y=(Yplc1+Yplc2+…+Yplcn) / N; Furthermore, assuming that the point cloud grid network has a total of M grids containing the original point cloud, a total of M mean coordinate points (target point cloud) can be obtained in the point cloud grid network, that is, the mean point is a set Mean_P={pm1, pm2, pm3…pmm}.
[0028] In an optional embodiment of the present invention, the screening of all the target point clouds in the point cloud grid network to obtain a target point cloud set of the outer envelope of the obstacle vehicle specifically includes: Filtering out the target point clouds with the smallest row numbers in each column grid from the point cloud grid network as the first point cloud set; Extracting the minimum and maximum values of the horizontal coordinates of the original point cloud from the point cloud grid network, comparing the absolute value of the minimum value of the horizontal coordinate with the absolute value of the maximum value, and when the absolute value of the minimum value of the horizontal coordinate is less than the absolute value of the maximum value, selecting the target point clouds with the smallest column number in each row of the grid from the point cloud grid network as the second point cloud set, otherwise selecting the target point clouds with the largest column number in each row of the grid from the point cloud grid network as the second point cloud set; and The union of the first point cloud set and the second point cloud set is used as the target point cloud set.
[0029] In this embodiment, to extract the outer envelope of the obstacle vehicle (the lower contour and the contours of the left and right sides), among which, the lower contour can be obtained by finding the target point cloud closest to the horizontal axis of the coordinate in each grid of each row, and for the left and right side contours, it is necessary to first judge the magnitude relationship between the absolute value of the minimum value of the abscissa and the absolute value of the maximum value, so as to ensure the contour closer to the vertical axis of the coordinate and avoid extraction failure. Finally, the union of the extracted contours is taken to obtain the set of target point clouds of the outer envelope of the obstacle vehicle.
[0030] In the specific implementation, when extracting the first point cloud set, knowing the position (L, C) of each grid, to find all the grids where C = i, assume that there are a total of K grids with target point clouds, 0 ≤ K ≤ Line_num. Denote all the grids that meet the conditions as G = {g1, g2...gk}, then find the grid with the smallest row number in the set G, and its corresponding target point cloud is (lc_x, lc_y). Finally, after processing all columns, TL (0 < T1 ≤ Colum_num) mean points are obtained, then the first point cloud set TL = {p1, p2, p3...ptl}; When extracting the second point cloud set, first compare |min_x| with |max_x|; If |min_x| is less than |max_x|, it indicates that the target point clouds with the smallest column numbers in each row grid selected from the point cloud grid network are closer to the vertical axis of the coordinate. Corresponding ones are extracted as the second point cloud set. The processing of the j-th row grid is as follows: knowing the position (L, C) of each grid, find all the grids where L = j. Assume that there are a total of S grids with target point clouds, 0 ≤ S ≤ Colum_num. Denote all the grids that meet the conditions as R = {r1, r2, r3...rs}, then find the grid with the smallest column number in the set R, and record its corresponding target point cloud as (lc_x, lc_y). Finally, after processing all rows, TS (0 < TS ≤ Line_num) target point clouds are obtained, then the second point cloud set is denoted as TS = {p1, p2, p3...pts}; If |min_x| is greater than or equal to |max_x|, it indicates that the target point clouds with the largest column numbers in each row grid selected from the point cloud grid network are closer to the vertical axis of the coordinate. Corresponding ones are extracted as the second point cloud set. The processing of the j-th row grid is as follows: knowing the position (L, C) of each grid, find all the grids where L = j. Assume that there are a total of S grids with target point clouds, 0 ≤ S ≤ Colum_num. Denote all the grids that meet the conditions as R = {r1, r2, r3...rs}, then find the grid with the largest column number in the set R, and record its corresponding target point cloud (lc_x, lc_y). Finally, after processing all rows, TS (0 < TS ≤ Line_num) target point clouds are obtained, then the second point cloud set is denoted as TS = {p1, p2, p3...pts}; Finally, the target point cloud set NP={p1, p2…pnp} is obtained by unioning the first point cloud set TL and the second point cloud set TS, with a total of np points.
[0031] At the end of step S2, according to the grid position corresponding to the target point cloud set NP, each target point cloud is reordered in ascending order of column numbers. If there are target point clouds with the same column numbers, they are stored in descending order of row numbers. After the target point cloud set NP is reordered according to the rules, the optimized point cloud set W is obtained.
[0032] In an optional embodiment of the present invention, the step of respectively selecting a body point cloud set corresponding to the body of the obstacle vehicle and a vehicle end point cloud set corresponding to the vehicle end of the obstacle vehicle from the optimized point cloud set based on the total direction angle set, and selecting a body direction angle set corresponding to the body point cloud set from the total direction angle set specifically includes: Calculating the angle difference between two adjacent vector direction angles in the total direction angle set in sequence, comparing the angle difference with a preset difference, and taking the target point cloud corresponding to the angle difference greater than the preset difference in the optimized point cloud set as the target inflection point; Splitting the optimized point cloud set into two sub-point cloud sets with the target inflection point as a dividing point, comparing the number of target point clouds contained in the two sub-point cloud sets, and taking the sub-point cloud set containing a larger number of target point clouds as the vehicle body point cloud set and the other sub-point cloud set as the vehicle end point cloud set; and A corresponding vehicle body direction angle set is filtered out from the total direction angle set based on the vehicle body point cloud set.
[0033] In order to distinguish the vehicle body point cloud set from the vehicle end point cloud set, the vector direction angles of the two adjacent target point clouds in the optimized point cloud set W are calculated to obtain the total direction angle set, that is, the vector direction angle composed of the i-th point and the i+1-th point is calculated accordingly, denoted as α i , 1≤i≤(np-1), the specific calculation formula is: (Formula 1); Based on the above calculation formula, we can get the total direction angle set Angle = {α1, α2, …α np-1}; In this embodiment, in the total direction angle set Angle, the angle difference between the ith direction and the i+1th direction is calculated accordingly, and is recorded as det_A i , then 1≤i≤(np-2); find det_A jThe target point cloud j corresponding to the difference greater than the preset difference is recorded as the target inflection point. Since the number of point clouds on the body side is obviously more than the number of point clouds on the vehicle end side, the number of target point clouds stored on the left and right sides of the target inflection point is found out in the point cloud set by comparison and optimization. The sub-point cloud set with a large number of target point clouds is the body, and the other sub-point cloud set corresponds to the vehicle end (the front or the rear); the body point cloud set is recorded as W1, the vehicle end point cloud set is recorded as W2, and the body direction angle set is recorded as C1.
[0034] In an optional embodiment of the present invention, the predetermined sorting rule is: prioritize sorting in ascending order of column numbers, and for those with the same column numbers, sort in descending order of row numbers. In this embodiment, the above sorting rule is used to re-sort the target point clouds in the target point cloud set, ensuring that the target point clouds can be arranged in the order of the outer envelope of the motor vehicle, thereby facilitating the subsequent calculation of the target inflection point.
[0035] In an optional embodiment of the present invention, Figure 2 As shown, the step of solving the first vertex of the target fitting rectangular frame of the obstacle vehicle in the plane coordinate system where the point cloud grid network is located based on the direction angle mean, the vehicle body point cloud set and the vehicle end point cloud set specifically includes: Constructing a first predetermined straight line and a second predetermined straight line in the plane coordinate system where the point cloud grid network is located, respectively, wherein the slope of the first predetermined straight line is the tangent value of the mean value of the direction angle and passes through a first predetermined far point located below the point cloud grid network and separated from the point cloud grid network by a predetermined distance, and the second predetermined straight line is perpendicular to the first predetermined straight line and passes through a second predetermined far point located below the point cloud grid network and separated from the point cloud grid network by a predetermined distance; Selecting the target point cloud with the smallest actual distance from the first predetermined straight line from the vehicle body point cloud set as the first reference point cloud, and selecting the target point cloud with the smallest actual distance from the second predetermined straight line from the vehicle end point cloud set as the second reference point cloud; and A third predetermined straight line perpendicular to the first predetermined straight line is constructed in a plane coordinate system through the first reference point cloud, and a fourth predetermined straight line perpendicular to the second predetermined straight line is constructed in a plane coordinate system through the second reference point cloud, and the intersection of the third predetermined straight line and the fourth predetermined straight line is used as the first vertex of the target fitting rectangular box of the obstacle vehicle.
[0036] After the vehicle body direction angle set C1 is obtained by calculation, the direction angle mean of all vector direction angles in the vehicle body direction angle set C1 is calculated first, recorded as θ. The direction angle mean θ is the angle between the vehicle body of the obstacle vehicle and the horizontal axis of the coordinate, that is, the angle between the target fitting rectangular frame and the horizontal axis of the coordinate. In this embodiment, see Figure 2In the figure, the black dot is the target point cloud in the optimized point cloud set. In order to find a vertex of the target fitting rectangular frame, the first predetermined straight line L1 and the second predetermined straight line L2 are constructed respectively, wherein the slope k1 of the first predetermined straight line L1 is calculated with reference to the mean value θ of the direction angle, and through the first predetermined far point U (X0, Y0), it can be understood that the first predetermined far point U is far away from the entire point cloud (at least not less than 20m), ensuring that L1 is below the entire point cloud W; the distance from the target point cloud in the body point cloud set W1 to the first predetermined straight line L1 is calculated respectively, and the target point cloud corresponding to the minimum distance is found as the first reference point cloud, and the third predetermined straight line passing through the first reference point cloud and having a slope of k1 is recorded as L3, and it is considered that one side of the body is on L3; Since the adjacent sides of the rectangular frame are perpendicular to each other, the slope of the second predetermined straight line L2 is k2=-1 / k1. Similarly, find the second predetermined far point H (X1, Y1), which is farther from the entire point cloud and is below the entire point cloud; calculate the distance from the target point cloud in the vehicle end point cloud set to the second predetermined straight line L2 respectively, find the target point cloud corresponding to the minimum distance as the second reference point cloud, and record the straight line passing through the second reference point cloud with a slope of k2 as the fourth predetermined straight line L4. It is considered that one side of the vehicle end (front or rear) is on the fourth predetermined straight line L4; Finally, the intersection of the third predetermined straight line L3 and the fourth predetermined straight line L4 is the first vertex of the target fitting rectangular frame, and the first vertex is denoted as A, and the coordinates are (Xa, Ya).
[0037] Since the third predetermined straight line L3 and the fourth predetermined straight line L4 pass through the first reference point cloud and the second reference point cloud respectively, it is ensured that the solved fitting rectangular frame can fit the obstacle vehicle.
[0038] In an optional embodiment of the present invention, the first predetermined far point and the second predetermined far point are respectively selected in the plane coordinate system by the following method: Extracting the minimum and maximum values of the horizontal coordinates of the original point cloud and the minimum value of the vertical coordinates of the original point cloud from the point cloud grid network; and Any coordinate point in the plane coordinate system that satisfies the following conditions is selected as the first predetermined far point and the second predetermined far point: the horizontal coordinate is between the minimum value and the maximum value of the horizontal coordinate of the original point cloud, the vertical coordinate is less than the minimum value of the vertical coordinate of the original point cloud and the distance from the minimum value of the vertical coordinate of the original point cloud is not less than a predetermined distance.
[0039] In this embodiment, when selecting the first predetermined far point and the second predetermined far point in the plane coordinate system, the approximate range of the grid point cloud network can be determined first: the maximum horizontal and vertical axes; the minimum horizontal and vertical axes (in Figure 2Then, to ensure that the first predetermined far point and the second predetermined far point are below the grid point cloud network (usually the right direction of the horizontal axis is considered to be the positive direction, and the upward direction of the vertical axis is considered to be the positive direction), their corresponding vertical coordinate values should be smaller than the minimum vertical coordinate axis of the grid point cloud network; and to ensure the distance requirement, the vertical coordinate value of the selected coordinate point can be lower than the predetermined distance corresponding to the minimum vertical coordinate axis of the grid point cloud network. At the same time, to facilitate calculation and reduce the amount of calculation, the horizontal coordinate value of the selected coordinate point should be between the maximum horizontal coordinate and the minimum horizontal coordinate of the grid point cloud network.
[0040] It can be understood that the selection principle of the first predetermined far point and the second predetermined far point is to ensure that the constructed first predetermined straight line and the second predetermined straight line intersect with the grid point cloud network at at most one point under the premise that the slope remains unchanged.
[0041] In an optional embodiment of the present invention, Figure 2 As shown, the method of obtaining the remaining vertices of the target fitting rectangular frame in the plane coordinate system based on the first vertex and the actual size of the obstacle vehicle specifically includes: In the plane coordinate system, taking the first vertex as the starting point, respectively move along the third predetermined straight line and the fourth predetermined straight line by corresponding lengths according to the length and width of the obstacle vehicle to obtain the second vertex and the third vertex of the target fitting rectangular frame; constructing a fifth predetermined straight line perpendicular to the third predetermined straight line through the second vertex, and constructing a sixth predetermined straight line perpendicular to the fourth predetermined straight line through the third vertex; and The intersection point of the fifth predetermined straight line and the sixth predetermined straight line is used as the fourth vertex of the target fitting rectangular frame.
[0042] In this embodiment, under the premise of determining the first vertex A of the target fitting rectangular frame and the positions of the two sides constituting the first vertex A, the corresponding calculation is performed in combination with the length and width dimensions of the obstacle vehicle (for example: 4.5m long and 1.8m wide), and the second vertex B and the third vertex C of the target fitting rectangular frame can be obtained accordingly; finally, under the premise of knowing the three vertices, based on the principle that the adjacent sides are perpendicular and intersect at the vertices, the fifth predetermined straight line L5 and the sixth predetermined straight line L6 are constructed respectively, and the intersection of the fifth predetermined straight line L5 and the sixth predetermined straight line L6 is the fourth vertex D of the target fitting rectangular frame. Given the four vertices A, B, C and D of the target fitting rectangular frame, the target fitting rectangular frame ( Figure 2 In a specific implementation, the length and width of the obstacle vehicle can be determined by the vehicle type through the vehicle camera, and then obtained according to the standard size of the vehicle type.
[0043] On the other hand, Figure 3 As shown, an embodiment of the present invention provides a motor vehicle rectangular frame fitting device 3 based on L-shaped point cloud, which is connected to a vehicle-mounted radar 1. The device 3 includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the motor vehicle rectangular frame fitting method based on L-shaped point cloud as described in any one of the above items is implemented.
[0044] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 32 and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the L-shaped point cloud-based vehicle rectangular frame fitting device 3. For example, the computer program may be divided into Figure 4 The functional modules in the L-shaped point cloud-based rectangular frame fitting device 3 for a motor vehicle, wherein the point cloud rasterization module 41, the point cloud downsampling and envelope extraction module 42, the point cloud classification module 43, the vertex solving module 44 and the rectangular frame fitting module 45 respectively correspond to executing the above steps S1 to S5.
[0045] The motor vehicle rectangular frame fitting device 3 based on L-shaped point cloud can be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The motor vehicle rectangular frame fitting device 3 based on L-shaped point cloud can include, but is not limited to, a processor 30 and a memory 32. Those skilled in the art can understand that the schematic diagram is only an example of the motor vehicle rectangular frame fitting device 3 based on L-shaped point cloud, and does not constitute a limitation on the motor vehicle rectangular frame fitting device 3 based on L-shaped point cloud. It can include more or less components than shown in the figure, or combine certain components, or different components. For example, the motor vehicle rectangular frame fitting device 3 based on L-shaped point cloud can also include input and output devices, network access devices, buses, etc.
[0046] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 30 is the control center of the motor vehicle rectangular frame fitting device 3 based on the L-shaped point cloud, and uses various interfaces and lines to connect various parts of the entire motor vehicle rectangular frame fitting device 3 based on the L-shaped point cloud.
[0047] The memory 32 can be used to store the computer program and / or module. The processor 30 realizes various functions of the motor vehicle rectangular frame fitting device 3 based on L-shaped point cloud by running or executing the computer program and / or module stored in the memory 32 and calling the data stored in the memory 32. The memory 32 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a graphic recognition function, a graphic stacking function, etc.), etc.; the data storage area can store data (such as graphic data, etc.) created according to the use of the control device, etc. In addition, the memory 32 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0048] If the functions described in the embodiments of the present invention are implemented in the form of software function modules or units and sold or used as independent products, they can be stored in a storage medium readable by a computing device. Based on this understanding, the embodiments of the present invention implement all or part of the processes in the above-mentioned embodiments, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor 30, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0049] In a specific implementation, the vehicle-mounted radar 1 is a laser radar or a millimeter wave radar. In this embodiment, as common obstacle detection and point cloud data generation radars on motor vehicles, laser radars or millimeter wave radars can accurately detect obstacle vehicles.
[0050] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the motor vehicle rectangular frame fitting method based on L-shaped point cloud as described in the above embodiment.
[0051] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0052] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, which all belong to the protection scope of the present invention.
Claims
1. A motor vehicle rectangular frame fitting method based on L-shaped point cloud, characterized in that: The method comprises the following steps: Acquire L-shaped point cloud data generated by the vehicle-mounted radar detecting obstacle vehicles around the motor vehicle, and rasterize the L-shaped point cloud data to generate a point cloud grid network; Downsampling the original point cloud in the point cloud grid network to generate a target point cloud, screening all the target point clouds in the point cloud grid network to obtain a target point cloud set of the outer envelope of the obstacle vehicle, and reordering each of the target point clouds in the target point cloud set according to a predetermined sorting rule to generate an optimized point cloud set; Sequentially calculating the vector direction angles of two adjacent target point clouds in the optimized point cloud set to obtain a total direction angle set, and filtering out a body point cloud set corresponding to the body of the obstacle vehicle and a vehicle end point cloud set corresponding to the vehicle end of the obstacle vehicle from the optimized point cloud set based on the total direction angle set, and filtering out a body direction angle set corresponding to the body point cloud set from the total direction angle set; Calculating the direction angle mean of each vector direction angle in the vehicle body direction angle set, and solving the first vertex of the target fitting rectangular box of the obstacle vehicle in the plane coordinate system where the point cloud grid network is located based on the direction angle mean, the vehicle body point cloud set and the vehicle end point cloud set; and The remaining vertices of the target fitting rectangular frame in the plane coordinate system are obtained based on the first vertex and the actual size of the obstacle vehicle, and the target fitting rectangular frame of the obstacle vehicle is obtained based on the fitting of all the vertices.
2. The motor vehicle rectangular frame fitting method based on L-shaped point cloud according to claim 1, characterized in that: The downsampling of the original point cloud in the point cloud grid network to generate the target point cloud specifically refers to: calculating the mean coordinate point of all the original point clouds in the same grid in the point cloud grid network, and taking the mean coordinate point as the target point cloud.
3. The motor vehicle rectangular frame fitting method based on L-shaped point cloud according to claim 1, characterized in that: The screening of all the target point clouds in the point cloud grid network to obtain a target point cloud set of the outer envelope of the obstacle vehicle specifically includes: Filtering out the target point clouds with the smallest row numbers in each column grid from the point cloud grid network as the first point cloud set; Extracting the minimum and maximum values of the horizontal coordinates of the original point cloud from the point cloud grid network, comparing the absolute value of the minimum value of the horizontal coordinate with the absolute value of the maximum value, and when the absolute value of the minimum value of the horizontal coordinate is less than the absolute value of the maximum value, selecting the target point clouds with the smallest column number in each row of the grid from the point cloud grid network as the second point cloud set, otherwise selecting the target point clouds with the largest column number in each row of the grid from the point cloud grid network as the second point cloud set; and The union of the first point cloud set and the second point cloud set is used as the target point cloud set.
4. The motor vehicle rectangular frame fitting method based on L-shaped point cloud according to claim 1, characterized in that: The predetermined sorting rule is: sorting in ascending order of column numbers first, and sorting in descending order of row numbers for columns with the same column numbers.
5. The motor vehicle rectangular frame fitting method based on L-shaped point cloud according to claim 1, characterized in that: The step of selecting a body point cloud set corresponding to the body of the obstacle vehicle and a vehicle end point cloud set corresponding to the vehicle end of the obstacle vehicle from the optimized point cloud set based on the total direction angle set, and selecting a body direction angle set corresponding to the body point cloud set from the total direction angle set specifically includes: Calculating the angle difference between two adjacent vector direction angles in the total direction angle set in sequence, comparing the angle difference with a preset difference, and taking the target point cloud corresponding to the angle difference greater than the preset difference in the optimized point cloud set as the target inflection point; Splitting the optimized point cloud set into two sub-point cloud sets with the target inflection point as a dividing point, comparing the number of target point clouds contained in the two sub-point cloud sets, and taking the sub-point cloud set containing a larger number of target point clouds as the vehicle body point cloud set and the other sub-point cloud set as the vehicle end point cloud set; and A corresponding vehicle body direction angle set is filtered out from the total direction angle set based on the vehicle body point cloud set.
6. The motor vehicle rectangular frame fitting method based on L-shaped point cloud according to claim 1 or 5, characterized in that: The step of solving the first vertex of the target fitting rectangular frame of the obstacle vehicle in the plane coordinate system where the point cloud grid network is located based on the direction angle mean, the vehicle body point cloud set and the vehicle end point cloud set specifically includes: Constructing a first predetermined straight line and a second predetermined straight line in the plane coordinate system where the point cloud grid network is located, respectively, wherein the slope of the first predetermined straight line is the tangent value of the mean value of the direction angle and passes through a first predetermined far point located below the point cloud grid network and separated from the point cloud grid network by a predetermined distance, and the second predetermined straight line is perpendicular to the first predetermined straight line and passes through a second predetermined far point located below the point cloud grid network and separated from the point cloud grid network by a predetermined distance; Selecting the target point cloud with the smallest actual distance from the first predetermined straight line from the vehicle body point cloud set as the first reference point cloud, and selecting the target point cloud with the smallest actual distance from the second predetermined straight line from the vehicle end point cloud set as the second reference point cloud; and A third predetermined straight line perpendicular to the first predetermined straight line is constructed in a plane coordinate system through the first reference point cloud, and a fourth predetermined straight line perpendicular to the second predetermined straight line is constructed in a plane coordinate system through the second reference point cloud, and the intersection of the third predetermined straight line and the fourth predetermined straight line is used as the first vertex of the target fitting rectangular box of the obstacle vehicle.
7. The motor vehicle rectangular frame fitting method based on L-shaped point cloud according to claim 6, characterized in that: The first predetermined far point and the second predetermined far point are respectively selected in the plane coordinate system by the following method: Extracting the minimum value and the maximum value of the horizontal coordinate of the original point cloud and the minimum value of the vertical coordinate of the original point cloud from the point cloud grid network; as well as Any coordinate point in the plane coordinate system that satisfies the following conditions is selected as the first predetermined far point and the second predetermined far point: the horizontal coordinate is between the minimum value and the maximum value of the horizontal coordinate of the original point cloud, the vertical coordinate is less than the minimum value of the vertical coordinate of the original point cloud and the distance from the minimum value of the vertical coordinate of the original point cloud is not less than a predetermined distance.
8. The motor vehicle rectangular frame fitting method based on L-shaped point cloud according to claim 6, characterized in that: The method of obtaining the remaining vertices of the target fitting rectangular frame in the plane coordinate system based on the first vertex and the actual size of the obstacle vehicle specifically includes: In the plane coordinate system, taking the first vertex as the starting point, respectively move along the third predetermined straight line and the fourth predetermined straight line by corresponding lengths according to the length and width of the obstacle vehicle to obtain the second vertex and the third vertex of the target fitting rectangular frame; constructing a fifth predetermined straight line perpendicular to the third predetermined straight line through the second vertex, and constructing a sixth predetermined straight line perpendicular to the fourth predetermined straight line through the third vertex; and The intersection point of the fifth predetermined straight line and the sixth predetermined straight line is used as the fourth vertex of the target fitting rectangular frame.
9. A motor vehicle rectangular frame fitting device based on L-shaped point cloud, connected to a vehicle-mounted radar, characterized in that: The device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the motor vehicle rectangular frame fitting method based on the L-shaped point cloud as described in any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the motor vehicle rectangular frame fitting method based on L-shaped point cloud as described in any one of claims 1 to 8.
