Vehicle head-up display method and device, computer device, vehicle, readable storage medium and program product
By acquiring images of the vehicle's environment and the position coordinates of the head-up display elements, and using image processing technology to calculate the road slope in real time, the problem of mismatch between display elements and road slope in augmented reality head-up displays has been solved, improving the display effect and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG GEELY HLDG GRP CO LTD
- Filing Date
- 2026-05-28
- Publication Date
- 2026-07-28
AI Technical Summary
In existing technologies, augmented reality head-up display functions cannot accurately match display elements with road slopes, resulting in a poor user experience.
By acquiring environmental images of the vehicle and the position coordinates of the head-up display elements, image processing technology is used to calculate the road slope in real time, and the head-up display elements are rendered based on the slope to improve the display effect.
This allows for better integration of head-up display elements with the road, improving the display effect and reliability of the augmented reality head-up display function.
Smart Images

Figure CN122469520A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and in particular to a head-up display method, apparatus, computer equipment, vehicle, computer-readable storage medium, and computer program product for a vehicle. Background Technology
[0002] With the continuous development of electronic devices and the continuous improvement of vehicle technology, vehicles are gradually being equipped with intelligent in-vehicle terminals to realize various intelligent functions, such as augmented reality head-up display functions, which allow drivers to view real-time vehicle speed, navigation arrow lines, and other information on the windshield, thus improving the driver's perception.
[0003] Currently, as more and more vehicles are equipped with augmented reality head-up display (AR) functionality, users' demands for AR AR head-up display functionality are also increasing. How to improve the display effect of AR AR head-up display functionality has become a concern for all parties. Summary of the Invention
[0004] Therefore, it is necessary to provide a vehicle head-up display method, apparatus, computer equipment, vehicle, computer-readable storage medium, and computer program product that can improve the display effect of augmented reality head-up display function in response to the above-mentioned technical problems.
[0005] In a first aspect, this application provides a method for a vehicle head-up display, comprising: acquiring an environmental image corresponding to the vehicle and first position coordinates corresponding to a head-up display element; determining a road slope based on the first position coordinates and the environmental image; rendering the head-up display element based on the road slope to obtain a target head-up display element, and displaying the target head-up display element.
[0006] In one embodiment, determining the road slope based on the first location coordinates and the environmental image includes: determining lane line sampling points corresponding to each lane line based on the first location coordinates and the environmental image; and determining the road slope based on the second location coordinates of each lane line sampling point.
[0007] In one embodiment, determining the road slope based on the second position coordinates of each lane line sampling point includes: determining the lane line tangent at the second position coordinates of each lane line sampling point; determining the third position coordinates of the lane line vanishing point based on the lane line tangents, wherein the lane line vanishing point is the intersection of the lane line tangents; determining the road slope based on the third position coordinates and the optical center position coordinates, or determining the road slope based on the first position coordinates and the third position coordinates, wherein the optical center position coordinates are the position coordinates of the optical center of the image acquisition component that acquires the environmental image.
[0008] In one embodiment, determining the road slope based on the third location coordinates and the optical center location coordinates includes: calculating a first road slope based on the third location coordinates and the optical center location coordinates, and subtracting a reference flat ground slope from the first road slope to obtain the road slope.
[0009] In one embodiment, determining the road slope based on the first location coordinates and the third location coordinates includes: calculating the second road slope based on the third location coordinates and the first location coordinates, and subtracting the reference flat ground slope from the second road slope to obtain the road slope.
[0010] In one embodiment, determining the road slope based on the second position coordinates of each lane line sampling point includes: determining the elevation difference and horizontal difference of the first position coordinates relative to the target lane line sampling point based on the first position coordinates and the second position coordinates of the target lane line sampling point, wherein the target lane line sampling point is the lane line sampling point with the smallest distance from the lower boundary of the environmental image among all lane line sampling points; and determining the road slope based on the elevation difference and horizontal difference, wherein the road slope includes a percentage slope value.
[0011] In one embodiment, the process of determining the target lane line sampling point includes: determining a plurality of second straight lines parallel to a first straight line in an environmental image, wherein the first straight line includes a first position coordinate and at least two lane line sampling points, the first straight line is parallel to the lower boundary of the environmental image, and the distance between the first straight line and two adjacent straight lines among the plurality of second straight lines is a preset distance; determining a target second straight line among each second straight line, and determining the intersection of the target second straight line and each lane line as the target lane line sampling point, wherein the target second straight line is the second straight line among the second straight lines with the smallest distance to the lower boundary of the environmental image.
[0012] In one embodiment, determining lane line sampling points corresponding to each lane line based on the first location coordinates and the environmental image includes: identifying each lane line included in the environmental image; determining the intersection of the first straight line where the first location coordinates are located and each lane line as the lane line sampling point, wherein the first straight line is parallel to the lower boundary of the environmental image.
[0013] In one embodiment, acquiring the environmental image corresponding to the vehicle and the first position coordinates corresponding to the head-up display element includes: acquiring the environmental image through an image acquisition component; receiving the display position information corresponding to the head-up display element input from an external device; and determining the first position coordinates based on the display position information, the imaging parameters of the image acquisition component, and the installation parameters of the image acquisition component.
[0014] Secondly, this application also provides a head-up display device for a vehicle, comprising: an acquisition module for acquiring an environmental image corresponding to the vehicle and first position coordinates corresponding to the head-up display element; a slope determination module for determining the road slope based on the first position coordinates and the environmental image; and a rendering module for rendering the head-up display element based on the road slope to obtain a target head-up display element and displaying the target head-up display element.
[0015] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect.
[0016] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.
[0017] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0018] The aforementioned head-up display method, device, computer equipment, vehicle, computer-readable storage medium, and computer program product acquire the environmental image corresponding to the vehicle and the first position coordinates corresponding to the head-up display element during the augmented reality head-up display process. Based on the first position coordinates and the environmental image, the road slope of the real road corresponding to the environmental image is determined. This achieves the pre-determination of the road slope ahead through image processing, rendering the head-up display element based on the road slope to obtain the target head-up display element, and displaying the target head-up display element in the display area. By acquiring the environmental image in the real scene and performing image processing, more accurate slope estimation is achieved, thereby making the displayed target head-up display element better fit the road surface and improving the display effect of the augmented reality head-up display function. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a diagram illustrating the application environment of a vehicle head-up display method in one embodiment.
[0021] Figure 2 This is a flowchart illustrating a head-up display method for a vehicle in one embodiment;
[0022] Figure 3 This is a flowchart illustrating step 202 in one embodiment;
[0023] Figure 4 This is a flowchart illustrating step 301 in one embodiment;
[0024] Figure 5 This is a schematic diagram of lane lines in one embodiment;
[0025] Figure 6 This is a flowchart illustrating step 302 in one embodiment;
[0026] Figure 7 This is a flowchart illustrating the spatial point locations in one embodiment;
[0027] Figure 8 This is a flowchart illustrating step 602 in one embodiment;
[0028] Figure 9 This is a flowchart illustrating step 602 in another embodiment;
[0029] Figure 10 This is a flowchart illustrating step 302 in another embodiment;
[0030] Figure 11 This is a flowchart illustrating the steps for determining the target lane line sampling points in one embodiment;
[0031] Figure 12 This is a flowchart illustrating step 201 in one embodiment;
[0032] Figure 13 This is a flowchart illustrating a head-up display method for a vehicle in another embodiment;
[0033] Figure 14 This is a structural block diagram of a vehicle's head-up display device in one embodiment;
[0034] Figure 15 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0036] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0037] The head-up display method for vehicles provided in this application embodiment can be applied to, for example... Figure 1 The application environment shown includes at least a vehicle 101, which may include an image acquisition component 101-1, and may also include an external device 102.
[0038] Vehicle 101 can receive environmental images acquired by image acquisition component 101-1, obtain the first position coordinates corresponding to the head-up display element, determine the road slope corresponding to the environmental image based on the first position coordinates and the environmental image, render the head-up display element based on the road slope to obtain the target head-up display element, and display the target head-up display element in a display area (such as the windshield). The head-up display element can be sent to vehicle 101 via external device 102. External device 102 can send display element information corresponding to the target head-up display element to vehicle 101, and vehicle 101 can calculate the first position coordinates based on the display element information. Vehicle 101 can be configured with a data processing unit that can implement the functions described above. This data processing unit can be a computer device that can run a vehicle infotainment system and / or a vehicle control system. The computer device implements the above functions when running the vehicle infotainment system and / or the vehicle control system. Image acquisition component 101-1 can be a camera that can be connected to vehicle 101. Image acquisition component 101-1 is used to acquire environmental images and send them to vehicle 101.
[0039] External device 102 can be used to send head-up display elements to vehicle 101. External device 102 can be a service provider's server, which can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. External device 102 can also be other components of vehicle 101, such as speed sensors, position sensors, battery management systems, etc.
[0040] In real-world scenarios, when using augmented reality (AR) head-up display (HUD) on vehicles, if the road ahead has a slope (uphill or downhill), the AR display cannot be correctly projected onto the road surface. This results in a poor user experience, where displayed elements appear to be inserted into the ground (uphill) or into the air (downhill). Currently, high-precision map data is generally used to obtain the road slope and adjust the AR display accordingly. However, high-precision maps rely on data from the map provider, cannot be updated in real time, and have low accuracy, affecting the display effect of HUD elements.
[0041] To address this, this application uses environmental images perceived by the vehicle to calculate the road slope in real time and accurately through image processing, and renders the head-up display elements in real time based on the calculated road slope, thereby improving the reliability, adaptability, and accuracy of the head-up display elements.
[0042] In one exemplary embodiment, such as Figure 2 As shown, a head-up display method for vehicles is provided, which is applied to... Figure 1 The following steps, 201 to 203, will be used as an example to illustrate the process.
[0043] Step 201: Obtain the environmental image corresponding to the vehicle and the first position coordinates corresponding to the head-up display element.
[0044] In real-world scenarios, augmented reality head-up display (AR-HUD) devices are becoming increasingly common in vehicles. These devices project data onto the windshield for the driver to view, enabling them to view vehicle data directly on the windshield. This application further renders the head-up display elements using environmental images and their position coordinates, making the elements more closely aligned with the road in the environmental image. During implementation, the vehicle acquires the environmental image and obtains the first position coordinates corresponding to the head-up display elements.
[0045] In this application, head-up display elements refer to various elements displayed on the windshield. These elements can be presented in a patterned manner. The first position coordinates of the head-up display elements can refer to their position coordinates in a spatial coordinate system corresponding to the environmental image. This spatial coordinate system can be established based on spatial data sensed by the vehicle's sensing components. This spatial coordinate system can be a three-dimensional spatial coordinate system, with the position of the sensing components as its origin. The sensing components may include an image acquisition component for the environmental image, and may also include a radar component.
[0046] In practical applications, during the implementation of augmented reality head-up displays (HUDs), the virtual image distance of the HUD element is typically x meters, meaning that from the driver's perspective, the HUD element appears on the road x meters away. To address this, the display position of the HUD element can be called the target point. This target point can be projected onto the spatial coordinate system corresponding to the environmental image to obtain the first position coordinates of the HUD element. Optionally, the spatial coordinate system is established based on the environmental image. Step 201 can be replaced by: acquiring the environmental image corresponding to the vehicle and determining the first position coordinates of the HUD element within the environmental image. Optionally, the environmental image includes at least one lane line; this is because vehicles typically travel on roads with lane lines.
[0047] During the process of obtaining the first position coordinates, the vehicle can receive the display position information of the head-up display element sent by an external device. This display position information may not match the vehicle's coordinate system. The display position information may only include information representing the real position, such as the virtual image distance of the head-up display element and lane information. In response, the vehicle can perform position coordinate calculation based on the display position information to obtain the first position coordinates of the head-up display element in the spatial coordinate system.
[0048] Step 202: Determine the road slope based on the first location coordinates and the environmental image.
[0049] During implementation, after determining the first position coordinates of the head-up display element (target point), the vehicle can determine the road slope at the first position coordinates of the head-up display element based on the position coordinates of reference objects in the environmental image. The road slope refers to the slope of the road at the first position coordinate in the environmental image. The road slope can be represented by an angle, i.e., the angle value of the road at the first position coordinate relative to the slope of a reference flat area. The road slope can also be represented by a slope percentage, i.e., the percentage value of the road at the first position coordinate relative to the slope of a reference flat area. The road slope can be uphill, in which case both the angle and percentage can be positive; or it can be downhill, in which case both the angle and percentage can be negative.
[0050] During execution, the lane lines of the road can be used as a reference. Since the vanishing point of the lane lines is located further away from the first position coordinate, the position coordinates of the vanishing point can be determined. The road slope can then be determined based on the position coordinates of the vanishing point and the first position coordinate. Alternatively, multiple sampling points can be obtained by sampling the environmental image according to a preset distance and direction based on the first position coordinate of the head-up display element (target point). The road slope can then be determined based on the position coordinates of the sampling points, the first position coordinate, and the preset distance. The calculation of the road slope can be based on trigonometric functions. The specific calculation process can use any trigonometric function calculation algorithm available in the prior art, and is not limited here.
[0051] Step 203: Render the head-up display element based on the road slope to obtain the target head-up display element, and then display the target head-up display element.
[0052] During implementation, vehicles can render head-up display elements based on a determined road slope, obtain target head-up display elements that match the road slope, and display the target head-up display elements in the head-up display area.
[0053] During execution, the vehicle can render the target head-up display element itself through the rendering component, or the vehicle can send the road slope and head-up display element to the external rendering device, render it through the external rendering device, receive the target head-up display element, and display the target head-up display element.
[0054] In the above-mentioned vehicle head-up display method, during the augmented reality head-up display process, the environmental image corresponding to the vehicle and the first position coordinates corresponding to the head-up display element are acquired. Based on the first position coordinates and the environmental image, the road slope of the real road corresponding to the environmental image is determined. This realizes the pre-determination of the road slope ahead through image processing. The head-up display element is rendered based on the road slope to obtain the target head-up display element. The target head-up display element is displayed in the display area. By acquiring the environmental image in the real scene and performing image processing, a more accurate slope estimation is achieved, thereby making the displayed target head-up display element better fit the road surface and improving the display effect of the augmented reality head-up display function.
[0055] Based on the above exemplary embodiment, the following provides a method for a vehicle's head-up display in one or more exemplary embodiments, in which the method is applied... Figure 1 Taking the vehicles in the example, the following content will be used as an example.
[0056] In real-world scenarios, lane lines can be used as references to determine road slope. Lane line sampling points can be obtained by sampling along the lane lines included in the environmental image, and the road slope can be determined based on the second position coordinates of the lane line sampling points. In one optional implementation provided in this application, such as... Figure 3 As shown, step 202 includes steps 301 to 302:
[0057] Step 301: Determine the lane line sampling points corresponding to each lane line based on the first position coordinates and the environmental image.
[0058] During implementation, the lane lines included in the vehicle recognition environment image are used to determine the lane line sampling points on the lane lines corresponding to the first position coordinates of the head-up display element, based on the first position coordinates of the head-up display element; furthermore, the second position coordinates of the lane line sampling points in the spatial coordinate system can also be determined.
[0059] In this application, a lane line sampling point refers to a sampling point on a lane line, which is used to calculate the road slope. The number of lane line sampling points is at least one, or two, or more than two.
[0060] During execution, for cases where the environmental image contains only one lane line, such as rural roads, one-way streets, or mountain roads, which are typically narrow, the image acquisition component / radar component can identify the road edge, using the road edge as the lane line. This is then combined with the lane lines in the environmental image to determine the lane line sampling point corresponding to the first position coordinate of the head-up display element, as well as the lane line sampling point corresponding to the first position coordinate of the head-up display element at the road edge. For cases where the environmental image contains two or more lane lines, the lane line sampling point corresponding to the first position coordinate of the head-up display element can be determined.
[0061] Step 302: Determine the road slope based on the second position coordinates of the sampling points for each lane.
[0062] During implementation, the vehicle can calculate the road slope in a spatial coordinate system based on the second position coordinates of each lane line sampling point. During execution, the vehicle can also determine the road slope based on the second and first position coordinates of each lane line sampling point. Step 302 can be replaced with: determining the road slope based on the second and first position coordinates of each lane line sampling point.
[0063] During execution, the vehicle can perform trigonometric function calculations using the second and first position coordinates of the lane line sampling points. Specifically, the tangent angle can be calculated to obtain the road slope at the first position coordinate. Alternatively, the vehicle can also perform trigonometric function calculations based on the elevation difference between each lane line sampling point and the preset sampling distance to obtain the road slope at the first position coordinate.
[0064] One optional implementation provided in this application uses lane lines as a reference to accurately and reliably calculate road slope, thereby improving the reliability and accuracy of road slope calculation and thus enhancing the display effect of the head-up display.
[0065] In determining lane line sampling points, a first straight line can be drawn based on the first position coordinates, and the intersection of the first straight line and the lane line can be used as the lane line sampling point; in one optional implementation provided by this application, such as Figure 4 As shown, step 301 includes steps 401 to 402:
[0066] Step 401: Identify the lane lines included in the environmental image.
[0067] During implementation, the vehicle identifies at least two lane lines in the environmental image using an image recognition algorithm. These lane lines can be represented by equations of straight lines or curves. Step 401 can be: identifying each lane line in the environmental image and obtaining the lane line equation for each lane line. It should be noted that any lane line recognition algorithm in the prior art can be used for this identification, and no limitation is made here.
[0068] Step 402: Determine the intersection of the first straight line where the first position coordinate is located and each lane line as the lane line sampling point.
[0069] During implementation, the vehicle establishes a first straight line at the first position coordinates, and the intersection of the first straight line with each lane line is determined as the lane line sampling point; wherein, the first straight line is parallel to the lower boundary of the environmental image.
[0070] For example, such as Figure 5 As shown, the target point 501 corresponding to the head-up display element is located in the middle of the left lane line 502 and the right lane line 503. The first straight line 504 includes the left lane line sampling point 505 on the left lane line 502 and the right lane line 506 on the right lane line 503.
[0071] One optional implementation provided in this application determines lane line sampling points by using spatial coordinates, which makes the lane line sampling points more reliable as references and thus improves the accuracy of road slope.
[0072] In determining the road slope, tangents can be drawn at the lane line sampling points, and the intersection of the tangents is determined as the lane line vanishing point. The road slope is then determined based on at least one of the lane line vanishing point's position coordinates, a first position coordinate, and the optical center's position coordinates. One optional implementation provided in this application is as follows: Figure 6 As shown, step 302 includes steps 601 to 602:
[0073] Step 601: Determine the lane line tangent at the second position coordinate of each lane line sampling point, and determine the third position coordinate of the lane line vanishing point based on the lane line tangent.
[0074] During implementation, the vehicle calculates the lane line tangent at the lane line sampling point based on the lane line equation and the second position coordinates of the lane line sampling point. The line connecting all lane line tangents is determined as the lane line vanishing point, and the third position coordinates of the lane line vanishing point are determined. The lane line vanishing point is the intersection of all lane line tangents.
[0075] In the process of determining the third position coordinates, the intersection of the lane line tangents can be calculated, and the third position coordinates of the lane line vanishing point can be determined by solving the equation of spatial coordinates; in this embodiment, there can be two lane line sampling points.
[0076] Step 602: Determine the road slope based on the third position coordinates and the optical center position coordinates, or determine the road slope based on the first position coordinates and the third position coordinates.
[0077] During implementation, the vehicle can perform trigonometric function calculations based on the third position coordinates and the optical center position coordinates to obtain the road slope; or, the vehicle can perform trigonometric function calculations based on the first position coordinates and the third position coordinates to obtain the road slope; wherein, the optical center position coordinates are the position coordinates of the optical center of the image acquisition component that acquires environmental images.
[0078] During execution, the vehicle can calculate the third position coordinates and the optical center position coordinates, or the difference between the first position coordinates and the third position coordinates in each direction, project the difference onto the y-axis plane, and calculate the road slope under the first position coordinates on the y-axis plane.
[0079] For example, such as Figure 7 As shown, the target point 701 of the head-up display element and the vanishing point 702 of the lane line are projected onto the y-axis plane, and the road slope can be calculated based on their position coordinates in the plane.
[0080] Alternatively, the road slope can be calculated using an encapsulated algorithm. The third position coordinates and the optical center position coordinates, or the first position coordinates and the third position coordinates, can be input into the road slope calculation algorithm to obtain the road slope output by the algorithm.
[0081] In addition, the road slope can be determined based on the position coordinates of the center point of the environmental image and the third position coordinates. During the execution, the distance from the vanishing point of the lane line to the center of the image can be calculated based on the third position coordinates. The angle between the line connecting the optical center of the forward-looking camera and the vanishing point and the optical axis of the forward-looking camera (which is an inherent parameter of the camera) (the line connecting the optical center and the center of the imaging plane) can be calculated. Since the line connecting the optical center of the forward-looking camera and the vanishing point is parallel to the slope, this angle can be regarded as the angle between the slope and the optical axis of the camera.
[0082] One optional implementation provided in this application obtains the road slope corresponding to the first position coordinate of the head-up display element by solving the coordinates in the spatial coordinate system. The accuracy and reliability of the road slope are improved by spatial calculation, thereby improving the fit between the target head-up display element and the road and improving the imaging effect.
[0083] In real-world scenarios, since the image acquisition angle of a vehicle's image acquisition component is usually not horizontal, the slope can be calculated even for flat ground. Therefore, a reference flat ground slope can be pre-calculated, and the calculated slope can be corrected based on this reference flat ground slope to obtain the road slope. In one optional implementation provided in this application, such as... Figure 8 As shown, step 602 includes step 801:
[0084] Step 801: Calculate the first road slope based on the third position coordinates and the optical center position coordinates, and subtract the reference flat ground slope from the first road slope to obtain the road slope.
[0085] During implementation, the vehicle can calculate the angle from the optical center position coordinates to the third position coordinates, and determine the angle as the first road slope of the first position coordinates. The road slope is obtained by subtracting the reference flat ground slope from the first road slope.
[0086] During the execution process, the calculated road gradient can be a positive value for uphill roads and a negative value for downhill roads.
[0087] In addition, the road slope can also be calculated based on the third location coordinates and the first location coordinates; another optional implementation provided in this application is as follows: Figure 9 As shown, step 602 includes step 901:
[0088] Step 901: Calculate the second road slope based on the third location coordinates and the first location coordinates, and subtract the reference flat ground slope from the second road slope to obtain the road slope.
[0089] During implementation, the vehicle can calculate the angle from the first position coordinate to the third position coordinate, and determine the angle as the second road slope of the first position coordinate. The road slope is obtained by subtracting the reference flat ground slope from the second road slope.
[0090] The two optional implementation methods provided in this application obtain the road slope by subtracting the reference flat ground slope from the calculated road slope through a preset reference flat ground slope method, and obtain the accurate road slope by correcting the slope, thereby improving the reliability of the road slope.
[0091] Alternatively, the road slope of the target point can be calculated by collecting multiple lane line sampling points and using the position coordinates of these points. Another method for determining road slope provided in this application is as follows: Figure 10 As shown, step 302 includes steps 1001 to 1002:
[0092] Step 1001: Determine the elevation difference and horizontal difference between the first position coordinates and the target lane line sampling point based on the first position coordinates and the second position coordinates of the target lane line sampling point.
[0093] During implementation, the vehicle selects a target lane line sampling point from among the lane line sampling points. Based on the first position coordinates and the second position coordinates of the target lane line sampling point, the elevation difference and horizontal difference of the first position coordinates relative to the target lane line sampling point are determined. The target lane line sampling point is the lane line sampling point with the smallest distance from the lower boundary of the environmental image among all lane line sampling points.
[0094] Furthermore, the elevation difference and horizontal difference can be obtained by projection calculation based on the first position coordinates and the second position coordinates of the target lane line sampling point in the y-axis plane.
[0095] Step 1002: Determine the road slope based on the elevation difference and horizontal difference.
[0096] During implementation, the road slope is obtained by dividing the elevation difference by the level difference and converting it to a percentage; the road slope includes a percentage slope value.
[0097] In addition, the slope of each lane sampling point can be calculated, the elevation difference between each sampling point can be calculated based on the slope and the preset sampling distance, the total elevation difference can be calculated based on each elevation difference, and the total horizontal difference can be calculated based on each sampling distance. The road slope is obtained by dividing the total elevation difference by the total horizontal difference and converting it into a percentage.
[0098] For example, sampling is performed from the target point along a preset length d towards the vehicle direction. The slope angle A between the road surface and the horizontal plane is calculated at each sampling point, and the total number of sampling points is recorded as N. The height difference h between each sampling point and the next sampling point is calculated as h = d * tan(A). The h values calculated for all sampling points are added together: H = (h1 + h2 + h3 + … + hN), where H is the elevation difference of the target point and N * d is the horizontal distance of the target point. The percentage slope value of the target point can then be calculated as (H / (N * d)) * 100%.
[0099] One optional implementation method provided in this application is to calculate the road slope by collecting multiple lane line sampling points. By using multiple lane line sampling points, the accuracy of the road slope is improved, thereby improving the display effect of the target head-up element.
[0100] In the process of determining the target lane line sampling point, after determining the first straight line as described above, multiple second straight lines can be determined according to a preset distance. The intersection of each second straight line with the lane line is determined as the lane line sampling point, and the lane line sampling point closest to the lower boundary of the environmental image among all lane line sampling points is determined as the target lane line sampling point; in one optional embodiment provided by this application, such as Figure 11 As shown, the process of determining the target lane line sampling points includes steps 1101 to 1102:
[0101] Step 1101: Identify a plurality of second lines parallel to the first line in the environmental image.
[0102] During implementation, after the vehicle determines the first straight line, multiple second straight lines are drawn towards the lower boundary of the environmental image based on a preset distance. The first straight line includes a first position coordinate and at least two lane line sampling points. The first straight line is parallel to the lower boundary of the environmental image. The distance between two adjacent straight lines among the first straight line and multiple second straight lines is a preset distance.
[0103] During the execution process, the intersection points of each second straight line and the lane line are all lane line sampling points.
[0104] Step 1102: Determine the target second straight line among all the second straight lines, and determine the intersection of the target second straight line and each lane line as the target lane line sampling point.
[0105] During implementation, the vehicle identifies a target second straight line that is closest to the lower boundary of the environmental image among all the second straight lines, and the intersection of the target second straight line with each lane line is determined as the target lane line sampling point. The target second straight line is the second straight line among all the second straight lines that has the smallest distance to the lower boundary of the environmental image.
[0106] One optional implementation provided in this application determines the road slope by identifying multiple lane line sampling points, and then determines the road slope at the first position coordinate by using the target lane line sampling points and the first position coordinates, thereby improving the reliability of the road slope.
[0107] In real-world scenarios, the head-up display elements may include display location information, and the vehicle can determine its first position coordinates using the display location information and the intrinsic and extrinsic parameters of the image acquisition component; in one optional implementation provided in this application, such as Figure 12 As shown, step 201 includes steps 1201 to 1203:
[0108] Step 1201: Acquire environmental images using the image acquisition component.
[0109] During implementation, the vehicle can be equipped with an image acquisition component to acquire environmental images; the environmental images can be images of the road in front of the vehicle.
[0110] Step 1202: Receive the display position information corresponding to the head-up display element input from the external device.
[0111] During implementation, the vehicle receives display location information corresponding to the head-up display elements input from an external device. This external device can be a server for an external service, which can be at least one of a navigation service, an alert service, a music service, or a notification service.
[0112] Step 1203: Determine the first position coordinates based on the displayed position information, the imaging parameters of the image acquisition component, and the installation parameters of the image acquisition component.
[0113] During implementation, the vehicle can convert the display position information into the first position coordinates of the spatial coordinates corresponding to the environmental image based on the imaging parameters and installation parameters of the image acquisition component.
[0114] One optional implementation provided in this application converts the display position information of the head-up display element into the first position coordinate in the spatial coordinate system corresponding to the environmental image by using the intrinsic and extrinsic parameters of the image acquisition component, thereby improving the accuracy and reliability of the coordinate transformation.
[0115] In one embodiment, see Figure 13 The document illustrates a flowchart of a vehicle head-up display method according to an embodiment of this application. This vehicle head-up display method can be applied to... Figure 1 In the vehicles shown. For example... Figure 13 As shown, the head-up display method for this vehicle may include the following steps:
[0116] Step 1301: Acquire environmental images through the image acquisition component and receive display position information corresponding to the head-up display elements input from external devices.
[0117] Step 1302: Determine the first position coordinates corresponding to the head-up display element based on the display position information, the imaging parameters of the image acquisition component, and the installation parameters of the image acquisition component.
[0118] Step 1303: Identify the lane lines included in the environmental image.
[0119] Step 1304: Determine the intersection of the first straight line where the first position coordinate is located and each lane line as the lane line sampling point.
[0120] Step 1305: Determine the lane line tangent at the second position coordinate of each lane line sampling point, and determine the third position coordinate of the lane line vanishing point based on the lane line tangent.
[0121] Step 1306: Determine the first road slope based on the first and third location coordinates.
[0122] Step 1307: Obtain the road slope by subtracting the reference flat ground slope from the first road slope.
[0123] Step 1308: Render the head-up display element based on the road slope to obtain the target head-up display element, and display the target head-up display element.
[0124] It should be noted that any one or more of steps 1301 to 1308 can be combined to form a new implementation method according to the needs of implementation and deployment. Furthermore, any one or more technical features in the technical solution composed of steps 1301 to 1308 can also be combined to form a new implementation method according to the actual deployment needs, or technical features in one or more optional implementation methods provided by one or more of the above embodiments can be combined to form a new implementation method. These will not be elaborated on here.
[0125] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0126] Based on the same inventive concept, this application also provides a head-up display device for implementing the above-described vehicle head-up display method. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations of one or more vehicle head-up display device embodiments provided below can be found in the limitations of the vehicle head-up display method described above, and will not be repeated here.
[0127] In one exemplary embodiment, such as Figure 14 As shown, a head-up display device for a vehicle is provided, including: an acquisition module 1401, a slope determination module 1402, and a rendering module 1403, wherein: the acquisition module 1401 is used to acquire an environmental image corresponding to the vehicle and a first position coordinate corresponding to the head-up display element; the slope determination module 1402 is used to determine the road slope based on the first position coordinate and the environmental image; and the rendering module 1403 is used to render the head-up display element based on the road slope to obtain a target head-up display element and display the target head-up display element.
[0128] In one embodiment, the slope determination module 1402 includes a first sampling point determination unit and a first slope determination unit, wherein: the first sampling point determination unit is used to determine lane line sampling points corresponding to each lane line based on the first position coordinates and the environmental image; the first slope determination unit is used to determine the road slope based on the second position coordinates of each lane line sampling point.
[0129] In one embodiment, the first slope determination unit includes a vanishing point determination unit and a second slope determination unit, wherein: the vanishing point determination unit is used to determine the lane line tangent at the second position coordinate of each lane line sampling point, and determine the third position coordinate of the lane line vanishing point based on the lane line tangent; the second slope determination unit is used to determine the road slope based on the third position coordinate and the optical center position coordinate, or, based on the first position coordinate and the third position coordinate.
[0130] In one embodiment, the second slope determination unit includes a third slope determination unit or a fourth slope determination unit, wherein: the third slope determination unit is used to calculate the first road slope based on the third position coordinates and the optical center position coordinates, and to obtain the road slope by subtracting the reference flat ground slope from the first road slope; the fourth slope determination unit is used to calculate the second road slope based on the third position coordinates and the first position coordinates, and to obtain the road slope by subtracting the reference flat ground slope from the second road slope.
[0131] In one embodiment, the first slope determination unit further includes a data determination unit and a slope value determination unit, wherein: the data determination unit is used to determine the elevation difference and horizontal difference of the first position coordinates relative to the target lane line sampling point based on the first position coordinates and the second position coordinates of the target lane line sampling point; the slope value determination unit is used to determine the road slope based on the elevation difference and horizontal difference.
[0132] In one embodiment, the apparatus further includes a line determination unit and a line selection unit, wherein: the line determination unit is used to determine a plurality of second lines parallel to the first line in the environmental image; the line selection unit is used to determine a target second line among the second lines and determine the intersection of the target second line with each lane line as the target lane line sampling point.
[0133] In one embodiment, the first sampling point determination unit includes an identification unit and a second sampling point determination unit, wherein: the identification unit is used to identify each lane line included in the environmental image; the second sampling point determination unit is used to determine the intersection of the first straight line where the first position coordinate is located and each lane line as a lane line sampling point, and the first straight line is parallel to the lower boundary of the environmental image.
[0134] In one embodiment, the acquisition module 1401 includes an image acquisition unit, an information receiving unit, and a coordinate calculation unit, wherein: the image acquisition unit is used to acquire environmental images through an image acquisition component; the information receiving unit is used to receive display position information corresponding to the head-up display element input by an external device; and the coordinate calculation unit is used to determine the first position coordinates based on the display position information, the imaging parameters of the image acquisition component, and the installation parameters of the image acquisition component.
[0135] The various modules in the head-up display device of the aforementioned vehicle can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0136] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 15 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores vehicle head-up display data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a vehicle head-up display method.
[0137] Those skilled in the art will understand that Figure 15 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0138] In one exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: acquiring an environmental image corresponding to a vehicle and first position coordinates corresponding to a head-up display element; determining a road slope based on the first position coordinates and the environmental image; rendering the head-up display element based on the road slope to obtain a target head-up display element, and displaying the target head-up display element.
[0139] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining lane line sampling points corresponding to each lane line based on the first location coordinates and the environmental image; and determining the road slope based on the second location coordinates of each lane line sampling point.
[0140] In one embodiment, when the processor executes the computer program, it further implements the following steps: determining the lane line tangent at the second position coordinate of each lane line sampling point; determining the third position coordinate of the lane line vanishing point based on the lane line tangent, wherein the lane line vanishing point is the intersection of the lane line tangents; determining the road slope based on the third position coordinate and the optical center position coordinate, or determining the road slope based on the first position coordinate and the third position coordinate, wherein the optical center position coordinate is the position coordinate of the optical center of the image acquisition component that acquires the environmental image.
[0141] In one embodiment, when the processor executes the computer program, it also performs the following steps: calculating the first road slope based on the third location coordinates and the optical center location coordinates, and subtracting the reference flat ground slope from the first road slope to obtain the road slope.
[0142] In one embodiment, when the processor executes the computer program, it further performs the following steps: calculating the second road slope based on the third location coordinates and the first location coordinates, and obtaining the road slope by subtracting the reference flat ground slope from the second road slope.
[0143] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining the elevation difference and horizontal difference between the first position coordinates and the target lane line sampling point based on the first position coordinates and the second position coordinates of the target lane line sampling point, wherein the target lane line sampling point is the lane line sampling point with the smallest distance from the lower boundary of the environment image among all lane line sampling points; and determining the road slope based on the elevation difference and horizontal difference, wherein the road slope includes a percentage slope value.
[0144] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining a plurality of second straight lines parallel to a first straight line in an environmental image, wherein the first straight line includes a first position coordinate and at least two lane line sampling points, the first straight line is parallel to the lower boundary of the environmental image, and the distance between the first straight line and any two adjacent straight lines among the plurality of second straight lines is a preset distance; determining a target second straight line among each second straight line, and determining the intersection of the target second straight line and each lane line as a target lane line sampling point, wherein the target second straight line is the second straight line among the second straight lines with the smallest distance to the lower boundary of the environmental image.
[0145] In one embodiment, when the processor executes the computer program, it further performs the following steps: identifying lane lines included in the environmental image; determining the intersection of a first straight line where the first position coordinate is located and each lane line as a lane line sampling point, wherein the first straight line is parallel to the lower boundary of the environmental image.
[0146] In one embodiment, when the processor executes the computer program, it further performs the following steps: acquiring an environmental image through an image acquisition component; receiving display position information corresponding to a head-up display element input from an external device; and determining the first position coordinates based on the display position information, the imaging parameters of the image acquisition component, and the installation parameters of the image acquisition component.
[0147] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon. When the computer program is executed by a processor, it performs the following steps: acquiring an environmental image corresponding to the vehicle and first position coordinates corresponding to a head-up display element; determining the road slope based on the first position coordinates and the environmental image; rendering the head-up display element based on the road slope to obtain a target head-up display element, and displaying the target head-up display element.
[0148] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining lane line sampling points corresponding to each lane line based on the first location coordinates and the environmental image; and determining the road slope based on the second location coordinates of each lane line sampling point.
[0149] In one embodiment, when the processor executes the computer program, it further implements the following steps: determining the lane line tangent at the second position coordinate of each lane line sampling point; determining the third position coordinate of the lane line vanishing point based on the lane line tangent, wherein the lane line vanishing point is the intersection of the lane line tangents; determining the road slope based on the third position coordinate and the optical center position coordinate, or determining the road slope based on the first position coordinate and the third position coordinate, wherein the optical center position coordinate is the position coordinate of the optical center of the image acquisition component that acquires the environmental image.
[0150] In one embodiment, when the processor executes the computer program, it also performs the following steps: calculating the first road slope based on the third location coordinates and the optical center location coordinates, and subtracting the reference flat ground slope from the first road slope to obtain the road slope.
[0151] In one embodiment, when the processor executes the computer program, it further performs the following steps: calculating the second road slope based on the third location coordinates and the first location coordinates, and obtaining the road slope by subtracting the reference flat ground slope from the second road slope.
[0152] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining the elevation difference and horizontal difference between the first position coordinates and the target lane line sampling point based on the first position coordinates and the second position coordinates of the target lane line sampling point, wherein the target lane line sampling point is the lane line sampling point with the smallest distance from the lower boundary of the environment image among all lane line sampling points; and determining the road slope based on the elevation difference and horizontal difference, wherein the road slope includes a percentage slope value.
[0153] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining a plurality of second straight lines parallel to a first straight line in an environmental image, wherein the first straight line includes a first position coordinate and at least two lane line sampling points, the first straight line is parallel to the lower boundary of the environmental image, and the distance between the first straight line and any two adjacent straight lines among the plurality of second straight lines is a preset distance; determining a target second straight line among each second straight line, and determining the intersection of the target second straight line and each lane line as a target lane line sampling point, wherein the target second straight line is the second straight line among the second straight lines with the smallest distance to the lower boundary of the environmental image.
[0154] In one embodiment, when the processor executes the computer program, it further performs the following steps: identifying lane lines included in the environmental image; determining the intersection of a first straight line where the first position coordinate is located and each lane line as a lane line sampling point, wherein the first straight line is parallel to the lower boundary of the environmental image.
[0155] In one embodiment, when the processor executes the computer program, it further performs the following steps: acquiring an environmental image through an image acquisition component; receiving display position information corresponding to a head-up display element input from an external device; and determining the first position coordinates based on the display position information, the imaging parameters of the image acquisition component, and the installation parameters of the image acquisition component.
[0156] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: acquiring an environmental image corresponding to a vehicle and first position coordinates corresponding to a head-up display element; determining a road slope based on the first position coordinates and the environmental image; rendering the head-up display element based on the road slope to obtain a target head-up display element, and displaying the target head-up display element.
[0157] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining lane line sampling points corresponding to each lane line based on the first location coordinates and the environmental image; and determining the road slope based on the second location coordinates of each lane line sampling point.
[0158] In one embodiment, when the processor executes the computer program, it further implements the following steps: determining the lane line tangent at the second position coordinate of each lane line sampling point; determining the third position coordinate of the lane line vanishing point based on the lane line tangent, wherein the lane line vanishing point is the intersection of the lane line tangents; determining the road slope based on the third position coordinate and the optical center position coordinate, or determining the road slope based on the first position coordinate and the third position coordinate, wherein the optical center position coordinate is the position coordinate of the optical center of the image acquisition component that acquires the environmental image.
[0159] In one embodiment, when the processor executes the computer program, it also performs the following steps: calculating the first road slope based on the third location coordinates and the optical center location coordinates, and subtracting the reference flat ground slope from the first road slope to obtain the road slope.
[0160] In one embodiment, when the processor executes the computer program, it further performs the following steps: calculating the second road slope based on the third location coordinates and the first location coordinates, and obtaining the road slope by subtracting the reference flat ground slope from the second road slope.
[0161] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining the elevation difference and horizontal difference between the first position coordinates and the target lane line sampling point based on the first position coordinates and the second position coordinates of the target lane line sampling point, wherein the target lane line sampling point is the lane line sampling point with the smallest distance from the lower boundary of the environment image among all lane line sampling points; and determining the road slope based on the elevation difference and horizontal difference, wherein the road slope includes a percentage slope value.
[0162] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining a plurality of second straight lines parallel to a first straight line in an environmental image, wherein the first straight line includes a first position coordinate and at least two lane line sampling points, the first straight line is parallel to the lower boundary of the environmental image, and the distance between the first straight line and any two adjacent straight lines among the plurality of second straight lines is a preset distance; determining a target second straight line among each second straight line, and determining the intersection of the target second straight line and each lane line as a target lane line sampling point, wherein the target second straight line is the second straight line among the second straight lines with the smallest distance to the lower boundary of the environmental image.
[0163] In one embodiment, when the processor executes the computer program, it further performs the following steps: identifying lane lines included in the environmental image; determining the intersection of a first straight line where the first position coordinate is located and each lane line as a lane line sampling point, wherein the first straight line is parallel to the lower boundary of the environmental image.
[0164] In one embodiment, when the processor executes the computer program, it further performs the following steps: acquiring an environmental image through an image acquisition component; receiving display position information corresponding to a head-up display element input from an external device; and determining the first position coordinates based on the display position information, the imaging parameters of the image acquisition component, and the installation parameters of the image acquisition component.
[0165] In one embodiment, a vehicle is provided, the vehicle being configured with a processor and a memory, the memory storing a computer program that, when executed by the processor, implements the steps of one or more embodiments corresponding to the head-up display method for a vehicle described above.
[0166] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0167] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0168] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0169] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for a vehicle head-up display, characterized in that, The method includes: Obtain the environmental image corresponding to the vehicle and the first position coordinates corresponding to the head-up display element; The road slope is determined based on the first location coordinates and the environmental image; The target head-up display element is obtained by rendering the head-up display element based on the road slope, and then the target head-up display element is displayed.
2. The method according to claim 1, characterized in that, The environmental image includes at least one lane line, and determining the road slope based on the first location coordinates and the environmental image includes: Based on the first location coordinates and the environmental image, determine the lane line sampling points corresponding to each lane line; The road slope is determined based on the second position coordinates of each lane line sampling point.
3. The method according to claim 2, characterized in that, Determining the road slope based on the second position coordinates of each lane line sampling point includes: Determine the lane line tangent at the second position coordinate of each lane line sampling point, and determine the third position coordinate of the lane line vanishing point based on each lane line tangent, wherein the lane line vanishing point is the intersection of each lane line tangent. The road slope is determined based on the third position coordinates and the optical center position coordinates, or the road slope is determined based on the first position coordinates and the third position coordinates, wherein the optical center position coordinates are the position coordinates of the optical center of the image acquisition component that acquires the environmental image.
4. The method according to claim 3, characterized in that, Determining the road slope based on the third location coordinates and the optical center location coordinates includes: The first road slope is calculated based on the third location coordinates and the optical center location coordinates. The road slope is obtained by subtracting the reference flat ground slope from the first road slope. Determining the road slope based on the first location coordinates and the third location coordinates includes: Alternatively, the second road slope can be calculated based on the third location coordinates and the first location coordinates, and the road slope can be obtained by subtracting the reference flat ground slope from the second road slope.
5. The method according to claim 2, characterized in that, Determining the road slope based on the second position coordinates of each lane line sampling point includes: Based on the first position coordinates and the second position coordinates of the target lane line sampling point, the elevation difference and horizontal difference of the first position coordinates relative to the target lane line sampling point are determined. The target lane line sampling point is the lane line sampling point with the smallest distance from the lower boundary of the environment image among all the lane line sampling points. The road slope is determined based on the elevation difference and the horizontal difference, and the road slope includes a percentage slope value.
6. The method according to claim 5, characterized in that, The process of determining the target lane line sampling points includes: In the environmental image, a plurality of second straight lines parallel to a first straight line are determined. The first straight line includes the first position coordinates and at least two lane line sampling points. The first straight line is parallel to the lower boundary of the environmental image. The distance between the first straight line and any two adjacent straight lines among the plurality of second straight lines is a preset distance. A target second line is determined among each of the second lines, and the intersection of the target second line with each of the lane lines is determined as the target lane line sampling point. The target second line is the second line among the second lines that has the smallest distance to the lower boundary of the environment image.
7. The method according to claim 2, characterized in that, The step of determining the lane line sampling points corresponding to each lane line based on the first location coordinates and the environmental image includes: Identify each lane line included in the environmental image; The intersection of the first straight line where the first position coordinates are located and each of the lane lines is determined as the lane line sampling point, and the first straight line is parallel to the lower boundary of the environmental image.
8. The method according to claim 1, characterized in that, The step of obtaining the environmental image corresponding to the vehicle and the first position coordinates corresponding to the head-up display element includes: The environmental image is acquired using an image acquisition component; Receive the display position information corresponding to the head-up display element input from an external device; The coordinates of the first position are determined based on the displayed position information, the imaging parameters of the image acquisition component, and the installation parameters of the image acquisition component.
9. A head-up display device for a vehicle, characterized in that, The device includes: The acquisition module is used to acquire the environmental image corresponding to the vehicle and the first position coordinates corresponding to the head-up display element; A slope determination module is used to determine the road slope based on the first location coordinates and the environmental image; The rendering module is used to render the head-up display element based on the road slope to obtain the target head-up display element, and to display the target head-up display element.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
11. A vehicle comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.