A method, system, computer device, and storage medium for generating reversing trajectory lines.
By obtaining the pixel coordinates of static and dynamic trajectory lines in the reversing image through real vehicle calibration, and generating dynamic trajectory lines using linear interpolation, the problems of large data volume and high computational cost in existing technologies are solved, and the continuous change and consistent display of reversing trajectory lines are realized.
Patent Information
- Application Number
- CN202611522073.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-11-10
AI Technical Summary
In existing technologies, the preparation and adaptation of reversing trajectory data need to be adjusted according to changes in vehicle model and camera installation status, resulting in large data volume, high computational overhead, and difficulty in achieving continuous changes in steering wheel steering state.
The pixel coordinates of the static trajectory line and the maximum dynamic trajectory line are obtained by actual vehicle calibration. The dynamic trajectory line is generated by linear interpolation, avoiding physical parameter conversion, and is directly superimposed and displayed in the reversing image.
It achieves consistency between the reversing trajectory line and the reversing image without increasing data preparation and adaptation costs, and continuously changes with the steering wheel turning state, adapting to changes in vehicle model and camera installation status.
Smart Images

Figure CN123061271A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle technology, and in particular to a method, system, computer device, and storage medium for generating reversing trajectory lines. Background Technology
[0002] With the widespread adoption of reversing cameras in vehicles, overlaying reversing trajectory lines onto the camera image has become a common method to assist drivers in judging the vehicle's reversing path. The position of the reversing trajectory lines in the image needs to be consistent with the actual position of objects in the scene to serve as a reference for the driver in judging the relative position of the vehicle and obstacles behind it; furthermore, the vehicle's path changes with the steering wheel's rotation, so the reversing trajectory lines also need to continuously change with the steering wheel's turning direction.
[0003] In related technologies, to draw a reversing trajectory line on the reversing camera screen that can rotate with the steering wheel, it is necessary to prepare data on the reversing trajectory line based on the vehicle, the camera, and the relative positions between them. For example, a physical model can be established based on vehicle body parameters, camera parameters, and their installation posture, and the position of the trajectory line in the screen can be obtained through projection calculation; alternatively, points on the actual trajectory behind the vehicle can be collected in advance, and these points can be saved according to the steering wheel's turning state. When reversing, the corresponding data can be retrieved according to the current steering state to draw the trajectory line on the screen. However, since the reversing trajectory line data needs to be prepared separately for each steering wheel turning state and re-adapted as the vehicle model or camera installation state changes, achieving the aforementioned effect requires a significant increase in the cost of trajectory data preparation and adaptation.
[0004] Therefore, improvements to existing technologies are necessary. Summary of the Invention
[0005] This invention provides a method, system, computer device, and storage medium for generating reversing trajectory lines to solve the problems existing in the prior art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: A method for generating reversing trajectory lines includes: Obtain the reversing image corresponding to the vehicle; Based on the actual vehicle calibration, the pixel coordinates of multiple first calibration points corresponding to the static trajectory line and the pixel coordinates of multiple second calibration points corresponding to the maximum dynamic trajectory line are obtained; wherein, the pixel coordinates are coordinates in the image coordinate system of the reversing image, and the multiple first calibration points and the multiple second calibration points correspond one-to-one based on the trajectory position order; Obtain the current steering wheel angle and the maximum steering wheel angle corresponding to the vehicle. Based on the angle ratio between the current steering wheel angle and the maximum steering wheel angle, perform linear interpolation on the pixel coordinates of each first calibration point and the corresponding second calibration point to obtain multiple trajectory control points corresponding to the current steering wheel angle. A continuous dynamic trajectory line is generated based on the multiple trajectory control points, and the dynamic trajectory line is superimposed and displayed in the reversing image.
[0007] In one possible implementation, the method for generating the reversing trajectory line further includes: The plurality of first calibration points are connected sequentially according to their trajectory positions to generate the static trajectory line; The static trajectory lines are superimposed on the reversing image; Among them, the line segment between two adjacent first calibration points constitutes a static trajectory line segment, and each static trajectory line segment is configured with a corresponding display style according to the distance area it is in.
[0008] In one possible implementation, the number of the plurality of first calibration points is N, where N is an integer greater than 1; The static trajectory line includes N-1 static trajectory line segments arranged sequentially. The N-1 static trajectory line segments correspond to distance regions arranged sequentially from near to far, wherein the distance region corresponding to the last static trajectory line segment is the extended distance region. When the length of the last static trajectory line segment is not zero, the number of segments displayed for the static trajectory line is N-1; when the length of the last static trajectory line segment is zero, the number of segments displayed for the static trajectory line is N-2.
[0009] In one possible implementation, the method for generating the reversing trajectory line further includes: A lateral distance reference line is generated by extending the static trajectory line along the vehicle width direction to the opposite side. The extension endpoint of the lateral distance reference line is determined by the trajectory configuration data corresponding to the vehicle.
[0010] In one possible implementation, the angle ratio is determined based on the direction and amount of deflection of the current steering wheel angle relative to the center position of the steering wheel; For any of the trajectory control points, its x-coordinate and y-coordinate are proportionally interpolated according to the difference between the x-coordinate and y-coordinate of the corresponding first calibration point and second calibration point.
[0011] In one possible implementation, generating a continuous dynamic trajectory line based on the plurality of trajectory control points includes: The plurality of trajectory control points are used as control points for the Bézier curve, and the Bézier curve is generated based on the plurality of trajectory control points. The Bézier curve is sampled at multiple points to obtain multiple continuously distributed trajectory sampling points; The dynamic trajectory line is rendered based on the multiple trajectory sampling points.
[0012] In one possible implementation, rendering the dynamic trajectory line based on the plurality of trajectory sampling points includes: drawing the trajectory line composed of the plurality of trajectory sampling points by superimposing K layers with mutual offset, wherein the transparency of each layer decreases sequentially along the offset layer level, and K is an integer greater than 1.
[0013] On the other hand, the present invention provides a reversing trajectory line generation system, comprising: The configuration module is used to provide trajectory configuration data corresponding to the vehicle. The trajectory configuration data includes the maximum steering wheel angle corresponding to the vehicle, the pixel coordinates of multiple first calibration points corresponding to the static trajectory line obtained through real vehicle calibration, and the pixel coordinates of multiple second calibration points corresponding to the maximum dynamic trajectory line. The multiple first calibration points and the multiple second calibration points correspond one-to-one according to the same trajectory position order. Different vehicles correspond to different trajectory configuration data. The trajectory generation module is used to obtain the current steering wheel angle, and according to the angle ratio between the current steering wheel angle and the maximum steering wheel angle, to perform linear interpolation on the pixel coordinates of each first calibration point and the corresponding second calibration point to obtain multiple trajectory control points corresponding to the current steering wheel angle, and to generate a continuous dynamic trajectory line based on the multiple trajectory control points. A rendering module is used to overlay and display the dynamic trajectory lines on the reversing image of the vehicle.
[0014] On the other hand, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the computer device performs the reversing trajectory line generation method as described in any of the preceding claims.
[0015] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when run on a processor, causes the processor to perform the reversing trajectory line generation method as described in any of the preceding claims.
[0016] Compared with the prior art, the present invention has the following beneficial effects: This invention provides a method, system, computer device, and storage medium for generating reversing trajectory lines. The position of the reversing trajectory line is determined by the static trajectory line calibration coordinates and the maximum dynamic trajectory line calibration coordinates obtained through real vehicle calibration in the image coordinate system of the vehicle's reversing image. It does not require parameter conversion based on the vehicle and camera, nor does it require re-adaptation due to changes in vehicle model or camera installation status. Furthermore, it generates a dynamic reversing trajectory line that continuously changes with the steering wheel angle and matches the reversing image screen based solely on two sets of real vehicle calibration coordinates. Without increasing the cost of trajectory data preparation and adaptation, the reversing trajectory line not only matches the position of actual objects in the reversing image screen but also continuously changes with the steering wheel's turning state.
[0017] The present invention has other features and advantages that will be apparent from or will be set forth in detail in the accompanying drawings and following detailed description, which together serve to explain the particular principles of the invention. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of a method for generating a reversing trajectory line according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the calibration interface for a method for generating reversing trajectory lines provided in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the display effect of a reversing trajectory line generation method provided in an embodiment of the present invention; Figure 4 This is a structural block diagram of a reversing trajectory line generation system provided in an embodiment of the present invention.
[0020] Attached reference numerals: 10, configuration module; 20, trajectory generation module; 30, rendering module. Detailed Implementation
[0021] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this invention in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this invention and are therefore intended only as examples, not as limiting the scope of protection of this invention.
[0022] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The term "embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment, nor does it specifically limit its independence or connection with other embodiments. In principle, in this invention, as long as there is no technical contradiction or conflict, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.
[0023] Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains; the use of related terms herein is merely for the purpose of describing particular embodiments and is not intended to limit the invention.
[0024] In the description of this invention, the term "and / or" is used to describe the logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and A and B exist simultaneously. Additionally, the character " / " generally indicates that the preceding and following objects have an "or" logical relationship.
[0025] In this invention, terms such as “first” and “second” are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any actual quantity, hierarchy, or order between these entities or operations.
[0026] Without further limitations, the use of terms such as “comprising,” “including,” “having,” or other similar expressions in this invention is intended to cover non-exclusive inclusion, which does not exclude the presence of additional elements in a process, method, or product that includes the stated elements, such that a process, method, or product that includes a list of elements may include not only those defined elements but also other elements not expressly listed, or elements inherent to such a process, method, or product.
[0027] Similar to the understanding in the Examination Guidelines, in this invention, expressions such as "greater than," "less than," and "exceeding" are understood to exclude the stated number; expressions such as "above," "below," and "within" are understood to include the stated number. Furthermore, in the description of the embodiments of this invention, "multiple" means two or more (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups" and "multiple times," unless otherwise explicitly specified.
[0028] In the description of the embodiments of the present invention, the spatial related expressions used, such as "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "vertical," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the specific embodiments or drawings. They are only for the purpose of describing the specific embodiments of the present invention or for the reader's understanding, and do not indicate or imply that the device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of the present invention.
[0029] Unless otherwise explicitly stated or limited, the terms "installation," "connection," "linking," "fixing," and "setting," as used in the description of the embodiments of this invention, should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral arrangement; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this invention according to the specific circumstances.
[0030] In existing technologies, reversing trajectory lines are typically obtained by projecting a physical model based on the vehicle's body parameters, camera parameters, distortion parameters, and camera mounting posture, or by using trajectory data collected and saved in advance according to each steering wheel turning state. The former involves many parameters, has a long adaptation period, and high computational cost, while the latter requires covering all steering wheel turning states during the data preparation stage, resulting in a large amount of data and difficulty in continuously changing between the collected turning states.
[0031] Therefore, the present invention aims to provide a method for generating a reversing trajectory line, so as to obtain a reversing trajectory line that can continuously change with the steering wheel angle and match the reversing image, while reducing the amount of data preparation and avoiding physical parameter conversion.
[0032] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0033] Please refer to Figure 1This invention provides a method for generating reversing trajectory lines, applicable to electronic devices with reversing image display capabilities, such as in-vehicle infotainment systems, reversing image controllers, or vehicle domain controllers. This electronic device can acquire reversing images captured by a vehicle's reversing camera and overlay reversing trajectory lines onto the images. In some embodiments, the electronic device pre-stores trajectory configuration data corresponding to the vehicle. This trajectory configuration data includes the pixel coordinates of multiple first calibration points corresponding to a static trajectory line obtained through real-vehicle calibration, the pixel coordinates of multiple second calibration points corresponding to the maximum dynamic trajectory line, and parameters such as the maximum steering wheel angle corresponding to the vehicle.
[0034] It should be noted that the static trajectory line refers to the vehicle's expected path when the steering wheel is in a reference position, which could be the steering wheel in the center position and the vehicle reversing in a straight line. The maximum dynamic trajectory line refers to the vehicle's expected path when the steering wheel is turned to its maximum angle. The pixel coordinates of both sets of calibration points are obtained in the image coordinate system of the image captured by the vehicle's reversing camera, and therefore can be directly used to draw trajectory lines on the reversing image without requiring any conversion of intrinsic parameters, extrinsic parameters, distortion, or projection relationships before drawing.
[0035] Please refer to Figure 1 Specifically, this method for generating reversing trajectory lines includes the following steps: S1. Obtain the reversing image corresponding to the vehicle.
[0036] After the vehicle is put into reverse gear, the electronic equipment acquires the reversing image captured by the reversing camera and displays it on the in-vehicle display screen. The reversing image can be a dynamic trajectory line overlaid on the displayed image.
[0037] It is understood that the first calibration point corresponding to the static trajectory line and the second calibration point corresponding to the maximum dynamic trajectory line are both obtained from the calibration screen of the same reversing camera as the reversing image. The calibration screen and the reversing image are consistent in imaging relationship, camera mounting posture, and field of view. Therefore, the pixel coordinates read from the calibration screen still fall in the correct position in the reversing image, without the need for further conversion of their positional relationship. Based on this, the embodiments of the present invention can establish a direct coordinate correspondence between the reversing image and the calibration coordinates, achieving a WYSIWYG (What You See Is What You Get) effect.
[0038] S2. Based on the actual vehicle calibration, obtain the pixel coordinates of multiple first calibration points corresponding to the static trajectory line and the pixel coordinates of multiple second calibration points corresponding to the maximum dynamic trajectory line.
[0039] The pixel coordinates are the coordinates in the image coordinate system of the reversing image, and the plurality of first calibration points and the plurality of second calibration points correspond one-to-one based on the trajectory position order.
[0040] In some embodiments, the vehicle calibration process is as follows: the vehicle is parked in a space with parking space markings or distance references, and a reversing camera captures a calibration image; in the calibration image, points are taken at the locations that the static trajectory line should pass through and the locations that the maximum dynamic trajectory line should pass through, respectively, to obtain the pixel coordinates of each calibration point in the calibration image. The point taking method can be to mark key points on the calibration image and directly read their pixel coordinates, or to drag the marked points to the locations that the trajectory line should pass through in the calibration image and then read their pixel coordinates.
[0041] Since the pixel coordinates obtained are directly taken from the image corresponding to the vehicle's reversing camera, the calibrated coordinates already comprehensively include the effects of vehicle body parameters, camera parameters, distortion, and installation posture. Therefore, when generating the trajectory line, it is not necessary to measure, adapt, or convert any of these parameters again. Thus, even if there is a deviation in the camera's installation posture, this deviation is already reflected in the calibrated coordinates and will not be reflected separately as a deviation in the trajectory line's position. When the vehicle model changes or the camera's installation status changes, only recalibration and coordinate updates are needed; the entire set of physical parameters does not need to be recalculated.
[0042] In some embodiments, multiple first calibration points are distributed sequentially along the trajectory direction behind the vehicle, with a quantity of N, where N is an integer greater than 1; the number of multiple second calibration points is the same as the number of first calibration points, and they are distributed sequentially according to the same trajectory position order. For example, the first calibration points and the second calibration points correspond one-to-one based on the trajectory position order, that is, the i-th first calibration point and the i-th second calibration point correspond to the same position on the trajectory behind the vehicle, where i takes values from 1 to N.
[0043] In some embodiments, the number N of the first calibration points is 5, that is, the first calibration points include 5 calibration points distributed in sequence, and the second calibration points also include 5 calibration points distributed in sequence, and the two correspond one-to-one according to the trajectory position order.
[0044] The number of calibration points is determined by the number of distance regions that need to be divided along the trajectory line behind the vehicle. Since two adjacent calibration points can be connected to form a line segment, the number of calibration points required to divide the trajectory line behind the vehicle into multiple consecutively connected distance regions is the number of regions plus one: dividing four consecutively connected distance regions requires five line segments connected pairwise to each adjacent calibration point, therefore five calibration points are used. These four distance regions divided along the trajectory line are sufficient to cover the reference requirements for obstacles within various distance ranges behind the vehicle when reversing, while also minimizing the amount of calibration data required to describe a trajectory line, facilitating calibration and storage. It is understood that the more calibration points there are, the finer the divided distance regions become, and the greater the amount of calibration data required; the specific value of N is not limited in this embodiment of the invention.
[0045] In some embodiments, calibration points are located on the left and right sides of the rear of the vehicle. Specifically, the left trajectory line corresponds to one set of first calibration points and one set of second calibration points, while the right trajectory line corresponds to another set of first calibration points and another set of second calibration points. The number and correspondence of the calibration points on the left and right sides are independent of each other. It should be noted that this embodiment of the invention is not limited to simultaneously setting trajectory lines on both the left and right sides; generating a trajectory line only on one side is also valid.
[0046] Please refer to Figure 2 In some embodiments, the calibration interface shows the rear of the vehicle and multiple calibration points arranged sequentially on the left and right sides behind the vehicle. Each calibration point is given in the form of a marker point, and the calibration personnel move it to the position that the trajectory line should pass through and then read its pixel coordinates. Figure 2 The diagram also shows the distance zones divided by adjacent calibration points and the corresponding reference levels for each zone, arranged from nearest to farthest: Danger, Warning, Safe, and Hideable. Each reference level is distinguished by a different display style. It can be seen that the calibration points on the left and right sides behind the vehicle each form a trajectory line. By taking points on both sides according to the positions corresponding to each distance zone, the calibration personnel can obtain the calibration coordinates of the two trajectory lines.
[0047] Step S3: Obtain the current steering wheel angle and the maximum steering wheel angle corresponding to the vehicle. Based on the angle ratio between the two, perform linear interpolation on the pixel coordinates of each first calibration point and the corresponding second calibration point to obtain multiple trajectory control points corresponding to the current steering wheel angle.
[0048] Understandably, the current steering wheel angle can be provided by the vehicle's steering wheel angle sensor; the maximum steering wheel angle is the limit angle that the steering wheel can turn to, which can be pre-stored in the trajectory configuration data or obtained from the vehicle network when the vehicle is powered on.
[0049] In practical applications, the angle ratio is used to characterize the relationship between the current steering wheel angle and the maximum steering wheel angle.
[0050] In some embodiments, the angle ratio is determined based on the direction and amount of deflection of the current steering wheel angle relative to the center position of the steering wheel. For example, the deflection direction is used to determine which side of the calibration point to use, and the deflection amount is used to determine the interpolation ratio.
[0051] In some embodiments, there is a set of second calibration points on the left and right sides of the rear of the vehicle. Taking the current steering wheel angle turning to the left relative to the center position as an example, the first calibration point on the left and the second calibration point on the left are used for interpolation.
[0052] Specifically, the larger the deflection, the larger the interpolation ratio. Correspondingly, for the i-th trajectory control point, its x-coordinate and y-coordinate are as follows: X(i)=Xd(i)+r×[Xs(i)-Xd(i)]; Y(i)=Yd(i)+r×[Ys(i)-Yd(i)]; Where r is the interpolation ratio, Xs(i) and Ys(i) are the x and y coordinates of the i-th first calibration point, Xd(i) and Yd(i) are the x and y coordinates of the i-th second calibration point, and X(i) and Y(i) are the x and y coordinates of the i-th trajectory control point. The same method is used to calculate the values for each first calibration point and its corresponding second calibration point, thus obtaining multiple trajectory control points corresponding to the current steering wheel angle.
[0053] Taking N=5 and the interpolation ratio r=0.5 as an example, the current steering wheel angle is half of the maximum steering wheel angle. Let the pixel coordinates of the 5 first calibration points be (100, 100), (100, 110), (100, 120), (100, 130), and (100, 200) respectively, and the pixel coordinates of the 5 second calibration points be (100, 100), (90, 110), (80, 120), (70, 130), and (60, 180) respectively. Then, taking the 5th trajectory control point as an example, its horizontal coordinate is 60+0.5×(100-60)=80, and its vertical coordinate is 180+0.5×(200-180)=190, that is, the pixel coordinates of the 5th trajectory control point are (80, 190). The remaining calibration points were calculated one by one in the same way, resulting in the following pixel coordinates for the five trajectory control points: (100, 100), (95, 110), (90, 120), (85, 130), and (80, 190). The angle ratios and pixel coordinate values mentioned above are for illustrative purposes only and do not constitute a limitation on the specific values and units of the steering wheel angle or the specific values of the calibration coordinates.
[0054] As can be seen, the trajectory control points fall between the corresponding first and second calibration points, and both their x and y coordinates change with the interpolation ratio. The interpolation ratio is determined by the angular ratio between the current steering wheel angle and the maximum steering wheel angle. Therefore, the trajectory control points move continuously as the steering wheel angle changes. Thus, the coordinates of only two sets of calibration points can cover the entire steering wheel angle range, eliminating the need to prepare data separately for each steering wheel state. The amount of data is independent of the precision required for steering wheel angle adjustments.
[0055] It is understandable that the above calculations can also be equivalently expressed with the first calibration point as X(i)=Xs(i)+(1-r)×[Xd(i)-Xs(i)] and Y(i)=Ys(i)+(1-r)×[Yd(i)-Ys(i)], where (1-r) is the complement of the interpolation ratio r. The two notations differ only in the selection of the starting point, but the resulting trajectory control points are the same.
[0056] In some embodiments, the abscissa and ordinate of the trajectory control point are interpolated proportionally according to the differences in abscissa and ordinate between the corresponding first and second calibration points. That is, the interpolation in the abscissa and ordinate directions are independent and calculated using the formula described above. Compared to scaling the coordinates proportionally based on the distance between calibration points, interpolating the abscissa and ordinate separately avoids shape distortion of the trajectory line during turning, ensuring that the shape change of the trajectory line matches the actual reversing path of the vehicle.
[0057] In other embodiments, the interpolation ratio has a sign corresponding to the deflection direction, used to determine whether the left or right calibration point is used and to determine the magnitude of the interpolation ratio. For example, the deflection of the current steering wheel angle relative to the center position of the steering wheel is normalized to the range of -1 to +1, where -1 corresponds to turning to the limit in one direction, +1 corresponds to turning to the limit in another direction, and zero corresponds to the steering wheel being in the center position; the sign of the normalized value is used to determine whether the left or right second calibration point is used, and the absolute value of the normalized value is used to determine the magnitude of the interpolation ratio. In this manner, the trajectory control point also falls between the corresponding first and second calibration points and moves continuously as the steering wheel angle changes, thus covering the entire steering wheel angle range.
[0058] The above method is a specific implementation of the interpolation method provided in the embodiments of the present invention. The embodiments of the present invention do not limit the specific method for determining the interpolation ratio.
[0059] S4. Generate continuous dynamic trajectory lines based on multiple trajectory control points, and overlay the dynamic trajectory lines onto the reversing image.
[0060] In some embodiments, multiple trajectory control points are used as control points for a Bézier curve, and a Bézier curve is generated based on the multiple trajectory control points; the Bézier curve is sampled at multiple points to obtain multiple continuously distributed trajectory sampling points; then the dynamic trajectory line is rendered based on the multiple trajectory sampling points, and the rendered dynamic trajectory line is superimposed and displayed in the reversing image.
[0061] It's understandable that N trajectory control points correspond to an N-1 degree Bézier curve. Taking N=5 as an example, 5 trajectory control points correspond to a fourth degree Bézier curve, the expression of which is: B(t) = (1-t) 4 P0+4(1-t)³tP1+6(1-t)²t²P2+4(1-t)t³P3+t 4 P4; Among them, P0 to P4 are 5 trajectory control points, and t is a parameter that takes a value of 0 to 1.
[0062] In some embodiments, the fourth-order Bézier curve is discretized and sampled. The number of samples is a customizable preset value, such as 500 or 1000 points, resulting in a continuous distribution of multiple trajectory sampling points. These trajectory sampling points constitute a continuous dynamic trajectory line. It is understood that the more samples there are, the smoother the trajectory line appears on the screen, but the required computation also increases accordingly. Therefore, the number of samples can be set according to the vehicle's computing power and display requirements.
[0063] Because the trajectory control points change continuously with the steering wheel angle, the Bézier curve generated by the trajectory control points also changes continuously with the steering wheel angle. When the steering wheel is turned, the trajectory line moves smoothly in the picture without any jumps or angles.
[0064] It should be noted that in this embodiment of the invention, the trajectory control points are themselves curve control points used to generate the trajectory line. The generated curve is not required to pass through these control points. Therefore, it is not necessary to derive curve parameters from the trajectory control points, nor is it necessary to save complete sampling point data for different steering wheel angles. In contrast, if the collected or calibrated points are taken as points that the curve must pass through, then it is necessary to derive curve parameters from these points and calculate complete sampling point sets for each steering wheel angle, which increases both the computational load and the amount of data that needs to be saved.
[0065] In some embodiments, besides Bézier curves, other methods that can determine the curve shape by control points can also be used to generate dynamic trajectory lines, such as spline curves; alternatively, the trajectory control points can be directly interpolated and then connected. All of the above methods can obtain continuous dynamic trajectory lines based on trajectory control points, and this embodiment of the invention does not limit this approach.
[0066] Based on the aforementioned embodiments, this embodiment also provides a method for generating and displaying static trajectory lines. Multiple first calibration points are sequentially connected according to their trajectory positions to generate static trajectory lines, which are then overlaid and displayed on the reversing image. The line segments between two adjacent first calibration points constitute a static trajectory line segment, and each static trajectory line segment is configured with a corresponding display style according to its distance region.
[0067] In some embodiments, the static trajectory line is obtained by sequentially connecting the line segments between two adjacent first calibration points. In this case, the static trajectory line is formed by sequentially connecting several straight lines. In other embodiments, curve fitting can be performed on multiple first calibration points to obtain a smooth static trajectory line. Regardless of the method used, the portion of the trajectory line between two adjacent first calibration points constitutes a static trajectory line segment, which is the unit used to configure the display style and determine the distance area.
[0068] It is understandable that the first calibration point corresponding to the static trajectory line is obtained from the actual vehicle calibration. Therefore, the position of the static trajectory line also falls directly in the image coordinate system of the reversing image without the need for physical conversion. When the steering wheel is in the middle position, the static trajectory line is the travel path of the vehicle when reversing in a straight line.
[0069] In some embodiments, the number of multiple first calibration points is N, and the static trajectory line includes N-1 static trajectory segments arranged sequentially. These N-1 static trajectory segments correspond to distance regions arranged sequentially from near to far, with the distance region corresponding to the last static trajectory segment being the extended distance region. Taking N as 5 as an example, the static trajectory line includes 4 static trajectory segments arranged sequentially, corresponding to distance regions within 0.4m, 0.4m to 1m, 1m to 2m, and beyond 2m behind the vehicle, respectively. Correspondingly, the colors in the display style of each static trajectory segment are configured as red, yellow, green, and blue, respectively. The distance region corresponding to red represents a danger zone, the distance region corresponding to yellow represents a warning zone, the distance region corresponding to green represents a safe zone, and the extended distance region corresponding to blue can be hidden by default. Thus, the driver can intuitively judge whether there are obstacles within different distance ranges behind the vehicle based on the color distinction of the trajectory segments.
[0070] In some embodiments, the length of the last static trajectory segment corresponding to the extended distance region can be zero, meaning the two endpoints of the static trajectory segment coincide. In this case, the last static trajectory segment degenerates into a segment of zero length, and the number of segments displayed for the static trajectory line is N-2; when the length of the last static trajectory segment is not zero, the number of segments displayed for the static trajectory line is N-1. Taking N=5 as an example, when the length of the last static trajectory segment is zero, the static trajectory line is displayed as 3 segments; when the length of the last static trajectory segment is not zero, the static trajectory line is displayed as 4 segments. Thus, the same set of calibration data can simultaneously meet the requirements of displaying three segments and displaying four segments. In cases where the customer requires a three-segment display, it is only necessary to configure the two endpoints of the last static trajectory segment to coincide, without needing to prepare a separate set of data for this case.
[0071] In some embodiments, the display style includes at least one of color, line type, line width, and transparency. It is understood that the method of distinguishing each static trajectory segment is not limited to color; differences in line type, line width, or transparency can also allow the driver to distinguish different distance areas.
[0072] Please refer to Figure 3 In some embodiments, a reversing trajectory line is overlaid on the reversing image. The image shows different distance zones along the rear of the vehicle, from near to far, for example, zones corresponding to 0.4m, 1m, 2m, and 3m respectively; the trajectory line extends from the rear of the vehicle, with the static trajectory line obtained when the steering wheel is in the middle position shown in the image. Figure 2 The image is labeled "static trajectory". As the steering wheel is turned to the left or right, the dynamic trajectory line moves left or right on the screen, thus displaying multiple trajectory lines obtained when the steering wheel is at different turning angles on the same screen. Each marker point on the trajectory line corresponds to a calibration point obtained through calibration and a trajectory control point obtained by interpolation from the calibration points.
[0073] Based on the foregoing embodiments, this embodiment also provides a lateral distance reference line. Specifically, it includes: generating a lateral distance reference line by extending a static trajectory line along the vehicle width direction to the opposite side, wherein the extension endpoint of the lateral distance reference line is determined by the trajectory configuration data corresponding to the vehicle.
[0074] In some embodiments, starting from each calibration point on the static trajectory line, a lateral distance reference line is obtained by extending it along the horizontal direction of the image, which is the width direction of the vehicle body, towards the opposite side of the vehicle body. The lateral distance reference line corresponding to the left trajectory line extends to the right, and the lateral distance reference line corresponding to the right trajectory line extends to the left. The two lateral distance reference lines intersect in the image to form a distance reference line that runs across the entire image.
[0075] The extension endpoint of the lateral distance reference line is determined by the trajectory configuration data, such as being configured to extend to connect with the lateral distance reference line on the opposite side, or being configured to extend by a set length. Because the extension endpoint can be adjusted through the configuration data, the lateral distance reference line can be positioned appropriately on the screen for different vehicle models or different display sizes.
[0076] Understandably, the longitudinal trajectory lines are used to help the driver judge the distance of obstacles behind the vehicle, while the lateral distance reference lines are used to help the driver judge the position of the obstacles relative to the left and right sides of the vehicle. By combining the two, the driver can simultaneously know the relative relationship between the obstacles and the vehicle in the longitudinal and lateral directions.
[0077] Based on the foregoing embodiments, this embodiment also provides a dynamic trajectory line rendering method. The trajectory line, composed of the multiple trajectory sampling points, is drawn by superimposing K layers with mutual offset. The transparency of each layer decreases sequentially along the offset level, where K is an integer greater than 1.
[0078] In some embodiments, K is 4. During drawing, the trajectory lines formed by the trajectory sampling points are sequentially offset and superimposed into 4 layers. The first layer retains its original transparency, and each subsequent layer is offset by a set pixel distance, with the transparency of each layer decreasing sequentially. As a result, the edges of the trajectory lines are formed by multiple layers of semi-transparent lines, creating a smooth visual effect and achieving anti-aliasing.
[0079] Compared to anti-aliasing methods that increase sampling resolution, this invention achieves smooth edges through a fixed number of offset stacking layers, significantly reducing the number of vertices required to draw the trajectory line. Compared to an 8-layer supersampling method with 4-layer offset stacking, the number of vertices can be reduced to approximately one-quarter, thus reducing rendering overhead under the limited computing resources of in-vehicle devices.
[0080] In some embodiments, the rendering of dynamic trajectory lines is accomplished through a graphics interface, such as drawing lines using a graphics interface like OpenGL. The rendering process is as follows: read the calibration coordinates from the trajectory configuration data, obtain the trajectory control points through interpolation, fill the Bézier curve with a set number of trajectory sampling points using the graphics interface, and then convert the trajectory sampling points into pixel vertices and draw them onto the reversing image.
[0081] Based on the foregoing embodiments, this embodiment also provides trajectory configuration data corresponding to the above method. The trajectory configuration data corresponds to the vehicle, with different vehicles corresponding to different trajectory configuration data. The trajectory configuration data includes the maximum steering wheel angle corresponding to the vehicle, the pixel coordinates of multiple first calibration points corresponding to the static trajectory line obtained through real vehicle calibration, and the pixel coordinates of multiple second calibration points corresponding to the maximum dynamic trajectory line. It may further include at least one of the following: screen size, trajectory line thickness, display style parameters of each static trajectory line segment, display style parameters of the dynamic trajectory line, the number of display segments of the static trajectory line, and the extension endpoint of the lateral distance reference line.
[0082] In some embodiments, trajectory configuration data is saved as a data file, such as a JSON file, with one data file corresponding to one vehicle model. After loading the trajectory configuration data for a specific vehicle model, the reversing trajectory line for that model can be generated according to the aforementioned method. Therefore, the same program can cover multiple vehicle models; when a vehicle model changes, only the trajectory configuration data needs to be replaced, without modifying the program, thus shortening the adaptation cycle of trajectory lines on different vehicle models.
[0083] Please refer to Figure 4 Based on the foregoing embodiments, this embodiment also provides a reversing trajectory line generation system, which includes a configuration module 10, a trajectory generation module 20, and a rendering module 30.
[0084] Configuration module 10 is used to provide trajectory configuration data corresponding to the vehicle. The trajectory configuration data includes the maximum steering wheel angle corresponding to the vehicle, the pixel coordinates of multiple first calibration points corresponding to the static trajectory line obtained through real vehicle calibration, and the pixel coordinates of multiple second calibration points corresponding to the maximum dynamic trajectory line. The multiple first calibration points and multiple second calibration points correspond one-to-one according to the same trajectory position order. Different vehicles correspond to different trajectory configuration data.
[0085] The trajectory generation module 20 is used to obtain the current steering wheel angle, and based on the angle ratio between the current steering wheel angle and the maximum steering wheel angle, linearly interpolates the pixel coordinates of each first calibration point and the corresponding second calibration point to obtain multiple trajectory control points corresponding to the current steering wheel angle, and generates a continuous dynamic trajectory line based on the multiple trajectory control points.
[0086] The rendering module 30 is used to overlay dynamic trajectory lines onto the vehicle's reversing image.
[0087] In some embodiments, the trajectory generation module 20 is further configured to generate a static trajectory line based on the pixel coordinates of a plurality of first calibration points, and the rendering module 30 is further configured to overlay the static trajectory line onto the reversing image and render the dynamic trajectory line. The specific implementation method is the same as that described in the aforementioned method embodiments, and will not be repeated here.
[0088] It is understood that the above division of modules is based solely on logical function. Modules can be integrated into one processing unit, exist as separate physical units, or be integrated into one unit with two or more modules. These modules can be implemented in hardware or as software functional units.
[0089] Based on the foregoing embodiments, this embodiment also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it causes the computer device to perform the aforementioned method for generating reversing trajectory lines. In some embodiments, the computer device further includes a bus connecting the memory and the processor, and may further include a network interface and a user interface, wherein the network interface is used to communicate with a vehicle network or external devices, and the user interface is used to connect to external devices such as a display screen.
[0090] Based on the foregoing embodiments, this embodiment also provides a computer-readable storage medium storing a computer program thereon. When the computer program runs on a processor, it causes the processor to execute the aforementioned method for generating reversing trajectory lines.
[0091] In some embodiments, the computer-readable storage medium includes, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks; the computer program can also be embodied in the form of a software product, which includes several instructions to cause a computer device to execute the above method.
[0092] The remaining contents and working principle of this embodiment are the same as those of the specific implementation method described above, and will not be repeated here.
[0093] Finally, it should be noted that although the above embodiments have been described in the description and drawings of this invention, this should not be construed as limiting the scope of protection of this invention. Any technical solutions resulting from equivalent structural or procedural substitutions or modifications made based on the essential concept of this invention and utilizing the content described in the description and drawings, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of protection of this invention.
Claims
1. A method for generating a reversing trajectory line, characterized in that, include: Obtain the reversing image corresponding to the vehicle; Based on the actual vehicle calibration, the pixel coordinates of multiple first calibration points corresponding to the static trajectory line and the pixel coordinates of multiple second calibration points corresponding to the maximum dynamic trajectory line are obtained; wherein, the pixel coordinates are coordinates in the image coordinate system of the reversing image, and the multiple first calibration points and the multiple second calibration points correspond one-to-one based on the trajectory position order; Obtain the current steering wheel angle and the maximum steering wheel angle corresponding to the vehicle. Based on the angle ratio between the current steering wheel angle and the maximum steering wheel angle, perform linear interpolation on the pixel coordinates of each first calibration point and the corresponding second calibration point to obtain multiple trajectory control points corresponding to the current steering wheel angle. A continuous dynamic trajectory line is generated based on the multiple trajectory control points, and the dynamic trajectory line is superimposed and displayed in the reversing image.
2. The method for generating reversing trajectory lines according to claim 1, characterized in that, The method further includes: The plurality of first calibration points are connected sequentially according to their trajectory positions to generate the static trajectory line; The static trajectory lines are superimposed on the reversing image; Among them, the line segment between two adjacent first calibration points constitutes a static trajectory line segment, and each static trajectory line segment is configured with a corresponding display style according to the distance area it is in.
3. The method for generating reversing trajectory lines according to claim 2, characterized in that, The number of the plurality of first calibration points is N, where N is an integer greater than 1; The static trajectory line includes N-1 static trajectory line segments arranged sequentially. The N-1 static trajectory line segments correspond to distance regions arranged sequentially from near to far, wherein the distance region corresponding to the last static trajectory line segment is the extended distance region. When the length of the last static trajectory line segment is not zero, the number of segments displayed for the static trajectory line is N-1; when the length of the last static trajectory line segment is zero, the number of segments displayed for the static trajectory line is N-2.
4. The method for generating reversing trajectory lines according to claim 2, characterized in that, The method further includes: A lateral distance reference line is generated by extending the static trajectory line along the vehicle width direction to the opposite side. The extension endpoint of the lateral distance reference line is determined by the trajectory configuration data corresponding to the vehicle.
5. The method for generating reversing trajectory lines according to claim 1, characterized in that, The angle ratio is determined based on the direction and amount of deflection of the current steering wheel angle relative to the center position of the steering wheel; For any of the trajectory control points, its x-coordinate and y-coordinate are proportionally interpolated according to the difference between the x-coordinate and y-coordinate of the corresponding first calibration point and second calibration point.
6. The method for generating reversing trajectory lines according to claim 1, characterized in that, The generation of a continuous dynamic trajectory line based on the plurality of trajectory control points includes: The plurality of trajectory control points are used as control points for the Bézier curve, and the Bézier curve is generated based on the plurality of trajectory control points. The Bézier curve is sampled at multiple points to obtain multiple continuously distributed trajectory sampling points; The dynamic trajectory line is rendered based on the multiple trajectory sampling points.
7. The method for generating a reversing trajectory line according to claim 6, characterized in that, The rendering of the dynamic trajectory line based on the multiple trajectory sampling points includes: drawing the trajectory line composed of the multiple trajectory sampling points by superimposing K layers with mutual offset, wherein the transparency of each layer decreases sequentially along the offset level, and K is an integer greater than 1.
8. A reversing trajectory line generation system, characterized in that, include: The configuration module is used to provide trajectory configuration data corresponding to the vehicle. The trajectory configuration data includes the maximum steering wheel angle corresponding to the vehicle, the pixel coordinates of multiple first calibration points corresponding to the static trajectory line obtained through real vehicle calibration, and the pixel coordinates of multiple second calibration points corresponding to the maximum dynamic trajectory line. The multiple first calibration points and the multiple second calibration points correspond one-to-one according to the same trajectory position order. Different vehicles correspond to different trajectory configuration data. The trajectory generation module is used to obtain the current steering wheel angle, and according to the angle ratio between the current steering wheel angle and the maximum steering wheel angle, to perform linear interpolation on the pixel coordinates of each first calibration point and the corresponding second calibration point to obtain multiple trajectory control points corresponding to the current steering wheel angle, and to generate a continuous dynamic trajectory line based on the multiple trajectory control points. A rendering module is used to overlay and display the dynamic trajectory lines on the reversing image of the vehicle.
9. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program, which, when executed by the processor, causes the computer device to perform the reversing trajectory line generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run on a processor, it causes the processor to execute the reversing trajectory line generation method according to any one of claims 1 to 7.
