Ranging curve drawing method and vehicle
Patent Information
- Application Number
- CN202411739766.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-14
AI Technical Summary
The existing ranging curve drawing method has major problems in computing resource consumption, resulting in a decline in vehicle-side performance.
By converting the Cartesian coordinate points of obstacles around the vehicle into polar coordinate points, and determining the curve parameters of the Bezier curve based on the polar coordinate points, the coordinate parameters under the polar coordinate system are used to directly control the drawing of the Bezier curve.
It reduces the computing resource consumption when drawing the ranging curve, reduces the computing burden and number of drawing calls of the image processor, and improves the performance of the vehicle side.
Smart Images

Figure CN119625120A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a distance measurement curve drawing method and a vehicle. Background Art
[0002] With the development of automobile electronics and intelligence, ranging sensors have become an indispensable part of modern automobiles, such as radar sensors, infrared sensors, etc. These sensors can continuously scan the environment around the vehicle, detect other vehicles, pedestrians, obstacles, etc., and provide real-time distance and speed information. In order for the driver to understand this information intuitively, the automobile instrument system needs to convert the ranging data into a visual ranging curve. This information usually needs to be displayed in a graphical way on screens such as the instrument, central control, and head-up display HUD so that users can quickly understand the environmental conditions. However, traditional ranging curves require a lot of computing resources when drawing, resulting in a decrease in the overall performance of the vehicle. Summary of the invention
[0003] In view of this, the purpose of the present application is to propose a distance measurement curve drawing method and a vehicle to solve the problem of high consumption of computing resources when drawing the existing distance measurement curve.
[0004] Based on the above purpose, the first aspect of the present application provides a distance measurement curve drawing method, comprising:
[0005] Obtaining ranging data collected by the vehicle ranging sensor;
[0006] Processing the distance measurement data to obtain a first coordinate point set of obstacles around the vehicle in a pre-constructed rectangular coordinate system;
[0007] Convert each first coordinate point in the first coordinate point set from the rectangular coordinate system to a polar coordinate system to obtain a second coordinate point set;
[0008] Determining curve parameters for drawing a Bezier curve according to the second coordinate point set;
[0009] A Bezier curve corresponding to the distance measurement data is drawn according to the curve parameters.
[0010] Optionally, converting each first coordinate point in the first coordinate point set from the rectangular coordinate system to a polar coordinate system to obtain a second coordinate point set includes:
[0011] For a rectangular coordinate system pre-constructed in each drawing partition, the rectangular coordinate system is converted into a polar coordinate system with a radian range of a first preset range through coordinate transformation; wherein the drawing partition is obtained by pre-dividing the area around the vehicle;
[0012] Counting the total number of ranging sensors in the drawing partition, determining a second preset range according to the first preset range and the total number, and transforming the arc range of the polar coordinate system into the second preset range;
[0013] Each first coordinate point in the first coordinate point set is mapped from the rectangular coordinate system to a polar coordinate system whose arc range is the second preset range to obtain the second coordinate point set.
[0014] Optionally, determining the second preset range according to the first preset range and the total number includes:
[0015] taking the product of the first preset range and the total number as a third preset range;
[0016] The third preset range is divided by the value of π to obtain the second preset range.
[0017] Optionally, the curve parameters include a control point set and auxiliary parameters; and determining the curve parameters for drawing a Bezier curve according to the second coordinate point set includes:
[0018] Selecting any unit area in the drawing partition as a target unit area, and selecting a second coordinate point corresponding to the target unit area from the second coordinate set as a target coordinate point; wherein the unit area is obtained by dividing the drawing partition according to the total number of ranging sensors in the drawing partition, and the drawing partition is obtained by dividing the area around the vehicle in advance;
[0019] Selecting a second coordinate point corresponding to a unit area adjacent to one side of the target unit area from the second coordinate set as a first auxiliary coordinate point, and selecting a second coordinate point corresponding to a unit area adjacent to the other side of the target unit area from the second coordinate set as a second auxiliary coordinate point;
[0020] Determine the control point set according to the target coordinate point, the first auxiliary coordinate point and the second auxiliary coordinate point;
[0021] The auxiliary parameter is determined according to the control point set.
[0022] Optionally, drawing a Bezier curve according to the curve parameters includes:
[0023] Draw a Bezier curve of the target unit area according to the control point set and the auxiliary parameters;
[0024] Connecting the Bezier curves corresponding to all unit areas to generate the Bezier curve for drawing the partition;
[0025] The Bezier curves of all drawn partitions are connected to generate a Bezier curve corresponding to the distance measurement data.
[0026] Optionally, determining the control point set according to the target coordinate point, the first auxiliary coordinate point, and the second auxiliary coordinate point includes:
[0027] Determine a first endpoint according to the target coordinate point and the first auxiliary coordinate point, determine a first insertion point according to the first endpoint and the target coordinate point, and combine the first endpoint, the first insertion point and the target coordinate point as a first subset;
[0028] determining a second endpoint according to the target coordinate point and the second auxiliary coordinate point, determining a second insertion point according to the second endpoint and the target coordinate point, and combining the target coordinate point, the second insertion point and the second endpoint as a second subset;
[0029] The first subset and the second subset are combined as the control point set.
[0030] Optionally, the auxiliary parameter includes a first auxiliary parameter and a second auxiliary parameter; and determining the auxiliary parameter according to the control point set includes:
[0031] Determine a first line segment according to the first endpoint and the first insertion point, and select any point on the first line segment as a first target auxiliary parameter point;
[0032] Determine a first arc of the first target auxiliary parameter point in the polar coordinate system;
[0033] Extracting a first decimal part of the first radian, and in response to the first decimal part being greater than a preset threshold, processing the first decimal part according to a first preset processing rule to obtain the first auxiliary parameter; in response to the first decimal part being less than or equal to the preset threshold, processing the first decimal part according to a second preset processing rule to obtain the first auxiliary parameter;
[0034] Determine a second line segment according to the target coordinate point and the second insertion point, and select any point on the second line segment as a second target auxiliary parameter point;
[0035] Determine a second arc of the second target auxiliary parameter point in the polar coordinate system;
[0036] Extract the second decimal part of the second radian, and in response to the second decimal part being greater than a preset threshold, process the second decimal part according to a first preset processing rule to obtain the second auxiliary parameter; in response to the second decimal part being less than or equal to the preset threshold, process the second decimal part according to a second preset processing rule to obtain the second auxiliary parameter.
[0037] Optionally, the method further includes:
[0038] Determining the display color of each first coordinate point in the first coordinate point set according to a preset display color rule;
[0039] Coloring the Bezier curve according to the display color of each first coordinate point;
[0040] Displays a shaded Bezier curve.
[0041] Optionally, determining the display color of each first coordinate point in the first coordinate point set according to a preset display color rule includes:
[0042] The display color of each first coordinate point is determined according to the distance between the first coordinate point and the origin of the rectangular coordinate system.
[0043] Optionally, determining the display color of each first coordinate point according to the distance between the first coordinate point and the origin of the rectangular coordinate system includes:
[0044] In response to the distance between the first coordinate point and the origin being within a first preset range, determining that the display color of the first coordinate point is a first color;
[0045] In response to the distance between the first coordinate point and the origin being within a second preset range, determining that the display color of the first coordinate point is a second color;
[0046] In response to the distance between the first coordinate point and the origin being within a third preset range, determining that the display color of the first coordinate point is a third color;
[0047] The value of the second preset range is greater than the value of the first preset range, and the value of the third preset range is greater than the value of the second preset range.
[0048] Optionally, the origin of the rectangular coordinate system is determined according to the positions of all ranging sensors within the drawing partition.
[0049] A second aspect of the present application provides a vehicle, the vehicle comprising:
[0050] A memory for storing executable program codes;
[0051] A processor is used to call and run the executable program code from the memory so that the vehicle executes the method described in the first aspect.
[0052] As can be seen from the above, the distance measurement curve drawing method and vehicle provided by the present application include obtaining the distance measurement data collected by the vehicle distance measurement sensor, performing data processing on the distance measurement data, and obtaining a first coordinate point set of obstacles around the vehicle in a pre-constructed rectangular coordinate system, which provides a data basis for the subsequent distance measurement curve drawing. Each first coordinate point in the first coordinate point set is converted from the rectangular coordinate system to the polar coordinate system to obtain a second coordinate point set, and the curve parameters for drawing the Bezier curve are determined according to the second coordinate point set, and the Bezier curve corresponding to the distance measurement data is drawn according to the curve parameters. After the coordinate conversion, the coordinate values in the rectangular coordinate system are converted into the coordinate values in the polar coordinate system. Since the coordinate parameters in the polar coordinate system include the polar diameter ρ and the polar angle θ, compared with the coordinate parameters (x, y) in the rectangular coordinate system, the polar diameter ρ and the polar angle θ can more intuitively present the coordinate changes of obstacles in the arc area around the vehicle (such as the area corresponding to the front and rear of the vehicle). If the coordinate parameters in the rectangular coordinate system are used directly, it is also necessary to indirectly calculate the angle according to the coordinate parameters of the rectangular coordinate system, which increases the amount of calculation. Through the coordinate conversion in this application, the curve parameters can be directly determined by the coordinate values of the obstacles in the polar coordinate system, and then the drawing of the Bezier curve can be controlled, reducing the consumption of computing resources. In addition, compared with the traditional drawing process, it is necessary to set the step size and perform cyclic iterative calculations according to the step size to obtain the Bezier curve. Since the coordinate system is introduced when drawing the Bezier curve in this application, and the numerical changes in the coordinate system are continuous, there is no need to set the step size or perform cyclic iterative calculations. It is equivalent to using the natural changes of the coordinates in the polar coordinate system to control the drawing of the Bezier curve. Therefore, it can also reduce the consumption of computing resources in the process of drawing the Bezier curve, reduce the computing burden and the number of drawing calls of the image processor on the vehicle side, and thus improve the performance of the vehicle side. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0054] Figure 1 A schematic diagram of the flow of a distance measurement curve drawing method according to an embodiment of the present application;
[0055] Figure 2 A schematic diagram of drawing partitions according to an embodiment of the present application;
[0056] Figure 3 For the embodiments of this application Figure 2 A partial enlarged schematic diagram of area A in the middle;
[0057] Figure 4 A schematic diagram of a Bezier curve in a unit area in an embodiment of the present application;
[0058] Figure 5 A schematic diagram of a distance measurement curve according to an embodiment of the present application;
[0059] Figure 6 A schematic diagram of the structure of a distance measurement curve drawing device according to an embodiment of the present application;
[0060] Figure 7 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0062] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0063] As described in the background technology, Bezier curves are usually used to visualize the distance measurement data. By drawing the Bezier curve, a smooth distance measurement curve can be obtained, which helps users to intuitively and quickly understand the obstacle information around the vehicle. However, when drawing the traditional distance measurement curve, the CPU side is mostly used to calculate the Bezier curve point set. When drawing the Bezier curve, it is necessary to select a suitable step size, such as 0.01 or 0.001, and the step size determines the density of the points on the Bezier curve. Then a loop is used to start from t = 0 and increase the selected step size until t = 1. The points on the corresponding Bezier curve are calculated during each iteration, that is, the Bezier curve is drawn in a loop iteration manner. If the Bezier curve needs to be displayed on a high-resolution screen, the step size setting needs to be less than 0.001 to ensure the display effect. This loop iteration calculation method consumes significant computing resources on the CPU side.
[0064] This traditional drawing method often has the following disadvantages:
[0065] 1. Computational resource consumption: Traditional distance measurement curve drawing methods may require a lot of computing resources, especially when processing complex Bezier curves, which consumes a lot of computing resources on the CPU side, resulting in a decrease in CPU performance;
[0066] 2. Drawing delay: If the data processing and drawing process is not efficient enough, it may cause a delay in the displayed ranging curve, affecting real-time performance;
[0067] 3. Display accuracy: In some cases, the distance measurement curve may not be drawn with sufficient accuracy to accurately reflect small distance changes or fast-moving objects;
[0068] 4. Visual effect: Some drawing methods may not be visually smooth enough, resulting in a deviation in the driver's understanding of the curve.
[0069] Based on the above defects, the present application proposes a method for drawing a ranging curve, which can directly control the drawing of the Bezier curve by using the natural change of coordinates, avoid using the loop iteration method to draw the Bezier curve, significantly reduce the occupation of vehicle-side computing resources when drawing the ranging curve, reduce the ranging curve delay, and improve the vehicle-side performance. By subdividing the area, the display accuracy of the ranging curve is improved. The method of connecting multiple Bezier curves is adopted to further improve the smoothness of the curve, making the radar curve smoother and easier to understand. By converting the rectangular coordinate system into a polar coordinate system, since the coordinate parameters in the polar coordinate system can intuitively present the position of obstacles in the arc area around the vehicle, the calculation amount consumption when calculating the angle by the coordinate value in the rectangular coordinate system is avoided, and the drawing rate of the Bezier curve can be further improved. The solution of the present application is to perform calculations on the GPU side. Compared with the CPU side, the GPU side is more efficient in processing graphics algorithms. Especially when the ranging data changes, the response speed of the GPU side is significantly higher than the corresponding speed of the CPU side. Using the GPU side to perform calculations is more suitable for scenes that require real-time rendering and have high performance requirements, such as the vehicle-side ranging curve display scene.
[0070] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0071] This application proposes a radar curve drawing method, referring to Figure 1 , including the following steps:
[0072] Step 102: Acquire ranging data collected by the vehicle ranging sensor.
[0073] Specifically, the ranging data is collected by the ranging sensors installed on the vehicle. The ranging sensors include radar sensors, infrared sensors, laser sensors, and the like. Taking radar sensors as an example, the distribution of vehicle radars usually includes forward radar, side radar, rear radar, lidar, and ultrasonic radar. The forward radar is usually located in the front bumper or grille of the vehicle to detect vehicles, pedestrians, obstacles, and road conditions in front. The side radar is installed in the front and rear wheel arches, side skirts, or rearview mirrors of the vehicle to detect obstacles on both sides of the vehicle. The rear radar is usually installed in the rear bumper of the vehicle to detect rear vehicles, pedestrians, and obstacles. The layout and type of these radars are designed according to the different functions of the vehicle and the requirements of driving scenarios to ensure that the vehicle can drive and park safely and effectively in various environments. The ranging data can reflect the distance between the vehicle body and surrounding obstacles.
[0074] Step 104: Process the distance measurement data to obtain a first coordinate point set of obstacles around the vehicle in a pre-constructed rectangular coordinate system.
[0075] Specifically, a rectangular coordinate system is pre-constructed, and the origin of the rectangular coordinate system is located on the vehicle body. The ranging data is converted into a first coordinate point set in the rectangular coordinate system. Each first coordinate point in the first coordinate point set represents the coordinates of the obstacle in the rectangular coordinate system. The first coordinate point set contains the position coordinates of all obstacles in the area around the vehicle. It should be noted that the visualized ranging curve reflects the position schematic diagram of obstacles that are close to the vehicle, such as obstacles that are within 150 cm from the vehicle body.
[0076] Due to the different positions of the ranging sensors installed on the vehicle body, in order to facilitate drawing, the area around the vehicle is divided into four drawing partitions in this application, namely the area in front of the vehicle, the area behind the vehicle, the area on the left side of the vehicle, and the area on the right side of the vehicle. Among them, the area in front of the vehicle and the area behind the vehicle are arc-shaped areas. Accordingly, a rectangular coordinate system is constructed in each drawing partition, and the origin of each rectangular coordinate system is determined according to the position of all ranging sensors in the drawing partition. The origin of the rectangular coordinate system is located at the center of all ranging sensors and on the vehicle body. The method of constructing rectangular coordinates can take into account the distribution of ranging sensors in the entire drawing partition, so that the determined obstacle position is more reasonable and subsequent calculations are more convenient. Figure 2 A schematic diagram of drawing partitions is shown, such as Figure 2 As shown, the area around the vehicle includes four drawing partitions, namely, area A, area B, area C, and area D. Each drawing partition contains a rectangular coordinate system. In order to further save computing resources, only the first and second quadrants are intercepted in each rectangular coordinate system. The first and second quadrants can include the coordinate points of obstacles in the drawing partition. Therefore, the third and fourth quadrants can be discarded to reduce the occupation of computing resources. Exemplarily, point a and point b in area A represent the position of the obstacle in the rectangular coordinate system.
[0077] Step 106: Convert each first coordinate point in the first coordinate point set from the rectangular coordinate system to a polar coordinate system to obtain a second coordinate point set.
[0078] refer to Figure 2 In area A and area B, the detection area of each ranging sensor is a sector area with an arc. In each drawn partition, the drawn partition is divided into regions according to the number of ranging sensors, and each ranging sensor corresponds to an area, which is recorded as a unit area. By subdividing the drawn partition according to the total number of ranging sensors to obtain multiple unit areas, it can ensure that the Bezier curve accurately reflects the distance data of obstacles around the vehicle, and improve the display accuracy of the ranging curve. Figure 2In the figure, area A is divided into 6 unit areas. Since each unit area is divided according to the angle, the polar angle θ in the coordinate parameters (ρ, θ) in the polar coordinate system can more intuitively characterize the change of the angle, while the coordinate parameters (x, y) in the rectangular coordinate system still need further calculation to obtain the angle value in the coordinate system. Therefore, the use of polar coordinates is more suitable for the curve drawing in these two areas (A and B). Similarly, multiple unit areas can also be divided in other drawing areas. Since the third quadrant and the fourth quadrant in the rectangular coordinate system are discarded in step 104, when converted to the polar coordinate system, the initial radian range of the polar coordinate system is 0 to π. Afterwards, the first coordinate point in each first coordinate point set is converted to the polar coordinate system to obtain a second coordinate point set.
[0079] Step 108: Determine curve parameters for drawing a Bezier curve according to the second coordinate point set.
[0080] Specifically, the Bezier curve drawn in this embodiment can be a second-order Bezier curve or a high-order Bezier curve. The drawing of the Bezier curve is based on the control points and auxiliary parameters. The Bezier curve is generated by determining the position of the control points and using the auxiliary parameters. Taking the second-order Bezier curve as an example, the number of control points is 3. Select an appropriate second coordinate point from the second coordinate point set, and determine the three control points for drawing the second-order Bezier curve based on the second coordinate point. After the control point is determined, the auxiliary parameters can be selected based on the control point, and the auxiliary parameters are numbers defined in the [0,1] interval.
[0081] Step 110: Draw a Bezier curve corresponding to the distance measurement data according to the curve parameters.
[0082] Specifically, after the control points and auxiliary parameters are determined, the auxiliary parameters are changed in the interval [0,1], and multiple points are generated, and the multiple points are connected to form a Bezier curve. The method of generating a Bezier curve based on the control points and auxiliary parameters is a conventional method in the art and will not be described in detail here.
[0083] Based on the above steps 102 to 110, this embodiment provides a distance measurement curve drawing method and a vehicle, the method comprising obtaining the distance measurement data collected by the vehicle distance measurement sensor, performing data processing on the distance measurement data, obtaining a first coordinate point set of obstacles around the vehicle in a pre-constructed rectangular coordinate system, and providing a data basis for subsequent distance measurement curve drawing. Each first coordinate point in the first coordinate point set is converted from the rectangular coordinate system to the polar coordinate system to obtain a second coordinate point set, and the curve parameters for drawing the Bezier curve are determined according to the second coordinate point set, and the Bezier curve corresponding to the distance measurement data is drawn according to the curve parameters. After the coordinate conversion, the coordinate values in the rectangular coordinate system are converted into the coordinate values in the polar coordinate system. Since the coordinate parameters in the polar coordinate system include the polar diameter ρ and the polar angle θ, compared with the coordinate parameters (x, y) in the rectangular coordinate system, the polar diameter ρ and the polar angle θ can more intuitively present the coordinate changes of obstacles in the arc area around the vehicle (such as the area corresponding to the front and rear of the vehicle). If the coordinate parameters in the rectangular coordinate system are directly used, it is also necessary to indirectly calculate the angle according to the coordinate parameters of the rectangular coordinate system, which increases the amount of calculation. Through the coordinate conversion in this application, the curve parameters can be directly determined by the coordinate values of the obstacles in the polar coordinate system, and then the drawing of the Bezier curve can be controlled, reducing the consumption of computing resources. In addition, compared with the need to set the step size in the traditional drawing process, and to perform cyclic iterative calculations according to the step size to obtain the Bezier curve, since the numerical changes in the coordinate system used in this application are continuous, there is no need to set the step size, and there is no need to perform cyclic iterative calculations, which is equivalent to using the natural changes of the coordinates in the polar coordinate system to control the drawing of the Bezier curve. Therefore, it can also reduce the consumption of computing resources in the drawing process of the Bezier curve, reduce the computing burden and the number of drawing calls of the image processor on the vehicle side, and thus improve the performance of the vehicle side. In addition, the method of this application is also suitable for vehicle instrument systems with higher real-time requirements, so that the vehicle instrument system can start up faster. The method of this application is also easy to integrate with 3D scenes. On the basis of the generated Bezier curve of the whole vehicle, the number of the z-axis is added to obtain the display effect of the 3D scene, providing users with richer and more intuitive driving assistance information.
[0084] In the process of converting the rectangular coordinate system to the polar coordinate system, in order to draw the Bezier curve sequentially, the arc range of the polar coordinate system needs to match the variation range [0,1] of the auxiliary parameters of the Bezier curve. Therefore, in the process of coordinate system conversion, the arc range of the polar coordinate system needs to be reasonably converted. The method for determining the second coordinate point set in the polar coordinate system is described below through a specific embodiment.
[0085] In some embodiments, converting each first coordinate point in the first coordinate point set from the rectangular coordinate system to a polar coordinate system to obtain a second coordinate point set includes:
[0086] For a rectangular coordinate system pre-constructed in each drawing partition, the rectangular coordinate system is converted into a polar coordinate system with a radian range of a first preset range through coordinate transformation; wherein the drawing partition is obtained by pre-dividing the area around the vehicle;
[0087] Counting the total number of ranging sensors in the drawing partition, determining a second preset range according to the first preset range and the total number, and transforming the arc range of the polar coordinate system into the second preset range;
[0088] Each first coordinate point in the first coordinate point set is mapped from the rectangular coordinate system to a polar coordinate system whose arc range is the second preset range to obtain the second coordinate point set.
[0089] Specifically, as described in the above embodiment, the rectangular coordinate system only retains the part of the y-axis coordinate that is a positive value. After conversion to the polar coordinate system, the radian range of the polar coordinate system is 0 to π (that is, the first preset range). Since the drawing process is partitioned drawing, that is, drawing is performed in each unit area, and the range of variation of the auxiliary parameters of the Bezier curve is [0,1], therefore, in order to match the digital range of the auxiliary parameters, the radian range of the polar coordinate system also needs to be appropriately transformed. Determine the total number of ranging sensors in each drawing partition, and determine the second preset range based on the total number of ranging sensors and the first preset range.
[0090] Further, determining a second preset range according to the first preset range and the total number includes:
[0091] taking the product of the first preset range and the total number as a third preset range;
[0092] The third preset range is divided by the value of π to obtain the second preset range.
[0093] For example, the total number of ranging sensors in the mapping partition is N, and the first preset range is 0 to π. The first preset range is multiplied by N to obtain the third preset range of 0 to Nπ. The third preset range is divided by π to obtain the second preset range of 0 to N. Figure 2Taking area A in as an example, area A is divided into 6 unit areas, namely A1 to A6. The arc range of each unit area is 0 to 1, 1 to 2, 2 to 3, 3 to 4, 4 to 5, and 5 to 6 from A1 to A6, and the arc range span of each unit area is 1. By converting the arc range of the polar coordinate system, the arc range span of each unit area is 1. When drawing the Bezier curve in each unit area, it is equivalent to the arc change of each unit area from 0 to 1, which matches the auxiliary parameter value range [0,1] in the Bezier curve, so that the auxiliary parameter can be associated with the polar coordinates. Since the arc change in each unit area is continuous in the polar coordinate system, the auxiliary parameter is also continuous with the arc change, and there is no need to set the step size. The Bezier curve is drawn by the cyclic iteration method according to the step size, which greatly reduces the occupation of computing resources for curve drawing. At the same time, when drawing the Bezier curve in the polar coordinate system, since the polar angle θ is the data representing the angle, there is no need to calculate the angle value additionally, which reduces the amount of data calculation compared with the rectangular coordinate system.
[0094] Each first coordinate point in the first coordinate set is mapped to a polar coordinate system with a second preset range of arcs to obtain a second coordinate point set. The transformation of the obstacle coordinate points is achieved through the transformation of the coordinate system, and the parameters required for drawing the Bezier curve are associated with the polar coordinate system, which is equivalent to directly calculating the points on the Bezier curve through the change of coordinates in the polar coordinate system. The calculation efficiency is high, which not only reduces the occupation of computing resources, but also reduces the drawing delay of the Bezier curve, providing users with real-time and accurate visual ranging curves.
[0095] Since the Bezier curve is drawn according to the curve parameters, if you want to draw the Bezier curve according to the second coordinate point set, you first need to determine the curve parameters according to the second coordinate point set. The following describes how to determine the curve parameters of the Bezier curve according to the second coordinate point set through a specific embodiment.
[0096] In some embodiments, the curve parameters include a control point set and auxiliary parameters; and determining the curve parameters for drawing a Bezier curve according to the second coordinate point set includes:
[0097] Selecting any unit area in the drawing partition as a target unit area, and selecting a second coordinate point corresponding to the target unit area from the second coordinate set as a target coordinate point; wherein the unit area is obtained by dividing the drawing partition according to the total number of ranging sensors in the drawing partition, and the drawing partition is obtained by dividing the area around the vehicle in advance;
[0098] Selecting a second coordinate point corresponding to a unit area adjacent to one side of the target unit area from the second coordinate set as a first auxiliary coordinate point, and selecting a second coordinate point corresponding to a unit area adjacent to the other side of the target unit area from the second coordinate set as a second auxiliary coordinate point;
[0099] Determine the control point set according to the target coordinate point, the first auxiliary coordinate point and the second auxiliary coordinate point;
[0100] The auxiliary parameter is determined according to the control point set.
[0101] Specifically, the second coordinate set includes the detection data of each ranging sensor in the vehicle. The calculated second coordinate set can be pre-stored in an array, and the corresponding second coordinate point can be extracted from the array when drawing the Bezier curve. When extracting the second coordinate point, the built-in function floor of the GPU can be used to round the data, that is, to extract the coordinate point stored at the integer bit number in the array. The built-in function of the GPU is hardware optimized and can provide higher computing efficiency than custom shaders, further reducing performance consumption.
[0102] Figure 3 Shows Figure 2 A partial enlarged view of area A in the middle. Figure 3 As shown, for each unit area in area A, a unit area is arbitrarily selected as the target unit area, and the obstacle detection point in the target unit area is selected from the second coordinate set. Exemplarily, the target unit area is A3, and the corresponding obstacle detection point is Y3. At this time, the unit areas adjacent to the target unit area A3 are A2 and A4. The obstacle detection point Y2 (first auxiliary coordinate point) corresponding to the unit area A2 is extracted from the second coordinate set, and the obstacle detection point Y4 (second auxiliary coordinate point) corresponding to the unit area A4 is extracted from the second coordinate set.
[0103] Further, determining the control point set according to the target coordinate point, the first auxiliary coordinate point and the second auxiliary coordinate point includes:
[0104] Determine a first endpoint according to the target coordinate point and the first auxiliary coordinate point, determine a first insertion point according to the first endpoint and the target coordinate point, and combine the first endpoint, the first insertion point and the target coordinate point as a first subset;
[0105] determining a second endpoint according to the target coordinate point and the second auxiliary coordinate point, determining a second insertion point according to the second endpoint and the target coordinate point, and combining the target coordinate point, the second insertion point and the second endpoint as a second subset;
[0106] The first subset and the second subset are combined as the control point set.
[0107] Specifically, when drawing a Bezier curve in the target unit area, in order to make the fault detection point appear on the Bezier curve and make the Bezier curve accurately reflect the position of the fault detection point, the Bezier curve in the target unit area is divided into two segments for drawing. The fault detection point is used as the end point of the first Bezier curve and the starting point of the second Bezier curve, that is, the connection point of the two Bezier curves. Figure 3 As shown, the fault detection point in the target unit area A3 is the target coordinate point Y3. Between Y3 and Y2, point Z1 is taken as the first endpoint according to a certain ratio (that is, the ratio between line segment Y3Z1 and line segment Z1Y2). The first endpoint Z1 is also the starting point of the first Bezier curve, and the target coordinate point Y3 is the end point of the first Bezier curve. Point X1 is taken as the first insertion point between the first endpoint Z1 and the target coordinate point Y3. At this time, the first endpoint Z1, the target coordinate point Y3 and the first insertion point X1 constitute three control points for determining the first Bezier curve, and are combined to form the first subset.
[0108] Similarly, between Y3 and Y4, point Z2 is taken as the second endpoint according to a certain ratio (that is, the ratio between line segment Y3Z2 and line segment Z3Y4). The second endpoint Z2 is also the end point of the second Bezier curve, and the target coordinate point Y3 is the starting point of the second Bezier curve. Among them, the point selection ratio of point Z2 and point Z1 is the same. Point X2 is taken as the second insertion point between the second endpoint Z2 and the target coordinate point Y3. At this time, the target coordinate point Y3, the second insertion point X2 and the second endpoint Z2 constitute the three control points that determine the second Bezier curve, and are merged to form the second subset. The first subset and the second subset are the control point sets corresponding to the target unit area.
[0109] In this application, the drawing of the second-order Bezier curve is used as an example for illustration. If the smoothness of the Bezier curve needs to be improved, a high-order Bezier curve can be drawn. The drawing method is similar to the second-order Bezier curve drawing method. The number of control points in the control point set can be increased. The method for determining the control points is the same as that of this application, and no further details are given. In addition, if the number of ranging sensors set in the vehicle is small, the smoothness of the ranging curve can also be increased by drawing a high-order Bezier curve. Provide a visual effect of G1 continuity (also called tangent continuity) to make the ranging curve smoother and easier to understand. By increasing the order of the Bezier curve, G2 continuity (also called curvature continuity) can be achieved, enhancing the smoothness and beauty of the ranging curve. By reasonably setting the endpoints and insertion points, it is equivalent to determining multiple data points used to draw the Bezier curve, and determining the direction of the Bezier curve by connecting multiple data points. The segmented drawing of the accurate Bezier curve is realized in the target unit area, and it is ensured that the fault detection point detected by the ranging bed milk riding can be reflected on the Bezier curve, which increases the accuracy of the Bezier curve, and thus provides users with an accurate visual display of ranging data.
[0110] After the control point set is determined, auxiliary parameters can be selected according to the line segments formed between different control points. In the process of the auxiliary parameters changing from one end of the line segment to the other end, a Bezier curve is generated accordingly. According to the same method, the control point set and auxiliary parameters corresponding to each unit area can be determined, providing a data basis for drawing the ranging curve. The present embodiment provides a method for determining curve parameters based on the second coordinate set, which is equivalent to associating the curve parameters with the obstacle detection points detected by the ranging sensor, and then generating a Bezier curve according to the curve parameters, achieving the purpose of drawing the Bezier curve through the natural change of the coordinates. Compared with the traditional Bezier curve drawing method, the step size setting and the steps of iterative calculation according to the step size loop are saved, which greatly reduces the consumption of computing resources. In addition, in the method of the present embodiment, the data points in the second coordinate set represent the actual coordinate values of the obstacles. The Bezier parameters are drawn according to the second coordinate set to ensure that the generated Bezier curve can reflect the real obstacle detection points, ensure the accuracy of the ranging curve, and provide users with real and reliable visual ranging display data.
[0111] After the control point set is determined through the above embodiment, auxiliary parameters need to be determined to jointly complete the drawing of the Bezier curve. The following describes how to determine the auxiliary parameters according to the control point set through a specific embodiment.
[0112] In some embodiments, the auxiliary parameter includes a first auxiliary parameter and a second auxiliary parameter; and determining the auxiliary parameter according to the control point set includes:
[0113] Determine a first line segment according to the first endpoint and the first insertion point, and select any point on the first line segment as a first target auxiliary parameter point;
[0114] Determine a first arc of the first target auxiliary parameter point in the polar coordinate system;
[0115] Extracting a first decimal part of the first radian, and in response to the first decimal part being greater than a preset threshold, processing the first decimal part according to a first preset processing rule to obtain the first auxiliary parameter; in response to the first decimal part being less than or equal to the preset threshold, processing the first decimal part according to a second preset processing rule to obtain the first auxiliary parameter;
[0116] Determine a second line segment according to the target coordinate point and the second insertion point, and select any point on the second line segment as a second target auxiliary parameter point;
[0117] Determine a second arc of the second target auxiliary parameter point in the polar coordinate system;
[0118] Extract the second decimal part of the second radian, and in response to the second decimal part being greater than a preset threshold, process the second decimal part according to a first preset processing rule to obtain the second auxiliary parameter; in response to the second decimal part being less than or equal to the preset threshold, process the second decimal part according to a second preset processing rule to obtain the second auxiliary parameter.
[0119] Specifically, both the first auxiliary parameter and the second auxiliary parameter are multiple. When determining the first auxiliary parameter, it is necessary to use the control points in the first subset to determine it. Figure 3As shown, a line segment Z1X1 is formed between the first endpoint Z1 and the first insertion point X1, and the first auxiliary parameter starts from the first endpoint Z1 and gradually moves to the first insertion point X1. A point is randomly selected on the first line segment Z1X1 as the first target auxiliary parameter point. The first target auxiliary parameter point has a corresponding polar coordinate value in the polar coordinate system, and the polar coordinate value includes the polar diameter and the polar angle. Determine the polar angle (that is, the first radian) of the first target auxiliary parameter point. At this time, the range of the first radian is not within the [0,1] range defined by the auxiliary parameter. In order to convert the value of the first radian to the [0,1] range, the first radian needs to be processed. The specific method is to use the fract function to extract the decimal part of the first radian (that is, the first decimal part). If the first decimal part is greater than the preset threshold, it is processed according to the first preset processing rule: the first auxiliary parameter = (the first decimal part-0.5) / 0.5. For example, if the first radian value is 2.7, the first decimal part extracted is 0.7, which is greater than the preset threshold value 0.5, and the first auxiliary parameter = (0.7-0.5) / 0.5 = 0.1. The fract function is a built-in function of the GPU.
[0120] If the first decimal part is less than or equal to the preset threshold, the second preset processing rule is used for processing: the first auxiliary parameter = the first decimal part / 0.5. For example, the preset threshold is 0.5. If the first radian value is 2.4, the first decimal part extracted is 0.4, which is less than the preset threshold 0.5, and the first auxiliary parameter = 0.4 / 0.5 = 0.2. Based on the above method, within the first line segment Z1X1, start from the first endpoint Z1 and move toward the first insertion point X1, select multiple first target auxiliary parameter points in turn, and calculate the first auxiliary parameter corresponding to each first target auxiliary parameter point.
[0121] Similarly, when determining the second auxiliary parameter, it is necessary to use the control points in the second subset to determine it. Figure 3As shown, a second line segment Z2X2 is formed between the second endpoint Z2 and the second insertion point X2, and the second auxiliary parameter starts from the target coordinate point Z2 and gradually moves to the second endpoint X2. An arbitrary point is selected in the second line segment Z2X2 as the second target auxiliary parameter point. The second target auxiliary parameter point has a corresponding polar coordinate value in the polar coordinate system, and the polar coordinate value includes the polar diameter and the polar angle. Determine the polar angle (that is, the second radian) of the second target auxiliary parameter point. At this time, the range of the second radian is not within the [0,1] range defined by the auxiliary parameter. In order to convert the value of the first radian to the [0,1] range, the second radian needs to be processed. The specific method is to use the fract function to extract the decimal part of the second radian (that is, the second decimal part). If the second decimal part is greater than the preset threshold, it is processed according to the first preset processing rule: the second auxiliary parameter = (the second decimal part-0.5) / 0.5. Exemplarily, if the first radian value is 2.7, the first decimal part extracted is 0.7, which is greater than the preset threshold value 0.5, and the first auxiliary parameter = (0.7-0.5) / 0.5 = 0.1.
[0122] If the second decimal part is less than or equal to the preset threshold, the second preset processing rule is used for processing: the second auxiliary parameter = the second decimal part / 0.5. For example, the preset threshold is 0.5. If the first radian value is 2.4, the first decimal part extracted is 0.4, which is less than the preset threshold 0.5, and the first auxiliary parameter = 0.4 / 0.5 = 0.2. Based on the above method, within the second line segment Z2X2, starting from the second endpoint Z2 and moving toward the second insertion point X2, multiple second target auxiliary parameter points are selected in turn, and the second auxiliary parameter corresponding to each second target auxiliary parameter point is calculated.
[0123] Through the method of this embodiment, in each unit area, the values of the first target auxiliary parameter point and the second target auxiliary parameter point extracted can be converted to the range of [0,1] through the processing of preset rules to meet the definition range of the auxiliary parameters. This provides a data basis for the subsequent Bezier curve drawing and ensures that the Bezier curve can be drawn.
[0124] After the control point set and the auxiliary parameters are determined respectively by the aforementioned embodiments, the Bezier curve can be drawn in segments, and then the Bezier curves of each segment can be connected to draw the subsequent overall curve. The following describes the Bezier curve drawing method through a specific embodiment.
[0125] In some embodiments, drawing a Bezier curve according to the curve parameters includes:
[0126] Draw a Bezier curve of the target unit area according to the control point set and the auxiliary parameters;
[0127] Connecting the Bezier curves corresponding to all unit areas to generate the Bezier curve for drawing the partition;
[0128] The Bezier curves of all drawn partitions are connected to generate a Bezier curve corresponding to the distance measurement data.
[0129] Specifically, two Bezier curves in the target unit area can be drawn according to the control point set and auxiliary parameters, and the two Bezier curves are connected as the Bezier curve corresponding to the target unit area. After that, the Bezier curves of all unit areas in each drawing partition are connected as the Bezier curve of the drawing partition, and then the Bezier curves of all drawing partitions are connected as the complete Bezier curve corresponding to the distance measurement data. In order to successfully connect the Bezier curves of different drawing partitions, it is necessary to ensure that the partition range is the same in each drawing partition, that is, the distance values corresponding to the closest and farthest points to the vehicle in each drawing partition are the same.
[0130] Furthermore, when drawing two Bezier curves in the target cell area, the method is as follows:
[0131] The curve equation corresponding to the first Bezier curve is:
[0132] bezier1=V1*P11+V2*P12+V3*P13
[0133] Among them, V1, V2 and V3 are the parameters corresponding to the first Bezier curve, which can be determined according to the first auxiliary parameter t1. V1 = (1-t1) 2 、V2=2*t1*(1-t1)、V3=t1 2 , t1 is the first auxiliary parameter. P11 is the starting point of the first Bezier curve, that is, the first endpoint Z1, P12 is the first insertion point X1, and P13 is the end point of the first Bezier curve, that is, the target coordinate point Y3. Figure 4 Schematic diagram of the Bezier curve in the unit area is shown. Bezier1 is a point on the first segment of the Bezier curve. With the change of t1, multiple bezier1s can be determined to generate Figure 4 The complete first Bezier curve Q1 is shown.
[0134] The curve equation corresponding to the first Bezier curve is:
[0135] bezier2=W1*P21+W2*P22+W3*P23
[0136] Among them, W1, W2 and W3 are the parameters corresponding to the second Bezier curve, which can be determined according to the second auxiliary parameter. W1 = (1-t2) 2 、W2=2*t2*(1-t2)、W3=t22 , t2 is the first auxiliary parameter. P21 is the starting point of the second Bezier curve, that is, the target coordinate point Y3, P22 is the second insertion point X2, and P23 is the end point of the second Bezier curve, that is, the second endpoint Z2. bezier2 is a point on the second Bezier curve. With the change of t2, multiple bezier2 can be determined to generate Figure 4 The complete second Bezier curve Q2 is shown.
[0137] It can be seen from the scheme of this embodiment that the complete Bezier curve corresponding to the ranging data is obtained by connecting multiple Bezier curves. On the premise of determining the accuracy of each Bezier curve, the accuracy of the complete Bezier curve is also guaranteed accordingly, thereby improving the drawing accuracy of the ranging curve, and being able to reflect small distance changes or fast-moving objects around the vehicle, making it convenient for users to accurately understand obstacle information in the vehicle's surrounding environment.
[0138] After determining the Bezier curve corresponding to the ranging data, it is also necessary to visualize the Bezier curve to show it to the user for viewing. The visualization prompts the user to pay attention to the safety around the vehicle. The specific visualization method is described in the following embodiment.
[0139] In some embodiments, the method further comprises:
[0140] Determining the display color of each first coordinate point in the first coordinate point set according to a preset display color rule;
[0141] Coloring the Bezier curve according to the display color of each first coordinate point;
[0142] Displays a shaded Bezier curve.
[0143] Specifically, after the first coordinate point is determined, the display color of each first coordinate point can be determined according to the distance between the first coordinate point and the origin. The corresponding relationship between the distance and the display color can be set in advance and stored in a relationship table.
[0144] When determining the display color of the first coordinate point, in response to the distance between the first coordinate point and the origin being within the first preset range, the display color of the first coordinate point is determined to be the first color; in response to the distance between the first coordinate point and the origin being within the second preset range, the display color of the first coordinate point is determined to be the second color; in response to the distance between the first coordinate point and the origin being within the third preset range, the display color of the first coordinate point is determined to be the third color; wherein the value of the second preset range is greater than the value of the first preset range, and the value of the third preset range is greater than the value of the second preset range.
[0145] Exemplarily, when the distance is greater than 0 and less than 40cm (first preset range), the display color is red (first color), when the distance is greater than or equal to 40cm and less than 80cm (second preset range), the display color is yellow (second color), when the distance is greater than or equal to 80cm and less than 150cm (third preset range), the display color is green (third color), and no display is required when the distance exceeds 150cm. After determining the basic color, the transition color between the basic colors can also be determined by interpolation method, for example, determining the transition color between red and yellow, and determining the transition color between yellow and green. Determine the basic color and transition color in advance, and when coloring the Bezier curve, the color of the Bezier curve can be directly determined by querying the relationship table, which saves the computing resources consumed by real-time calculation of the display color, further reduces the computing power consumption of the ranging curve drawing, and reduces the delay of the ranging curve drawing.
[0146] Since the Bezier curve corresponding to the ranging curve is formed by connecting multiple Bezier curves, there are situations where different Bezier curves have different colors. In order to display aesthetics, color gradient can be achieved between different Bezier curves, which can be achieved specifically through the mix function. The specific method of color gradient can be determined according to actual needs, and this embodiment does not make specific restrictions. In addition, the ranging curve corresponding to the area where there is no ranging data is vacant. Figure 5 A schematic diagram of the ranging curve is shown. Figure 5 As shown, the ranging curve can also be discontinuous, and the ranging curve is drawn according to the data actually detected by the ranging sensor. When the colored Bezier curve is displayed on the vehicle-side screen, the display ratio of the Bezier curve needs to be scaled accordingly according to the size of the display screen to ensure the comprehensiveness and aesthetics of the display.
[0147] It should be noted that a shader can be used to draw a Bezier curve. The shader includes a vertex shader and a fragment shader. The coordinate values are calculated in the vertex shader, and the points on the Bezier curve, the gradient color, and the Bezier curve are calculated based on the coordinate values in the fragment shader. Drawing a Bezier curve by a shader belongs to the conventional technology in this field and is not described in detail in this embodiment.
[0148] Through the method of this embodiment, the drawn ranging curve can be displayed in real time on the vehicle-side screen, and the user can intuitively view the obstacle information in the vehicle's surrounding environment. The color display of different ranging curves can intuitively indicate the distance of obstacles around the vehicle, provide a reference for vehicle driving, and improve driving safety.
[0149] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0150] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0151] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a distance measurement curve drawing device.
[0152] refer to Figure 6 , the distance measurement curve drawing device comprises:
[0153] The acquisition module 502 is configured to acquire the ranging data collected by the vehicle ranging sensor;
[0154] The processing module 504 is configured to perform data processing on the distance measurement data to obtain a first coordinate point set of obstacles around the vehicle in a pre-constructed rectangular coordinate system;
[0155] A conversion module 506 is configured to convert each first coordinate point in the first coordinate point set from the rectangular coordinate system to a polar coordinate system to obtain a second coordinate point set;
[0156] A determination module 508 is configured to determine curve parameters for drawing a Bezier curve according to the second coordinate point set;
[0157] The drawing module 510 is configured to draw a Bezier curve corresponding to the distance measurement data according to the curve parameters.
[0158] In some embodiments, the conversion module 506 is further configured to convert the rectangular coordinate system pre-constructed in each drawing partition into a polar coordinate system with a first preset range of arc range through coordinate transformation; wherein the drawing partition is obtained by pre-dividing the area around the vehicle;
[0159] Counting the total number of ranging sensors in the drawing partition, determining a second preset range according to the first preset range and the total number, and transforming the arc range of the polar coordinate system into the second preset range;
[0160] Mapping each first coordinate point in the first coordinate point set from the rectangular coordinate system to a polar coordinate system whose arc range is the second preset range to obtain the second coordinate point set,
[0161] In some embodiments, the conversion module 506 is further configured to use the product of the first preset range and the total number as a third preset range;
[0162] The third preset range is divided by the value of π to obtain the second preset range.
[0163] In some embodiments, the determination module 508 is further configured to select any unit area in the drawing partition as a target unit area, and select a second coordinate point corresponding to the target unit area from the second coordinate set as a target coordinate point; wherein the unit area is obtained by dividing the drawing partition according to the total number of ranging sensors in the drawing partition, and the drawing partition is obtained by dividing the area around the vehicle in advance;
[0164] Selecting a second coordinate point corresponding to a unit area adjacent to one side of the target unit area from the second coordinate set as a first auxiliary coordinate point, and selecting a second coordinate point corresponding to a unit area adjacent to the other side of the target unit area from the second coordinate set as a second auxiliary coordinate point;
[0165] Determine the control point set according to the target coordinate point, the first auxiliary coordinate point and the second auxiliary coordinate point;
[0166] The auxiliary parameter is determined according to the control point set.
[0167] In some embodiments, the drawing module 510 is further configured to draw a Bezier curve of the target unit area according to the control point set and the auxiliary parameters;
[0168] Connecting the Bezier curves corresponding to all unit areas to generate the Bezier curve for drawing the partition;
[0169] The Bezier curves of all drawn partitions are connected to generate a Bezier curve corresponding to the distance measurement data.
[0170] In some embodiments, the determination module 508 is further configured to determine a first endpoint according to the target coordinate point and the first auxiliary coordinate point, determine a first insertion point according to the first endpoint and the target coordinate point, and combine the first endpoint, the first insertion point and the target coordinate point as a first subset;
[0171] determining a second endpoint according to the target coordinate point and the second auxiliary coordinate point, determining a second insertion point according to the second endpoint and the target coordinate point, and combining the target coordinate point, the second insertion point and the second endpoint as a second subset;
[0172] The first subset and the second subset are combined as the control point set.
[0173] In some embodiments, the determining module 508 is further configured such that the auxiliary parameter includes a first auxiliary parameter and a second auxiliary parameter; a first line segment is determined according to the first endpoint and the first insertion point, and a point on the first line segment is selected as a first target auxiliary parameter point;
[0174] Determine a first arc of the first target auxiliary parameter point in the polar coordinate system;
[0175] Extracting a first decimal part of the first radian, and in response to the first decimal part being greater than a preset threshold, processing the first decimal part according to a first preset processing rule to obtain the first auxiliary parameter; in response to the first decimal part being less than or equal to the preset threshold, processing the first decimal part according to a second preset processing rule to obtain the first auxiliary parameter;
[0176] Determine a second line segment according to the target coordinate point and the second insertion point, and select any point on the second line segment as a second target auxiliary parameter point;
[0177] Determine a second arc of the second target auxiliary parameter point in the polar coordinate system;
[0178] Extract the second decimal part of the second radian, and in response to the second decimal part being greater than a preset threshold, process the second decimal part according to a first preset processing rule to obtain the second auxiliary parameter; in response to the second decimal part being less than or equal to the preset threshold, process the second decimal part according to a second preset processing rule to obtain the second auxiliary parameter.
[0179] In some embodiments, a coloring module is further included, configured to determine the display color of each first coordinate point in the first coordinate point set according to a preset display color rule;
[0180] Coloring the Bezier curve according to the display color of each first coordinate point;
[0181] Displays a shaded Bezier curve.
[0182] In some embodiments, the coloring module is further configured to determine the display color of each first coordinate point according to the distance between the first coordinate point and the origin of the rectangular coordinate system.
[0183] In some embodiments, the coloring module is further configured to determine that the display color of the first coordinate point is the first color in response to the distance between the first coordinate point and the origin being within a first preset range;
[0184] In response to the distance between the first coordinate point and the origin being within a second preset range, determining that the display color of the first coordinate point is a second color;
[0185] In response to the distance between the first coordinate point and the origin being within a third preset range, determining that the display color of the first coordinate point is a third color;
[0186] The value of the second preset range is greater than the value of the first preset range, and the value of the third preset range is greater than the value of the second preset range.
[0187] In some embodiments, the origin of the rectangular coordinate system is determined according to the positions of all ranging sensors within the drawing partition.
[0188] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0189] The device of the above embodiment is used to implement the corresponding distance measurement curve drawing method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0190] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the distance measurement curve drawing method described in any of the above embodiments is implemented.
[0191] Figure 7 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0192] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0193] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0194] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0195] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0196] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0197] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0198] The electronic device of the above embodiment is used to implement the corresponding distance measurement curve drawing method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0199] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the ranging curve drawing method described in any of the above embodiments.
[0200] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0201] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the distance measurement curve drawing method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0202] Based on the same concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a computer program product, including computer program instructions. When the computer program instructions are run on a computer, the computer executes the method described in any of the above embodiments, which has the beneficial effects of the corresponding method embodiments and will not be repeated here.
[0203] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0204] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0205] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0206] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.
Claims
1. A distance measurement curve drawing method, characterized in that: include: Obtaining ranging data collected by the vehicle ranging sensor; Processing the distance measurement data to obtain a first coordinate point set of obstacles around the vehicle in a pre-constructed rectangular coordinate system; Convert each first coordinate point in the first coordinate point set from the rectangular coordinate system to a polar coordinate system to obtain a second coordinate point set; Determining curve parameters for drawing a Bezier curve according to the second coordinate point set; A Bezier curve corresponding to the distance measurement data is drawn according to the curve parameters.
2. The method according to claim 1, characterized in that Converting each first coordinate point in the first coordinate point set from the rectangular coordinate system to a polar coordinate system to obtain a second coordinate point set, comprising: For a rectangular coordinate system pre-constructed in each drawing partition, the rectangular coordinate system is converted into a polar coordinate system with a radian range of a first preset range through coordinate transformation; wherein the drawing partition is obtained by pre-dividing the area around the vehicle; Counting the total number of ranging sensors in the drawing partition, determining a second preset range according to the first preset range and the total number, and transforming the arc range of the polar coordinate system into the second preset range; Each first coordinate point in the first coordinate point set is mapped from the rectangular coordinate system to a polar coordinate system whose arc range is the second preset range to obtain the second coordinate point set.
3. The method according to claim 2, characterized in that Determining a second preset range according to the first preset range and the total number includes: taking the product of the first preset range and the total number as a third preset range; The third preset range is divided by the value of π to obtain the second preset range.
4. The method according to claim 1, characterized in that: The curve parameters include a control point set and auxiliary parameters; the determining of the curve parameters for drawing a Bezier curve according to the second coordinate point set includes: Selecting any unit area in the drawing partition as a target unit area, and selecting a second coordinate point corresponding to the target unit area from the second coordinate set as a target coordinate point; wherein the unit area is obtained by dividing the drawing partition according to the total number of ranging sensors in the drawing partition, and the drawing partition is obtained by dividing the area around the vehicle in advance; Selecting a second coordinate point corresponding to a unit area adjacent to one side of the target unit area from the second coordinate set as a first auxiliary coordinate point, and selecting a second coordinate point corresponding to a unit area adjacent to the other side of the target unit area from the second coordinate set as a second auxiliary coordinate point; Determine the control point set according to the target coordinate point, the first auxiliary coordinate point and the second auxiliary coordinate point; The auxiliary parameter is determined according to the control point set.
5. The method according to claim 4, characterized in that Drawing a Bezier curve according to the curve parameters includes: Draw a Bezier curve of the target unit area according to the control point set and the auxiliary parameters; Connecting the Bezier curves corresponding to all unit areas to generate the Bezier curve for drawing the partition; The Bezier curves of all drawn partitions are connected to generate a Bezier curve corresponding to the distance measurement data.
6. The method according to claim 4, characterized in that The step of determining the control point set according to the target coordinate point, the first auxiliary coordinate point, and the second auxiliary coordinate point includes: Determine a first endpoint according to the target coordinate point and the first auxiliary coordinate point, determine a first insertion point according to the first endpoint and the target coordinate point, and combine the first endpoint, the first insertion point and the target coordinate point as a first subset; determining a second endpoint according to the target coordinate point and the second auxiliary coordinate point, determining a second insertion point according to the second endpoint and the target coordinate point, and combining the target coordinate point, the second insertion point and the second endpoint as a second subset; The first subset and the second subset are combined as the control point set.
7. The method according to claim 6, characterized in that The auxiliary parameters include a first auxiliary parameter and a second auxiliary parameter; and determining the auxiliary parameters according to the control point set includes: Determine a first line segment according to the first endpoint and the first insertion point, and select any point on the first line segment as a first target auxiliary parameter point; Determine a first arc of the first target auxiliary parameter point in the polar coordinate system; Extracting a first decimal part of the first radian, and in response to the first decimal part being greater than a preset threshold, processing the first decimal part according to a first preset processing rule to obtain the first auxiliary parameter; in response to the first decimal part being less than or equal to the preset threshold, processing the first decimal part according to a second preset processing rule to obtain the first auxiliary parameter; Determine a second line segment according to the target coordinate point and the second insertion point, and select any point on the second line segment as a second target auxiliary parameter point; Determine a second arc of the second target auxiliary parameter point in the polar coordinate system; Extract the second decimal part of the second radian, and in response to the second decimal part being greater than a preset threshold, process the second decimal part according to a first preset processing rule to obtain the second auxiliary parameter; in response to the second decimal part being less than or equal to the preset threshold, process the second decimal part according to a second preset processing rule to obtain the second auxiliary parameter.
8. The method according to claim 1, characterized in that The method further comprises: Determining the display color of each first coordinate point in the first coordinate point set according to a preset display color rule; Coloring the Bezier curve according to the display color of each first coordinate point; Displays a shaded Bezier curve.
9. The method according to claim 2, characterized in that: The origin of the rectangular coordinate system is determined according to the positions of all ranging sensors within the drawing partition.
10. A vehicle, characterized in that: The vehicle comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory so that the vehicle executes the method according to any one of claims 1 to 9.
Citation Information
Cited By
Ranging curve drawing method and vehicle
WO2026114391A1