A display method and device of a vehicle prompt line, an electronic device, and a storage medium
By analyzing the differences in distance data between vehicles and obstacles, determining the animation display strategy and rendering curve segments, the problem of abrupt changes in distance display in vehicle visual display was solved, achieving more accurate distance judgment and safer driving.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD
- Filing Date
- 2025-01-02
- Publication Date
- 2026-05-08
AI Technical Summary
In vehicle visual display design, as the distance continuously approaches or recedes, the display of lines will change abruptly when switching between different display ranges, resulting in an inaccurate grasp of the actual distance.
By analyzing the differences in distance data between vehicles and obstacles, an animation display strategy is determined, and curve segments are rendered and connected according to this strategy to form continuous prompt lines, thus avoiding abrupt changes in distance display.
It achieves a smooth display of the distance between the vehicle and obstacles, helping drivers to judge distances more accurately, improving driving safety and the timeliness of decision-making.
Smart Images

Figure CN119941945B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, and more specifically to a method, apparatus, electronic device, and storage medium for displaying vehicle indicator lines. Background Technology
[0002] In current vehicle visual display design, a turtle diagram with multiple orientations is often used to achieve the desired effect. This method uses different distance ranges and varying numbers and colors of lines to differentiate the distance to obstacles. For example, when the distance is 10-30cm, a red line indicates the model is closer; when the distance is 80-120cm, a green line represents the model is farther away. However, as the distance increases or decreases, the line display changes abruptly when switching between different display ranges, leading to an inaccurate assessment of the actual distance. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method, device, electronic device and storage medium for displaying vehicle warning lines, in order to solve the problem that as the distance continues to approach or move away, the display of the lines only changes abruptly when switching between different display ranges, resulting in an inaccurate grasp of the actual distance.
[0004] In a first aspect, embodiments of the present invention provide a method for displaying vehicle warning lines, the method comprising:
[0005] Acquire curve segments and first distance data between the vehicle and obstacles in different directions at the current moment, wherein the curve segments are located between the vehicle and the obstacles;
[0006] By analyzing the difference between the first distance data and the second distance data in the same direction, the animation display strategy corresponding to the curve segment is obtained, wherein the second distance data is the distance data between the vehicle and the obstacle in the same direction at the previous moment;
[0007] The curve segment is rendered according to the animation display strategy to obtain the rendered curve segment, and the curve segments rendered in different positions are connected to obtain the prompt line of the vehicle at the current moment.
[0008] Furthermore, the analysis of the difference between the first distance data and the second distance data in the same direction to obtain the animation display strategy corresponding to the curve segment includes:
[0009] Compare the first distance data with the second distance data;
[0010] If the first distance data is inconsistent with the second distance data, then the first state corresponding to the first distance data is determined based on whether there is an abnormal jump in the first distance data;
[0011] Obtain the second state corresponding to the second distance data;
[0012] The corresponding animation display strategy is determined based on whether a switch occurs between the first state and the second state.
[0013] Furthermore, determining the first state corresponding to the first distance data based on whether there is an abnormal jump in the first distance data includes:
[0014] If the first distance data has a jump anomaly, then the first state corresponding to the first distance data is determined to be a hidden state; or, if the first distance data does not have a jump anomaly, then the first state corresponding to the first distance data is determined to be a displayed state.
[0015] Obtaining the second state corresponding to the second distance data includes: querying historical detection records and obtaining the second state corresponding to the second distance data from the historical detection records, wherein the second state is a hidden state or a displayed state.
[0016] Furthermore, the step of rendering the curve segment according to the animation display strategy to obtain the rendered curve segment includes:
[0017] If the animation display strategy is the first animation display strategy, the initial transparency of the displayed animation is determined according to the first state, wherein the first animation display strategy is the animation display strategy corresponding to the switch between the first state and the second state;
[0018] Obtain the number of animation frames corresponding to the curve segment, and calculate the transparency of each frame of the display animation based on the position of each frame of the display animation in the number of animation frames and the initial transparency.
[0019] The curve segment is rendered according to the transparency of the animation displayed in each frame, resulting in the rendered curve segment.
[0020] Furthermore, the step of rendering the curve segment according to the animation display strategy to obtain the rendered curve segment includes:
[0021] If the animation display strategy is the second animation display strategy, calculate the distance difference between the first distance data and the second distance data, and calculate the color difference between the first color value corresponding to the first distance data and the second color value corresponding to the second distance data, wherein the second animation display strategy is the animation display strategy corresponding to the first state and the second state when no switch occurs, and the second color value is the color value corresponding to the second distance data;
[0022] The movement step size for each movement is calculated using the distance difference and a preset smoothing coefficient, and the updated color value for each movement is calculated based on the color difference and a preset gradient coefficient.
[0023] The curve segment is rendered step by step according to the movement step size and the color value to obtain the rendered curve segment.
[0024] Furthermore, the connection between the curve segments rendered from different orientations yields the vehicle's current prompt line, including:
[0025] Determine the fan-shaped regions corresponding to the curve segments rendered from different orientations, and the level corresponding to each fan-shaped region, wherein the level is determined based on the distance between the fan-shaped region and the obstacle;
[0026] The grade difference is obtained by comparing the grades of each pair of adjacent sector regions, and adjacent sector regions with a grade difference greater than or equal to a preset value are determined as two sector regions to be connected.
[0027] Connect the curve segments corresponding to the sector regions to be connected to obtain the vehicle's current prompt line.
[0028] Furthermore, the step of connecting the curve segments corresponding to the sector regions to be connected to obtain the vehicle's current prompt line includes:
[0029] The target division points in both sectors to be connected are used as the starting points of the smooth curve;
[0030] An initial curve segment is created based on the starting point and the initial control point;
[0031] The control points in the initial curve segment are updated according to the interpolation factor, and the Bézier curve is recalculated using the updated control points to obtain the updated curve segment;
[0032] Based on the updated curve segment and the target curve segment, a prompt line for the vehicle at the current moment is constructed, wherein the target curve segment is the curve segment corresponding to all sector regions except the sector region to be connected.
[0033] Secondly, embodiments of the present invention provide a display device for vehicle warning lines, the device comprising:
[0034] The acquisition module is used to acquire curve segments and first distance data between the vehicle and obstacles in different directions at the current moment, wherein the curve segments are located between the vehicle and the obstacles;
[0035] The analysis module is used to analyze the difference between the first distance data and the second distance data in the same direction, and to obtain the animation display strategy corresponding to the curve segment, wherein the second distance data is the distance data between the vehicle and the obstacle at the previous moment;
[0036] The rendering module is used to render the curve segment according to the animation display strategy, obtain the rendered curve segment, and connect the rendered curve segments located in different directions to obtain the prompt line of the vehicle at the current moment.
[0037] Thirdly, embodiments of the present invention provide an electronic device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first aspect or any corresponding embodiment thereof.
[0038] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer instructions that cause a computer to perform the method described in the first aspect or any of its corresponding embodiments.
[0039] The method provided in this application analyzes the differences in distance data and displays them in animation, providing a more intuitive view of the changes in distance between the vehicle and obstacles, avoiding inaccurate distance assessment caused by abrupt changes. This helps drivers better judge the distance to obstacles and make safer driving decisions. By rendering and connecting curve segments rendered in different orientations according to the animation display strategy, a complete and continuous prompt line is formed, making the distance display smoother and avoiding abrupt changes caused by changes in orientation / distance. This allows drivers to perceive changes in distance between the vehicle and obstacles more accurately, making more timely and accurate driving decisions and improving driving safety. Attached Figure Description
[0040] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0041] Figure 1 This is a flowchart illustrating a method for displaying vehicle indicator lines according to some embodiments of the present invention;
[0042] Figure 2 This is a flowchart illustrating a method for displaying vehicle indicator lines according to some embodiments of the present invention;
[0043] Figure 3 This is a schematic diagram of a curve connection according to some embodiments of the present invention;
[0044] Figure 4 This is a schematic diagram illustrating the actual effect of vehicle warning lines according to some embodiments of the present invention;
[0045] Figure 5 This is a structural block diagram of a vehicle warning line display device according to an embodiment of the present invention;
[0046] Figure 6 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] According to embodiments of the present invention, a method, apparatus, electronic device, and storage medium for displaying vehicle warning lines are provided. It should be noted that the steps shown in the flowcharts in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0049] This embodiment provides a method for displaying vehicle indicator lines. Figure 1 This is a flowchart of a method for displaying vehicle indicator lines according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0050] Step S101: Obtain the curve segment and first distance data between the vehicle and obstacles in different directions at the current time, wherein the curve segment is located between the vehicle and the obstacle.
[0051] In this embodiment, the driver activates the parking distance measuring device, and distance measuring devices (such as radar or distance sensors) located at different positions on the vehicle begin to transmit signals and receive reflected signals. The distance measuring device should be able to monitor the environment around the vehicle in real time and continuously update obstacle information. For each received reflected signal, the distance measuring device calculates the initial distance data between the obstacle and the vehicle based on parameters such as the signal time difference and frequency variation.
[0052] Based on the determined location of the ranging device and the scanning range, a sector-shaped region is constructed. Each sector corresponds to a curve segment located between a specific part of the vehicle (e.g., side, front) and an obstacle. The shape of the curve segment depends on various factors, including the relative position and shape of the vehicle and obstacle, as well as the influence of the surrounding environment. Generally, the curve segment may not be a perfectly straight line, but rather exhibit a degree of curvature or irregular shape. For example, if there are other objects or terrain features between the vehicle and the obstacle, the curve segment may become curved due to signal reflection, refraction, or obstruction. Furthermore, the shapes of the vehicle and obstacles can also cause changes in the shape of the curve segment.
[0053] Step S102: Analyze the difference between the first distance data and the second distance data in the same direction to obtain the animation display strategy corresponding to the curve segment. The second distance data is the distance data between the vehicle and the obstacle in the same direction at the previous moment.
[0054] In this embodiment, the difference between the first distance data and the second distance data is first calculated. If the difference is positive, it indicates that the distance between the vehicle and the obstacle has increased; if the difference is negative, it indicates that the distance has decreased. Then, based on the magnitude of the difference, the relative speed and trend of movement between the vehicle and the obstacle can be determined. A larger difference may mean that the vehicle is rapidly approaching or moving away from the obstacle.
[0055] If either the first or second distance data exceeds the preset range, causing a switch between the current state and the previous data state (showing and hiding), it indicates a significant change in the relative position of the vehicle and the obstacle. In this case, the animation display strategy becomes the first animation display strategy: a fade-in / fade-out animation. When the distance changes from the display range to outside the range, the curve segment gradually disappears; when the distance changes from outside the range back to the display range, the curve segment gradually appears. This avoids visual interference to the driver caused by sudden showing or hiding.
[0056] If both the first and second distance data are within the preset range, and there is no change in the display / hide status between the current and previous data states, it indicates that the relative positional relationship between the vehicle and the obstacle is relatively stable. In this case, the animation display strategy becomes the second animation display strategy, which calculates the interpolation between the current and previous distances and gradually adjusts the display position of the curve segment to ensure a smooth transition. Simultaneously, the target color value is calculated based on the current distance and interpolated with the previous color value, causing the color of the curve segment to gradually change with the distance.
[0057] Step S103: Render the curve segment according to the animation display strategy to obtain the rendered curve segment, and connect the curve segments rendered in different directions to obtain the vehicle's prompt line at the current moment.
[0058] In the embodiments of this application, animation display strategies are determined under different conditions. For example, the display state is determined based on whether the distance data is within a preset range, interpolation calculations are performed to achieve smooth movement and color gradient, and in-place fade-in / fade-out animations are executed.
[0059] For each curve segment in each direction: Based on the current animation display strategy and relevant data (such as distance data, color values, etc.), determine the attributes of the curve segment, including position, shape, color, transparency, etc. Use functions and methods provided by graphics libraries (such as OpenGL, Canvas, etc.) to draw and render the curve segment according to the determined attributes.
[0060] Iterate through all rendered curve segments in all directions to determine the connection points between adjacent curve segments. This can be done by selecting the endpoints of curve segments or specific points. Use the drawing functions provided by the graphics library to connect the curve segments in adjacent directions at the connection points. You can set the properties of the connecting lines, such as color and width, to ensure they match the curve segments. For curve segments in non-adjacent directions, you can segment them or use other connection methods as needed to ensure the continuity and integrity of the prompt line. After connecting all curve segments, you will obtain the vehicle's prompt line at the current moment.
[0061] The method provided in this application analyzes the differences in distance data and displays them in animation, providing a more intuitive view of the changes in distance between the vehicle and obstacles, avoiding inaccurate distance assessment caused by abrupt changes. This helps drivers better judge the distance to obstacles and make safer driving decisions. By rendering and connecting curve segments rendered in different orientations according to the animation display strategy, a complete and continuous prompt line is formed, making the distance display smoother and avoiding abrupt changes caused by changes in orientation / distance. This allows drivers to perceive changes in distance between the vehicle and obstacles more accurately, making more timely and accurate driving decisions and improving driving safety.
[0062] Figure 2 This is a flowchart of a method for displaying vehicle indicator lines according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0063] Step S201: Obtain the curve segments and first distance data between the vehicle and obstacles in different directions at the current moment, wherein the curve segments are located between the vehicle and the obstacles. For details, please refer to step S101 in the above embodiment, which will not be repeated here.
[0064] Step S202: Analyze the difference between the first distance data and the second distance data to obtain the animation display strategy corresponding to the curve segment. The second distance data is the distance data between the vehicle and the obstacle in the same direction at the previous moment.
[0065] In this embodiment of the application, the difference between the first distance data and the second distance data in the same orientation is analyzed to obtain the animation display strategy corresponding to the curve segment, including the following steps A1-A4:
[0066] Step A1: Compare the first distance data with the second distance data.
[0067] Specifically, the first distance data is the distance between the vehicle and the obstacle at the current moment, and the second distance data is the distance between the vehicle and the obstacle at the previous moment. The first distance data and the second distance data are compared, for example, by comparing their numerical values or calculating the difference between them.
[0068] Step A2: If the first distance data and the second distance data are inconsistent, determine the first state corresponding to the first distance data based on whether there is an abnormal jump in the first distance data.
[0069] In this embodiment of the application, determining the first state corresponding to the first distance data based on whether there is a jump anomaly in the first distance data includes: if there is a jump anomaly in the first distance data, then determining the first state corresponding to the first distance data to be a hidden state; if there is no jump anomaly in the first distance data, then determining the first state corresponding to the first distance data to be a displayed state.
[0070] Specifically, determine whether the first distance data and the second distance data are equal. If they are not equal, the values are considered inconsistent, and further investigation is needed to determine if there are any abrupt changes in the first distance data. For example, if the first distance data is 1.2 meters and the second distance data is 1 meter, the values are inconsistent. Determining whether there are any abrupt changes in the first distance data can be done by setting a reasonable threshold. If the difference between the first and second distance data exceeds this threshold, an abrupt change is considered to exist. For example, a threshold of 3 meters can be set. If the difference between the first and second distance data is greater than 3 meters, an abrupt change is considered to exist in the first distance data.
[0071] The first state is determined based on the presence of any abrupt transitions. If an abrupt transition occurs in the first distance data, the first state is set to hidden; otherwise, it is set to displayed. For example, if an abrupt transition occurs, the first state is set to hidden, indicating that the information may not be suitable for display due to an abnormal situation. If no abrupt transition occurs, the first state is set to displayed.
[0072] Step A3: Obtain the second state corresponding to the second distance data.
[0073] Specifically, historical detection records are queried, and the second state corresponding to the second distance data is obtained from these records. The second state can be either a hidden state or a displayed state. The historical detection records contain distance data from multiple historical moments and their corresponding state information. Then, records related to the second distance data from the previous moment are filtered out, and the state corresponding to that second distance data, i.e., the hidden state or the displayed state, is extracted from them.
[0074] Step A4: Determine the corresponding animation display strategy based on whether a switch occurs between the first state and the second state.
[0075] Specifically, the system compares the first state and the second state to see if they are the same. If they are different, a state transition is considered to have occurred; if they are the same, no state transition has occurred. For example, if the first state is hidden and the second state is visible, then a state transition has definitely occurred.
[0076] Determine the animation display strategy: The appropriate animation display strategy is determined based on whether a state transition occurs. If no state transition occurs, interpolation calculations may be used to achieve animation display strategies such as smooth movement and color gradients. For example, when both the first and second states are display states, interpolation calculations are performed based on the current distance and the previous distance to make the displayed curve segment move smoothly, while simultaneously applying color gradients based on distance changes.
[0077] If a state transition occurs, a fade-in / fade-out animation may be executed. For example, when the first state is hidden and the second state is visible, a fade-out animation of the curve segment is executed; when the first state is visible and the second state is hidden, a fade-out animation is executed. This avoids the discomfort caused to the user by sudden state changes, making the display effect more natural and smooth.
[0078] Step S203: Render the curve segment according to the animation display strategy to obtain the rendered curve segment, and connect the curve segments rendered in different directions to obtain the vehicle's prompt line at the current moment.
[0079] In this embodiment of the application, the curve segment is rendered according to the animation display strategy to obtain the rendered curve segment, including the following steps B1-B3:
[0080] Step B1: If the animation display strategy is the first animation display strategy, determine the initial transparency of the displayed animation based on the first state, wherein the first animation display strategy is the animation display strategy corresponding to the switch between the first state and the second state.
[0081] Specifically, the first step is to determine whether the current animation display strategy is the first animation display strategy. The first animation display strategy is the animation display strategy corresponding to the transition between the first state and the second state. For example, the current animation display strategy type can be determined by a flag variable or specific judgment logic.
[0082] If the first animation display strategy is determined, the initial transparency of the display animation needs to be determined based on the first state. If the first state is a visible state, it means the current state is switching from visible to another state (possibly a hidden state), and the initial transparency can be set to a higher value, such as 100% (completely opaque). This is because in a fade-out animation, the initial state is completely visible and then gradually becomes transparent. If the first state is a hidden state, it means the current state is switching from hidden to visible, and the initial transparency can be set to a lower value, such as 0% (completely transparent). In a fade-in animation, the initial state is completely invisible and then gradually becomes opaque.
[0083] Step B2: Obtain the number of animation frames corresponding to the curve segment, and calculate the transparency of each frame of the display animation based on its position in the number of animation frames and its initial transparency.
[0084] Specifically, determine the total number of frames in the displayed animation corresponding to the curve segment. This can be calculated based on the animation's duration and frame rate. For example, if the animation duration is 1 second and the frame rate is 30 frames per second, then the animation frame count is 30 frames. The animation frame count can be calculated dynamically based on pre-set parameters or system performance and requirements.
[0085] For each frame of the animation, the transparency of that frame is calculated based on its position within the animation frame count and its initial transparency. If it's a fade-in animation transitioning from visible to hidden, the transparency can be gradually reduced as the number of frames increases. For example, if the initial transparency is 100%, and the current frame is the nth frame with a total of N frames, the transparency can be calculated as (Nn) / N × 100%. This way, the transparency gradually decreases as the animation progresses, achieving a fade-in effect.
[0086] If it's a fade-in animation switching from hidden to visible, the transparency gradually increases with the number of frames. For example, if the initial transparency is 0%, the transparency can be calculated as n / N × 100%. As the animation progresses, the transparency gradually increases, achieving the fade-in effect.
[0087] Step B3: Render the curve segment according to the transparency of the animation displayed in each frame to obtain the rendered curve segment.
[0088] Specifically, for each frame of the animation, the curve segment is rendered based on the transparency of that frame. A graphics library function is used to set the transparency of the curve segment to the value calculated for the current frame. Then, the curve segment is drawn based on its position, shape, and other attributes, resulting in the rendering result for that frame. This process is repeated until all frames have been rendered, resulting in a series of curve segment images with different transparency levels, achieving the fade-in / fade-out animation effect.
[0089] The method provided in this application achieves a smooth visual transition effect by determining the initial transparency and calculating and adjusting the transparency frame by frame when switching between a first state and a second state. For example, when switching from a displayed state to a hidden state, there is no sudden disappearance, but rather a gradual increase in transparency, making the user's visual experience more natural and reducing the visual impact caused by sudden state changes.
[0090] For drivers or users, this animated display strategy clearly conveys changes in information status. In vehicle scenarios, when the distance data between the vehicle and obstacles changes, the gradual transparency allows the driver to more intuitively understand the system's judgment and feedback on the current situation, thereby making better decisions and improving driving safety and comfort. It avoids confusion or misjudgment that might be caused by sudden changes in display or hiding.
[0091] In this embodiment of the application, the curve segment is rendered according to the animation display strategy to obtain the rendered curve segment, including the following steps C1-C3:
[0092] Step C1: If the animation display strategy is the second animation display strategy, calculate the distance difference between the first distance data and the second distance data, and calculate the color difference between the first color value corresponding to the first distance data and the second color value corresponding to the second distance data. The second animation display strategy is the animation display strategy corresponding to the first state and the second state when no switch occurs.
[0093] Specifically, it determines whether the current animation display strategy is the second animation display strategy. The second animation display strategy is the animation display strategy corresponding to the state when there is no switch between the first and second states.
[0094] The first distance data is the distance between the vehicle and the obstacle at the current moment, and the second distance data is the distance between the vehicle and the obstacle at the previous moment. The distance difference is calculated by subtracting the second distance data from the first distance data. A first color value corresponding to the first distance data and a second color value corresponding to the second distance data are determined. Color values can be determined based on a specific mapping relationship between the distance data; for example, a darker color indicates a closer distance, and a lighter color indicates a farther distance. The difference between the first and second color values across each color channel (e.g., RGB channels) is calculated. For example, if the first color value is (100, 120, 150) and the second color value is (90, 110, 140), then the color difference in the R channel is 10, the color difference in the G channel is 10, and the color difference in the B channel is 10.
[0095] Step C2: Calculate the movement step size for each movement using the distance difference and the preset smoothing coefficient, and calculate the updated color value for each movement based on the color difference and the preset gradient coefficient.
[0096] Specifically, obtain the preset smoothing coefficient, which is usually a value less than 1, used to control the speed of smooth movement. For example, the smoothing coefficient can be set to 0.1. Multiply the distance difference by the smoothing coefficient to obtain the movement step size for each movement.
[0097] Obtain the preset gradient coefficient, which is also a value less than 1, used to control the speed of color gradient. For example, the gradient coefficient can be set to 0.05. For each color channel, multiply the color difference by the gradient coefficient to obtain the color value of that channel for each update. For example, if the color difference in the R channel is 10 and the gradient coefficient is 0.05, then the color value of the R channel for each update will be 0.5.
[0098] Step C3: Render the curve segment step by step according to the movement step size and color value to obtain the rendered curve segment.
[0099] Specifically, firstly, the position of the curve segment is updated incrementally based on the current position and the step size. If the current curve segment represents a distance of 1 meter between the vehicle and the obstacle, and the step size is 0.2 meters, then the position of the curve segment is moved one small step towards the new distance during each rendering. Simultaneously, the color of the curve segment is updated incrementally based on the calculated updated color values. If the current color is (90, 110, 140), and the R channel's color value is 0.5 each time it is updated, then the R channel value is increased by 0.5 during each rendering, and the same applies to other channels, causing the color of the curve segment to gradually change.
[0100] Repeat this process until the distance and color reach new values, completing the smooth movement and color gradient rendering of the curve segment, resulting in the rendered curve segment.
[0101] The method provided in this application, when there is no switch between the first and second states, can accurately capture subtle changes in data by calculating distance and color differences. By calculating the movement step size using the distance difference and a smoothing coefficient, the curve segment can move gradually in small steps when representing changes in distance between the vehicle and obstacles, avoiding sudden positional changes and achieving a smooth transition. The color value updated each time is calculated based on the color difference and a gradient coefficient, allowing the color of the curve segment to gradually change with distance, enhancing visual continuity and a natural feel.
[0102] For users (such as drivers), this gradual rendering method more accurately reflects the changing realities between the vehicle and obstacles. Through smooth movement and color gradations, users can more intuitively perceive subtle changes in distance, enabling them to make better decisions. This helps increase user trust in the system. Stable and accurate feedback assures users that the system can reliably provide information about the vehicle's surroundings, enhancing their reliance on and confidence in using the system.
[0103] In this embodiment of the application, connecting the curve segments rendered from different orientations to obtain the vehicle's current prompt line includes the following steps D1-D3:
[0104] Step D1: Determine the sector area corresponding to the curve segment rendered from different orientations, and the level corresponding to each sector area. The level is determined based on the distance between the sector area and the obstacle.
[0105] Specifically, first, the definition and extent of the fan-shaped regions into which the space surrounding the vehicle is divided are clearly defined. For example, with the vehicle as the center, the various ranging devices deployed on the vehicle can be divided into multiple fan-shaped regions at certain angles. For each rendered curve segment, its fan-shaped region is determined based on its spatial orientation. The level is determined based on the distance between the fan-shaped region and obstacles. Multiple distance intervals can be set, each corresponding to a level. For each fan-shaped region, the distance between the nearest obstacle within that region and the vehicle is measured. The level corresponding to that fan-shaped region is determined based on this distance.
[0106] Step D2: Compare the levels of each pair of adjacent sector regions to obtain the level difference, and determine the adjacent sector regions with a level difference greater than or equal to a preset value as two sector regions to be connected.
[0107] Specifically, all adjacent sector pairs are compared sequentially. For each sector, its adjacent sector pairs are determined, which can be done by traversing the sector pairs according to their numbering order or spatial relationship. The level of each pair of adjacent sector pairs is compared. A preset value is obtained based on the level difference. If the level difference between two adjacent sector pairs is greater than this preset value, then these two sector pairs are determined to be connected. For example, if the preset value is 2, and a sector pair has a level of 1, its adjacent sector pair has a level of 3, and the level difference is 2, which equals the preset value, then these two sector pairs are to be connected.
[0108] Step D3: Connect the curve segments corresponding to the sector regions to be connected to obtain the vehicle's prompt line at the current moment.
[0109] Specifically, connecting the curve segments corresponding to the sector regions to be connected to obtain the vehicle's prompt line at the current moment includes: taking the target equidistant points in both sector regions to be connected as the starting points of the smooth curve; creating an initial curve segment based on the starting points and initial control points; updating the control points in the initial curve segment according to the interpolation factor, and recalculating the Bézier curve using the updated control points to obtain an updated curve segment; and constructing the vehicle's prompt line at the current moment based on the updated curve segment and the target curve segment, wherein the target curve segment is the curve segment corresponding to all sector regions except the sector regions to be connected.
[0110] First, for the two sector regions to be connected, determine the target division point as the starting point of the smooth curve. For example, the edge curve of each sector region can be divided into equal parts according to a certain ratio, such as taking the 1 / 3 division point as the target division point. In this way, the two sector regions to be connected will have two starting points for creating the curve segment connecting the two regions.
[0111] Secondly, initial curve segments are created based on the starting point and initial control points. Initial control points can be determined based on experience or specific design rules; for example, the midpoint of the line connecting the centers of two sector regions can be chosen as an initial control point. Then, the Bézier curve algorithm is used to create initial curve segments using the two starting points and the initial control points.
[0112] Then, the control points in the initial curve segment are updated according to the interpolation factor. The interpolation factor can gradually change based on time or the number of iterations, for example, starting from 0 and gradually increasing to 1. The new control point position is calculated based on the interpolation factor; for example, a linear interpolation method can be used: new control point position = (1 - interpolation factor) × old control point position + interpolation factor × target control point position. The Bézier curve is recalculated using the updated control points to obtain the updated curve segment. As the interpolation factor changes, the curve segment gradually transitions from the initial state to the target state, achieving a smooth transition effect.
[0113] Finally, a prompt line for the vehicle at the current moment is constructed based on the updated curve segment and the target curve segment. The target curve segment is the curve segment corresponding to all sector regions except the sector region to be connected. For example... Figure 3 As shown, the updated curve segment is connected to the target curve segment to form a complete prompt line. The curve segments can be connected sequentially to ensure the continuity and integrity of the prompt line.
[0114] It should be noted that the purpose of the connection method provided in this application embodiment is to provide a smoother visual effect by connecting adjacent sectors with smooth curves when the lines are relatively similar; while disconnecting when the levels are significantly different to avoid unnatural transitions. Furthermore, using Bézier curves and interpolation operations can further enhance the smoothness and realism of the curves, making the overall effect more visually appealing, such as... Figure 4 As shown, in traditional solutions, the connections between different areas are often not specially treated, resulting in a noticeable sense of separation, and users cannot visually perceive the connection between areas. This makes the overall display effect less coherent and makes it difficult to intuitively judge the relationship and distance information between different areas visually. However, the embodiments of this application achieve seamless connections between different sector areas. This makes the transition between different sector areas more natural, eliminates potential gaps or discontinuities, and improves the overall visual consistency.
[0115] Furthermore, when the distance between adjacent sector areas changes, the system can perform real-time calculations and plot the curve based on the Bézier curve calculation method. This allows for timely adjustment and plotting of the curve according to the dynamic changes in the distance between the vehicle and obstacles, reflecting the current actual situation.
[0116] This embodiment also provides a vehicle warning line display device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0117] This embodiment provides a display device for vehicle warning lines, such as... Figure 5 As shown, it includes:
[0118] The acquisition module 501 is used to acquire the curve segment between the vehicle and obstacles in different directions at the current time and the first distance data, wherein the curve segment is located between the vehicle and the obstacle;
[0119] Analysis module 502 is used to analyze the difference between the first distance data and the second distance data in the same direction, and obtain the animation display strategy corresponding to the curve segment. The second distance data is the distance data between the vehicle and the obstacle in the same direction at the previous moment.
[0120] The rendering module 503 is used to render the curve segment according to the animation display strategy, obtain the rendered curve segment, and connect the curve segments rendered in different positions to obtain the vehicle's prompt line at the current moment.
[0121] In this embodiment of the application, the analysis module 502 is used to compare the first distance data with the second distance data; if the first distance data and the second distance data are inconsistent, the first state corresponding to the first distance data is determined according to whether there is an abnormal jump in the first distance data; the second state corresponding to the second distance data is obtained; and the corresponding animation display strategy is determined according to whether a switch occurs between the first state and the second state.
[0122] In this embodiment of the application, the analysis module 502 is used to determine that if there is a jump anomaly in the first distance data, the first state corresponding to the first distance data is a hidden state; if there is no jump anomaly in the first distance data, the first state corresponding to the first distance data is a displayed state.
[0123] The analysis module 502 is also used to query historical detection records and obtain the second state corresponding to the second distance data from the historical detection records, wherein the second state is a hidden state or a displayed state.
[0124] In this embodiment of the application, the rendering module 503 is used to determine the initial transparency of the displayed animation according to the first state if the animation display strategy is the first animation display strategy, wherein the first animation display strategy is the animation display strategy corresponding to the switch between the first state and the second state; obtain the animation frame number of the displayed animation corresponding to the curve segment, and calculate the transparency of each frame of the displayed animation according to the position of each frame of the displayed animation in the animation frame number and the initial transparency; render the curve segment according to the transparency of each frame of the displayed animation to obtain the rendered curve segment.
[0125] In this embodiment, the rendering module 503 is used to calculate the distance difference between the first distance data and the second distance data, and to calculate the color difference between the first color value corresponding to the first distance data and the second color value corresponding to the second distance data, if the animation display strategy is the second animation display strategy. The second animation display strategy is the animation display strategy corresponding to the first state and the second state when no switch occurs. The module calculates the movement step size for each movement using the distance difference and a preset smoothing coefficient, and calculates the updated color value for each movement based on the color difference and a preset gradient coefficient. The module then renders the curve segment step by step according to the movement step size and the color value to obtain the rendered curve segment.
[0126] In this embodiment, the rendering module 503 is used to determine the fan-shaped regions corresponding to the curve segments rendered from different orientations, and the level corresponding to each fan-shaped region. The level is determined based on the distance between the fan-shaped region and the obstacle. The level difference is obtained by comparing the levels corresponding to each two adjacent fan-shaped regions, and adjacent fan-shaped regions with a level difference greater than or equal to a preset value are determined as two fan-shaped regions to be connected. The curve segments corresponding to the fan-shaped regions to be connected are connected to obtain the vehicle's prompt line at the current moment.
[0127] In this embodiment, the rendering module 503 is used to take the target division points of the two sector regions to be connected as the starting points of the smooth curve; create an initial curve segment based on the starting points and the initial control points; update the control points in the initial curve segment according to the interpolation factor, and recalculate the Bézier curve using the updated control points to obtain an updated curve segment; construct the vehicle's prompt line at the current moment based on the updated curve segment and the target curve segment, wherein the target curve segment is the curve segment corresponding to the other sector regions in all sector regions except the sector regions to be connected.
[0128] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an optional embodiment of the present invention, such as... Figure 6 As shown, the electronic device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.
[0129] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0130] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0131] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device as displayed on a mini-program landing page. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0132] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0133] The electronic device also includes a communication interface 30 for communicating with other devices or communication networks.
[0134] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0135] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for displaying vehicle indicator lines, characterized in that, The method includes: Acquire curve segments and first distance data between the vehicle and obstacles in different directions at the current moment, wherein the curve segments are located between the vehicle and the obstacles; By analyzing the difference between the first distance data and the second distance data, the animation display strategy corresponding to the curve segment is obtained, wherein the second distance data is the distance data between the vehicle and the obstacle in the same direction at the previous moment; The curve segment is rendered according to the animation display strategy to obtain the rendered curve segment, and the curve segments rendered in different positions are connected to obtain the prompt line of the vehicle at the current moment. The step of analyzing the difference between the first distance data and the second distance data in the same direction to obtain the animation display strategy corresponding to the curve segment includes: comparing the first distance data and the second distance data; if the first distance data and the second distance data are inconsistent, determining the first state corresponding to the first distance data based on whether there is an abnormal jump in the first distance data; obtaining the second state corresponding to the second distance data; and determining the corresponding animation display strategy based on whether a switch occurs between the first state and the second state. The step of rendering the curve segment according to the animation display strategy to obtain the rendered curve segment includes: if the animation display strategy is a first animation display strategy, determining the initial transparency of the display animation according to the first state, wherein the first animation display strategy is the animation display strategy corresponding to the switch between the first state and the second state; obtaining the animation frame number of the display animation corresponding to the curve segment, and calculating the transparency of each frame of the display animation according to the position of each frame of the display animation in the animation frame number and the initial transparency; rendering the curve segment according to the transparency of each frame of the display animation to obtain the rendered curve segment.
2. The method according to claim 1, characterized in that, The step of determining the first state corresponding to the first distance data based on whether there is an abnormal change in the first distance data includes: If the first distance data has a jump anomaly, then the first state corresponding to the first distance data is determined to be a hidden state; or, if the first distance data does not have a jump anomaly, then the first state corresponding to the first distance data is determined to be a displayed state. Obtaining the second state corresponding to the second distance data includes: querying historical detection records and obtaining the second state corresponding to the second distance data from the historical detection records, wherein the second state is a hidden state or a displayed state.
3. The method according to claim 1, characterized in that, The step of rendering the curve segment according to the animation display strategy to obtain the rendered curve segment includes: If the animation display strategy is the second animation display strategy, calculate the distance difference between the first distance data and the second distance data, and calculate the color difference between the first color value corresponding to the first distance data and the second color value corresponding to the second distance data, wherein the second animation display strategy is the animation display strategy corresponding to the first state and the second state when no switch occurs; The movement step size for each movement is calculated using the distance difference and a preset smoothing coefficient, and the updated color value for each movement is calculated based on the color difference and a preset gradient coefficient. The curve segment is rendered step by step according to the movement step size and the color value to obtain the rendered curve segment.
4. The method according to claim 1, characterized in that, The connection between the curve segments rendered from different orientations yields the vehicle's current prompt line, including: Determine the fan-shaped regions corresponding to the curve segments rendered from different orientations, and the level corresponding to each fan-shaped region, wherein the level is determined based on the distance between the fan-shaped region and the obstacle; The grade difference is obtained by comparing the grades of each pair of adjacent sector regions, and adjacent sector regions with a grade difference greater than or equal to a preset value are determined as two sector regions to be connected. Connect the curve segments corresponding to the sector regions to be connected to obtain the vehicle's current prompt line.
5. The method according to claim 4, characterized in that, The step of connecting the curve segments corresponding to the sector regions to be connected to obtain the vehicle's current prompt line includes: The target division points in both sectors to be connected are used as the starting points of the smooth curve; An initial curve segment is created based on the starting point and the initial control point; The control points in the initial curve segment are updated according to the interpolation factor, and the Bézier curve is recalculated using the updated control points to obtain the updated curve segment; Based on the updated curve segment and the target curve segment, a prompt line for the vehicle at the current moment is constructed, wherein the target curve segment is the curve segment corresponding to all sector regions except the sector region to be connected.
6. A display device for vehicle warning lines, characterized in that, The device includes: The acquisition module is used to acquire curve segments and first distance data between the vehicle and obstacles in different directions at the current moment, wherein the curve segments are located between the vehicle and the obstacles; The analysis module is used to analyze the difference between the first distance data and the second distance data in the same direction, and to obtain the animation display strategy corresponding to the curve segment, wherein the second distance data is the distance data between the vehicle and the obstacle at the previous moment; The rendering module is used to render the curve segment according to the animation display strategy, obtain the rendered curve segment, and connect the curve segments rendered in different positions to obtain the prompt line of the vehicle at the current moment. The analysis module is specifically used to compare the first distance data with the second distance data; if the first distance data and the second distance data are inconsistent, then determine the first state corresponding to the first distance data based on whether there is an abnormal jump in the first distance data; obtain the second state corresponding to the second distance data; and determine the corresponding animation display strategy based on whether a switch occurs between the first state and the second state. The analysis module is specifically configured to: if the animation display strategy is a first animation display strategy, determine the initial transparency of the displayed animation based on the first state, wherein the first animation display strategy is the animation display strategy corresponding to the switch between the first state and the second state; obtain the animation frame number of the displayed animation corresponding to the curve segment, and calculate the transparency of each frame of the displayed animation based on the position of each frame of the displayed animation in the animation frame number and the initial transparency; render the curve segment according to the transparency of each frame of the displayed animation to obtain the rendered curve segment.
7. An electronic device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Vehicle radar detection information display method and device, vehicle-mounted terminal and storage medium
CN118625323A