Image generation method, apparatus, storage medium, and device
By acquiring vehicle status and time information, dynamically determining the highlight angle, and adjusting the highlight intensity in combination with ambient brightness, a target image is generated. This solves the problem of unrealistic image display in existing technologies and achieves a higher level of liquid glass effect and realism.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XG TECHNOLOGIES PTE LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, the image display effect based on determining the highlight angle using gyroscopes and virtual light sources is poor and difficult to integrate with the real environment, resulting in an unrealistic liquid glass effect.
By acquiring the vehicle's current status information and time, the angle information of the sun in the first coordinate system is determined. Combined with the normal vector of the vehicle screen, the highlight angle is dynamically determined, and the target image is generated based on the highlight angle and source image data. The highlight intensity is dynamically adjusted considering the ambient brightness.
It improves the realism of the liquid glass effect in images, enhances the three-dimensionality and realism of image display, and solves the problem of virtual light sources being difficult to integrate with the real environment.
Smart Images

Figure CN122176108A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to vehicle imaging technology, and in particular to an image generation method, apparatus, storage medium, and device. Background Technology
[0002] In HMI (Human Machine Interface) scenarios, to enhance the 3D effect of HMI windows or controls, images with a liquid glass effect can be generated using liquid glass algorithms. Key technical aspects of the liquid glass effect include specular rendering. However, related technologies typically rely on gyroscopes and virtual light sources to determine the specular angle, resulting in poor image display quality. Summary of the Invention
[0003] This disclosure provides an image generation method, apparatus, storage medium, and device to make the liquid glass effect of the image more consistent with the real environment, improve the realism of the liquid glass effect, and thus improve the image display effect.
[0004] A first aspect of this disclosure provides an image generation method, comprising: acquiring current vehicle status information of a vehicle; determining a first angle of the sun in a first coordinate system based on the current vehicle status information and the current time; determining a current highlight angle based on the first angle information and the normal vector of the plane where the vehicle screen is located; and generating a target image based on the current highlight angle and source image data.
[0005] A second aspect of this disclosure provides an image generation apparatus, comprising: an acquisition module for acquiring current vehicle status information of a vehicle; a first processing module for determining a first angle of the sun in a first coordinate system based on the current vehicle status information and the current time; a second processing module for determining a current highlight angle based on the first angle information and the normal vector of the plane where the vehicle screen is located; and a third processing module for generating a target image based on the current highlight angle and source image data.
[0006] A third aspect of this disclosure is to provide a computer-readable storage medium storing a computer program that is executed by a processor to perform the image generation method described in any of the above embodiments of this disclosure.
[0007] A fourth aspect of this disclosure provides an electronic device, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory, the processor executing the executable instructions to implement the image generation method described in any of the above embodiments of this disclosure.
[0008] A fifth aspect of this disclosure provides a computer program product that, when instructions in the computer program product are executed by a processor, performs the image generation method provided in any of the above embodiments of this disclosure.
[0009] The image generation method, apparatus, storage medium, and device provided in the above embodiments of this disclosure can acquire the current vehicle status information of a vehicle; determine the first angle information of the sun in a first coordinate system based on the current vehicle status information and the current time; determine the current highlight angle based on the first angle information and the normal vector of the plane where the vehicle screen is located; and generate a target image based on the current highlight angle and source image data. It can be seen that the image generation method of this disclosure can dynamically determine the real-time highlight angle according to the real-time angle information of the sun and the plane where the vehicle screen is located, for highlight rendering to generate a target image. This makes the liquid glass effect of the target image more consistent with the highlight angle of the real environment inside the vehicle, improving the realism of the liquid glass effect and thus improving the image display effect. This solves the problem in related technologies where the use of virtual light sources to determine the highlight angle is difficult to integrate with the real environment, resulting in poor image display effects. Attached Figure Description
[0010] Figure 1 This is an exemplary application scenario of the image generation method provided in this disclosure;
[0011] Figure 2 This is a schematic flowchart of an image generation method provided in an exemplary embodiment of this disclosure;
[0012] Figure 3 This is a flowchart illustrating an image generation method provided in another exemplary embodiment of this disclosure;
[0013] Figure 4 This is a schematic diagram illustrating the relationship between highlight intensity and ambient brightness provided in an exemplary embodiment of this disclosure;
[0014] Figure 5 This is a schematic flowchart of an image generation method provided in yet another exemplary embodiment of this disclosure;
[0015] Figure 6 This is a schematic diagram illustrating the principle of determining first angle information provided in an exemplary embodiment of this disclosure;
[0016] Figure 7 This is a schematic flowchart of an image generation method provided in yet another exemplary embodiment of this disclosure;
[0017] Figure 8 This is a schematic diagram illustrating the principle of determining the second yaw angle provided in an exemplary embodiment of this disclosure;
[0018] Figure 9This is a schematic diagram of the liquid glass effect provided in an exemplary embodiment of the present disclosure;
[0019] Figure 10 This is a schematic diagram of the structure of an image generation apparatus provided in an exemplary embodiment of the present disclosure;
[0020] Figure 11 This is a schematic diagram of the structure of an image generation apparatus provided in another exemplary embodiment of the present disclosure;
[0021] Figure 12 This is a schematic diagram of the structure of an image generation apparatus provided in yet another exemplary embodiment of the present disclosure;
[0022] Figure 13 This is a schematic diagram of the structure of an image generation apparatus provided in yet another exemplary embodiment of this disclosure;
[0023] Figure 14 This is a schematic diagram of the structure of an image generation apparatus provided in yet another exemplary embodiment of the present disclosure;
[0024] Figure 15 This is a structural diagram of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0025] To explain this disclosure, exemplary embodiments of the disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the disclosure, and not all of them. It should be understood that the disclosure is not limited to exemplary embodiments.
[0026] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this disclosure.
[0027] Application Overview
[0028] In developing this disclosure, the inventors discovered that in HMI (Human Machine Interface) scenarios, to enhance the stereoscopic effect of HMI windows or controls, images with a liquid glass effect can be generated using a liquid glass algorithm. The key technical aspect of the liquid glass effect includes specular rendering. In related technologies, specular angles are typically determined based on gyroscopes and virtual light sources, resulting in poor image display quality.
[0029] Exemplary Overview
[0030] Figure 1 This is an exemplary application scenario of the image generation method provided in this disclosure. For example... Figure 1As shown, in an intelligent driving scenario, if a vehicle 11 needs to display an image on its in-vehicle screen while driving on the road or stationary, such as displaying various application pages, the image generation method disclosed herein can be used to generate a target image to be displayed, and then display the target image on the in-vehicle screen. Specifically, the current vehicle status information of the vehicle 11 can be obtained; based on the current vehicle status information and the current time, the first angle information of the sun 12 in the first coordinate system can be determined; based on the first angle information and the normal vector of the plane where the in-vehicle screen is located, the current highlight angle can be determined; and based on the current highlight angle and the source image data, the target image can be generated.
[0031] The image generation method disclosed herein can dynamically determine the real-time highlight angle based on the real-time angle information of the sun and the plane where the vehicle screen is located, and use it for highlight rendering to generate the target image. This makes the liquid glass effect of the target image more consistent with the highlight angle of the real environment inside the vehicle, improves the realism of the liquid glass effect of the image, and thus improves the image display effect. This solves the problem in related technologies where the use of virtual light sources to determine the highlight angle is difficult to integrate with the real environment, resulting in poor image display effect.
[0032] Exemplary methods
[0033] Figure 2 This is a schematic flowchart of an exemplary embodiment of the image generation method provided in this disclosure. The embodiments of this disclosure can be applied to electronic devices, chips, or hardware applied to electronic devices or chips. The electronic devices include, but are not limited to, in-vehicle computing platforms (or in-vehicle terminals), and the chips include, for example, intelligent driving chips, intelligent cockpit chips, and integrated cockpit-driver chips on in-vehicle terminals. Figure 2 As shown, the image generation method of this disclosure may include the following steps:
[0034] Step 210: Obtain the current vehicle status information.
[0035] The current vehicle state information refers to the vehicle's state at the current moment. This information may include the vehicle's pose information in a global coordinate system, encompassing both position and orientation (or orientation). The global coordinate system could be, for example, the world coordinate system or the vehicle's own coordinate system (or vehicle coordinate system) at the initial moment. The current vehicle state information can be obtained based on the vehicle's positioning module, such as using one or more of GPS (Global Positioning System), BeiDou, or IMU (Inertial Measurement Unit). This disclosure does not limit the method used to determine the current vehicle state information.
[0036] Step 220: Based on the current vehicle status information and the current time, determine the first angle information of the sun in the first coordinate system.
[0037] The first coordinate system can be either the world coordinate system or the vehicle coordinate system, and conversion between the two is possible. The current time can be the vehicle's system time. The first angle information is the angle of the sun relative to the vehicle in the first coordinate system. The first angle information can include the pitch angle (or first pitch angle) and the yaw angle (or first yaw angle).
[0038] In some optional embodiments, the first angle information of the sun in the first coordinate system can be determined based on the current vehicle status information and the current time using a pre-configured calculation algorithm.
[0039] Step 230: Determine the current specular angle based on the first angle information and the normal vector of the plane where the vehicle screen is located.
[0040] The first angle information represents the pitch and yaw angles of sunlight relative to the vehicle, and the normal vector of the plane containing the vehicle screen represents the orientation of the screen. Based on the first angle information and the normal vector of the plane containing the screen, the direction of sunlight incident on the screen can be determined, and the current highlight angle can be determined based on this direction. The current highlight angle can be the yaw angle of sunlight relative to the screen. For example, if the direction perpendicular to the bottom edge of the screen and pointing from the bottom edge to the top edge is defined as 0 degrees, the current highlight angle is the yaw angle relative to this 0-degree direction.
[0041] Step 240: Generate the target image based on the current highlight angle and source image data.
[0042] The source image data is the image data required for rendering. For example, in 3D scene rendering, the source image data includes, but is not limited to, textures of various objects in the 3D scene. As another example, in application rendering, the source image data includes, but is not limited to, video frames or page data from various applications (APPs). Based on the current specular angle and the source image data, the target image is generated through rendering.
[0043] The current highlight angle determines the location where the light falls on the interface elements of the in-vehicle screen, that is, where the highlight area appears on the interface elements such as buttons, cards, and icons, such as highlighting the top edge, side, or upper left corner of the button.
[0044] Optionally, based on the current specular angle and source image data, the rendering engine can be invoked to generate a target image, enabling the portion of the target image corresponding to the current specular angle to display highlights, thereby enhancing the realism of the liquid glass effect. Optionally, during the rendering process, a preset specular intensity can be used, or a specular intensity dynamically determined based on ambient brightness can be used.
[0045] The image generation method provided in this disclosure can acquire the current vehicle status information; determine the first angle information of the sun in the first coordinate system based on the current vehicle status information and the current time; determine the current highlight angle based on the first angle information and the normal vector of the plane where the vehicle screen is located; and generate a target image based on the current highlight angle and source image data. It can be seen that the image generation method of this disclosure can dynamically determine the real-time highlight angle according to the real-time angle information of the sun and the plane where the vehicle screen is located, and use this information for highlight rendering to generate the target image. This makes the liquid glass effect of the target image more consistent with the highlight angle of the real environment inside the vehicle, improving the realism of the liquid glass effect and thus improving the image display effect. This solves the problem in related technologies where the use of virtual light sources to determine the highlight angle is difficult to integrate with the real environment, resulting in poor image display effects.
[0046] Figure 3 This is a flowchart illustrating an image generation method provided in another exemplary embodiment of this disclosure.
[0047] In some alternative embodiments, in the above... Figure 2 Based on the illustrated embodiments, as Figure 3 As shown, the method in this embodiment of the disclosure may further include:
[0048] Step 310: Obtain the current ambient brightness information inside the vehicle.
[0049] Among them, the current ambient brightness information indicates the current level of brightness inside the vehicle.
[0050] Alternatively, the current ambient brightness information can be obtained through a light sensor on the vehicle or other devices that collect ambient brightness data. For example, the current ambient brightness information may include a brightness value. A higher brightness value indicates brighter light, and a lower brightness value indicates darker light.
[0051] Step 320: Determine the current specular intensity based on the current ambient brightness information.
[0052] Among them, the current specular intensity is used to control the brightness of reflections during specular rendering, which can directly affect the sharpness and transparency of the liquid glass effect (or glass texture).
[0053] Optionally, the current highlight intensity can be determined based on the current ambient brightness information using a preset mapping rule. The preset mapping rule maps ambient brightness to highlight intensity. The preset mapping rule can be set based on the principle that higher ambient brightness results in higher highlight intensity, and lower ambient brightness results in lower highlight intensity. Optionally, the preset mapping rule can be implemented based on one or more of the following: mapping function, lookup table, etc.
[0054] Step 240, which generates the target image based on the current highlight angle and source image data, includes:
[0055] Step 2401: Generate the target image based on the current highlight angle, current highlight intensity, and source image data.
[0056] The current highlight angle determines where the highlight area appears on the interface elements of the target image, and the current highlight intensity controls the brightness of the reflection. Based on the current highlight angle and current highlight intensity, the source image data is rendered to generate the target image, making the brightness of the reflection in the highlight area of the target image more consistent with the current real environment, and further improving the realism of the liquid glass effect of the target image.
[0057] Optionally, the target image can be obtained by calling the rendering engine based on the current specular angle, current specular intensity, and source image data.
[0058] In the embodiments of this disclosure, the current highlight intensity is further dynamically determined based on the current ambient brightness to control the brightness of the reflection in the highlight area. Then, based on the current highlight angle and the current highlight intensity, the source image data is rendered to generate a target image, so that the highlight area and the brightness of the reflection in the highlight area of the target image are more in line with the real-time environmental conditions, further improving the realism of the liquid glass effect of the target image.
[0059] In some optional embodiments, step 320, determining the current specular intensity based on the current ambient brightness information, includes:
[0060] The current highlight intensity is determined based on the current ambient brightness information, the pre-configured highlight intensity range, and the highlight intensity calculation function.
[0061] The highlight intensity range is a preset constraint range for highlight intensity, used to limit the highlight intensity within this range to prevent it from being too high or too low. The highlight intensity range can be determined based on experience or through debugging. The highlight intensity calculation function is a mapping function from ambient brightness to highlight intensity.
[0062] Figure 4 This is a schematic diagram illustrating the relationship between highlight intensity and ambient brightness, provided in an exemplary embodiment of this disclosure. Figure 4 As shown, This represents the minimum value in the range of highlight intensity. This represents the maximum value within the highlight intensity range, i.e., the highlight intensity range is [ ], This represents the first ambient brightness threshold. This represents the second ambient light threshold. When the ambient light is less than... At that time, the highlight intensity was When the ambient brightness is greater than a first ambient brightness threshold but less than a second ambient brightness threshold, the highlight intensity increases with increasing ambient brightness; when the ambient brightness is greater than the second ambient brightness threshold, the highlight intensity remains constant. Optionally, the first ambient light threshold and the second ambient light threshold can be set in advance based on experience or debugging.
[0063] In some optional examples, the specular intensity calculation function can be expressed as follows:
[0064] Formula (1)
[0065] in, This represents the minimum value in the range of highlight intensity. This represents the maximum value within the highlight intensity range, i.e., the highlight intensity range is [ ], For ambient brightness, As a variable, This represents the first ambient brightness threshold. This indicates the second ambient brightness threshold. Indicates based on ambient brightness The calculated specular intensity. This represents the clamping function, which will... The clamping is within the [0,1] interval. Substitute the current ambient brightness from the current ambient brightness information into formula (1). The current highlight intensity is calculated using a formula. It can be seen that the highlight intensity... yes[ Values within the range.
[0066] Formula (1) is only one example of the specular intensity calculation function. In practical applications, the specular intensity calculation function is not limited to that shown in Formula (1).
[0067] In the embodiments of this disclosure, the real-time current highlight intensity is calculated by using a pre-configured highlight intensity range and highlight intensity calculation function, so that the real-time highlight intensity is constrained within the highlight intensity range, avoiding excessively high or low highlight intensity from affecting the image's appearance, and ensuring the image display effect in dark or overly bright environments.
[0068] Figure 5This is a schematic flowchart of an image generation method provided in another exemplary embodiment of the present disclosure.
[0069] In some alternative embodiments, based on any of the above embodiments, the first coordinate system is a vehicle coordinate system. For example... Figure 5 As shown, in step 220, based on the current vehicle status information and the current time, the first angle information of the sun in the first coordinate system is determined, including:
[0070] Step 2210: Based on the current vehicle position and current time in the current vehicle status information, determine the second angle information of the sun using the solar angle calculation model.
[0071] The current vehicle position is the vehicle's location in the world coordinate system. The second angle information includes the sun's elevation angle relative to the horizontal plane and its yaw angle relative to a preset direction. The solar angle calculation model is a pre-configured model for calculating the sun's true angle. The second angle information is the angle information in the global coordinate system, where the preset direction is, for example, but not limited to, true north in the world coordinate system (i.e., true north is 0 degrees). The sun's elevation angle relative to the horizontal plane is the angle between the sun's rays hitting the current vehicle position and the ground plane. The sun's yaw angle relative to the preset direction is the angle between the projection line of the sun's rays hitting the current vehicle position onto the horizontal plane and the preset direction. By inputting the current vehicle position and current time into the solar angle calculation model, the second angle information of the sun is calculated.
[0072] Step 2220: Convert the second angle information to the vehicle coordinate system to obtain the first angle information.
[0073] Specifically, based on the current vehicle pose or attitude from the current vehicle status information, the second angle information can be transformed into the vehicle coordinate system to obtain the first angle information, which is the angle information in the vehicle coordinate system. The current vehicle pose determines the transformation relationship between the vehicle coordinate system and the world coordinate system. Based on this transformation relationship, the second angle information is transformed into the vehicle coordinate system to obtain the first angle information.
[0074] In the embodiments of this disclosure, the real-time second angle information of the sun in the world coordinate system is calculated by calling the solar angle calculation model, and then the second angle information is converted to the vehicle coordinate system to obtain the first angle information, which is used to determine the highlight angle, thereby ensuring that the highlight angle conforms to the angle under the real sunlight.
[0075] In some optional embodiments, step 2220, converting the second angle information to the vehicle coordinate system to obtain the first angle information, includes:
[0076] The pitch angle of the sun relative to the horizontal plane is determined as the first pitch angle of the sun in the vehicle coordinate system; based on the pre-configured yaw angle mapping function, the yaw angle of the sun relative to the preset direction is mapped as the first yaw angle in the vehicle coordinate system; based on the first pitch angle and the first yaw angle, the first angle information is determined.
[0077] In this way, the XOY plane of the vehicle coordinate system can be determined to be parallel or approximately parallel to the horizontal plane. Therefore, the pitch angle of the sun relative to the horizontal plane can be determined as the first pitch angle of the sun in the vehicle coordinate system, avoiding transformation based on the vehicle pose and reducing the amount of calculation.
[0078] The yaw angle mapping function is a pre-defined mapping function based on the correlation between the yaw angle in the vehicle coordinate system and the yaw angle in the world coordinate system. Since the second angle information is calculated based on the current vehicle position, the difference between the yaw angle of the sun in the vehicle coordinate system and the yaw angle of the sun relative to the preset direction lies in the different 0-degree directions. Based on this, the yaw angle mapping function is set to quickly map the yaw angle in the second angle information to the first yaw angle in the vehicle coordinate system.
[0079] Optionally, the yaw angle mapping function can be a continuous mapping function or a piecewise mapping function, which can be set according to actual needs. For example, if highlighting is required based on the real-time light angle, a continuous mapping function can be set; if highlighting is specified only at specific angles, such as 30 degrees, 60 degrees, 90 degrees, etc., a piecewise mapping function is set to map different yaw angle intervals of the second angle information to a specific first yaw angle in the vehicle coordinate system. For example, if the yaw angle in the second angle information is in interval 1, it is mapped to a first yaw angle of 30 degrees; if the yaw angle in the second angle information is in interval 2, it is mapped to a first yaw angle of 60 degrees, and so on. The specific piecewise mapping function can be set according to the actual highlighting requirements, and this embodiment of the disclosure does not limit it.
[0080] Figure 6 This is a schematic diagram illustrating the principle of determining first angle information provided in an exemplary embodiment of this disclosure. For example... Figure 6 As shown, the pitch angle of the Sun 12 relative to the horizontal plane is expressed as... In the vehicle coordinate system, the XOY plane is taken as the horizontal plane. Point P is the perpendicular projection of point A on the ray emission path onto the horizontal plane, meaning line segment AP is perpendicular to the horizontal plane. OP is the projection line of the ray onto the horizontal plane. Taking true north as an example, the yaw angle of the sun relative to the preset direction is expressed as... Taking due north as the positive direction and clockwise as the positive direction, the vehicle's orientation (yaw angle) is: Therefore, the angle of elevation of the sun relative to the horizontal plane can be seen. It can be used as the first elevation angle of the sun in the vehicle coordinate system. The first yaw angle of the sun in the vehicle coordinate system and and Regarding this, based on the vehicle's real-time yaw angle, the yaw angle mapping function is used to... Mapped to For example, first-angle information can be represented as follows:
[0081] Formula (2)
[0082] Formula (3)
[0083] in, This indicates the modulo operation; other symbols are as described above. In the world coordinate system, the positive direction for yaw is clockwise from true north. In the vehicle coordinate system, the positive direction is clockwise from the direction the vehicle is facing. For example, if... It is 60 degrees. If it is 280 degrees, then for .
[0084] In practical applications, the yaw angle mapping function can be set according to the definition of the positive and negative directions of the yaw angle in the global coordinate system and the vehicle coordinate system, and is not limited to the formula (3).
[0085] In the embodiments of this disclosure, the pitch angle of the sun relative to the horizontal plane is determined as the first pitch angle of the sun in the vehicle coordinate system, and based on the pre-configured yaw angle mapping function, the yaw angle of the sun relative to the preset direction is mapped to the first yaw angle in the vehicle coordinate system. This avoids the use of a transformation matrix between coordinate systems, reduces the amount of calculation, and quickly converts the second angle information into the first angle information in the vehicle coordinate system.
[0086] Figure 7 This is a schematic flowchart of an image generation method provided in yet another exemplary embodiment of this disclosure.
[0087] In some alternative embodiments, based on any of the above embodiments, such as Figure 7 As shown, in step 230, the current specular angle is determined based on the first angle information and the normal vector of the plane where the vehicle screen is located, including:
[0088] Step 2310: Determine the unit vector of the sun's rays based on the first angle information.
[0089] Here, the unit vector of sunlight is a vector of length 1, pointing in the direction of the sun relative to the current vehicle position. The unit vector of sunlight can be determined based on the first yaw angle and the first pitch angle from the first angle information, using a preset unit vector calculation rule. The unit vector calculation rule is expressed as follows:
[0090] Formula (4)
[0091] in, Represents the unit vector of light rays. Indicates the first pitch angle. This indicates the first yaw angle.
[0092] Step 2320: Determine the second yaw angle of the sunlight relative to the vehicle screen based on the unit vector and normal vector of the light rays.
[0093] The second yaw angle of the sunlight relative to the vehicle screen refers to the yaw angle of the projection line of the sunlight on the vehicle screen relative to the first preset direction of the vehicle screen. The first preset direction can be determined according to actual needs, and may include, but is not limited to, a direction perpendicular to the bottom edge of the vehicle screen and pointing upwards, i.e., a direction parallel to the side edge of the vehicle screen.
[0094] Optionally, the second yaw angle of the sunlight relative to the vehicle screen can be determined based on the relationship between the unit vector of the light rays and the projection line of the plane where the vehicle screen is located and the normal vector of the plane where the vehicle screen is located.
[0095] Step 2330: Determine the current highlight angle based on the second yaw angle.
[0096] The second yaw angle can be used as the current highlight angle, or it can be mapped to the current highlight angle according to a preset mapping rule. For example, the second yaw angle can be mapped to two highlight angle boundary values, including a lower limit and an upper limit. These two values constitute the angular range of the highlight area, and are used as the current highlight angle. For example, if the second yaw angle is 30 degrees and the current highlight angle includes 15 degrees and 45 degrees, it means that the highlight should be displayed within the 15-degree to 45-degree angle range of the interface element. The specific method for determining the current highlight angle based on the second yaw angle is not limited.
[0097] In the embodiments of this disclosure, based on the first angle information of the sun, the unit vector of the sun's rays is determined. By combining the unit vector of the rays with the normal vector of the plane where the vehicle screen is located, the relationship between the sunlight and the vehicle screen can be established, and the yaw angle of the sunlight relative to the vehicle screen can be determined. This yaw angle determines the highlight angle, thereby providing an effective reference for determining the highlight angle under real light sources.
[0098] In some optional embodiments, step 2320, which determines the second yaw angle of the sunlight on the vehicle screen based on the unit vector and normal vector of the light rays, includes:
[0099] Based on the unit vector and normal vector of the ray, determine the projection vector of the unit vector of the ray onto the plane where the vehicle screen is located; based on the projection vector and the first and second direction vectors of the plane where the vehicle screen is located, determine the second yaw angle.
[0100] Here, the projection vector of the unit ray vector onto the plane where the vehicle screen is located refers to the orthogonal projection of the direction unit vector of the sunlight onto the plane. Based on the unit ray vector and the normal vector of the plane where the vehicle screen is located, the projection vector is determined according to a preset projection vector calculation formula, which can be expressed as follows:
[0101] Formula (5)
[0102] in, Represents the unit vector of light rays. This represents the normal vector of the plane containing the vehicle screen. This represents the projection vector of the unit ray vector onto the plane of the vehicle screen.
[0103] After obtaining the projection vector, the second yaw angle can be determined based on the projection vector and the first and second direction vectors of the plane where the vehicle screen is located. The first direction vector is the vertical direction vector on the plane where the vehicle screen is located, meaning it is perpendicular to the intersection of the plane where the vehicle screen is located and the horizontal plane. The second direction vector is the horizontal direction vector on the plane where the vehicle screen is located, parallel to the intersection of the plane where the vehicle screen is located and the horizontal plane, and consistent with the Y-axis direction of the vehicle coordinate system.
[0104] Figure 8 This is a schematic diagram illustrating the principle of determining the second yaw angle provided in an exemplary embodiment of this disclosure. Figure 8 As shown, the X direction represents the direction of the vehicle's front, i.e., the X-axis direction of the vehicle coordinate system, and the Y direction represents the Y-axis direction of the vehicle coordinate system. Here, the Y direction only indicates direction and is not necessarily the Y-axis of the vehicle coordinate system, but rather the extension direction of the line l intersecting the screen plane and the horizontal plane along the Y-axis. The Z direction is perpendicular to the horizontal plane and upwards. The screen plane refers to the plane where the vehicle screen is located. The Zs direction is the vertical direction on the screen plane, i.e., the direction perpendicular to the line l and upwards on the screen plane, the 0-degree direction. The F direction is perpendicular to the Y direction. This represents the unit vector of the ray, pointing towards the sun, the light source; that is, the vector from point C to point E in the diagram. C is a point on the intersection of the horizontal plane and the screen plane, for example, the intersection of the intersection with the X-axis of the vehicle coordinate system. The projection of the unit ray vector onto the screen plane is the vector pointing from C to B, and the normal vector of the screen plane is... Parallel to BE, due to the normal vector of the screen plane Perpendicular to the Y-axis, which is equivalent to the coordinate in the Y direction of the XZ plane. Therefore, the normal vector of the screen plane in the vehicle coordinate system can be expressed as: The first direction vector of the screen plane is the vector along the Zs direction, denoted as... The second direction vector of the screen plane is the horizontal direction vector, that is, the vector along the Y direction, denoted as... CD is the projection of the unit vector of the ray onto the horizontal plane; therefore, the yaw angle of CD relative to the X direction is the first yaw angle. CD and CE (or The angle between them is the first pitch angle. The projection vector can be represented as... It can be based on the projection vector First direction vector Second direction vector The second yaw angle of the sunlight relative to the vehicle screen is determined by the following formula. :
[0105] Formula (6)
[0106] in, This represents the angle calculation function, used to calculate the projection vector. The angle between the direction and Zs.
[0107] In addition, it can also be based on the unit vector of light. With normal vector Calculate the pitch angle of sunlight relative to the screen plane. , means as follows:
[0108] Formula (7)
[0109] Here, arcsin() is the arcsine function. See also Figure 8 The angle of elevation of sunlight relative to the screen plane Projection vector and The angle between them.
[0110] In the embodiments of this disclosure, the projection vector of the ray unit vector on the screen plane is determined based on the ray unit vector and the screen plane normal vector. Then, based on the projection vector and the normal vector, the second yaw angle of the sunlight relative to the vehicle plane is determined, which is used to determine the specular angle. This realizes the effective calculation of the real-time specular angle and provides an accurate and real-time specular angle for specular rendering.
[0111] In some optional embodiments, based on any of the above embodiments, a target image is generated based on the current highlight angle, the current highlight intensity, and the source image data, including:
[0112] Based on the current specular angle, current specular intensity, and the first source image data to be rendered in the source image data, a liquid glass layer is generated; based on the second source image data in the source image data, a first layer is generated; the second source image data is the data in the source image data other than the first source image data; based on the liquid glass layer and the first layer, a target image is generated.
[0113] The first source image data refers to the image data in the source image data that requires a highlight effect. This first source image data includes, but is not limited to, windows, various controls, buttons, etc. The second source image data refers to the image data in the source image data that does not require highlight rendering. This second source image data includes, but is not limited to, background layers, text lists, etc. The specific first and second source image data are determined by the needs of the actual rendering scene, and this disclosure does not limit them. The liquid glass layer refers to a layer with a liquid glass effect. After obtaining the liquid glass layer and the first layer, the first image can be blended with the liquid glass layer to obtain the target image. The blending method includes, but is not limited to, stacking the layers sequentially.
[0114] Optionally, based on the current specular angle, current specular intensity, and source image data, the rendering engine on the vehicle can be invoked to generate a liquid glass layer, a first layer, and a merged target image. Rendering engines include, but are not limited to, the Unity engine and Unreal Engine; this disclosure does not impose any limitations on the rendering engine used.
[0115] In some optional embodiments, a liquid glass layer is generated based on the current specular angle, the current specular intensity, and the first source image data to be rendered in the source image data, including:
[0116] Based on the current highlight angle, current highlight intensity, and first source image data, a liquid glass layer is generated using a pre-configured liquid glass algorithm.
[0117] The liquid glass algorithm, also known as the liquid glass effect rendering algorithm, includes, but is not limited to, real-time Gaussian blur, UV displacement mapping refraction simulation, physically based lighting response specular calculation, multi-channel off-screen rendering, and shader blending. By dynamically simulating the transparency, refraction, and reflection characteristics of glass, it achieves a sense of fluidity in interface elements synchronized with ambient light. The liquid glass algorithm can employ any feasible algorithm, and this disclosure does not limit its implementation.
[0118] In some optional embodiments, the method of this disclosure further includes: displaying the target image on an in-vehicle screen.
[0119] After generating the target image, the target image can be transmitted to the vehicle screen for display.
[0120] Figure 9 This is a schematic diagram illustrating the liquid glass effect provided in an exemplary embodiment of this disclosure. For example... Figure 9 As shown, the upper left corner of the edge of the interface element in the middle ellipse is highlighted.
[0121] In related technologies, the same solution used on mobile phones is adopted to generate images on the vehicle side, that is, the highlight angle and highlight intensity are determined based on the gyroscope, virtual light source and background brightness. The image display effect is poor. Moreover, the usage scenario on the vehicle is different from that on the mobile phone. If the vehicle screen is in a fixed scene, the angle change brought by the gyroscope is very small, which makes the highlight angle change small and difficult to form a sharp effect.
[0122] The image generation method provided in this disclosure, for the liquid glass effect of vehicle display, adopts a high-light dynamic adjustment method based on real-time ambient lighting (i.e., the angle of sunlight and the brightness of the vehicle interior environment), which effectively enhances the realism of the liquid glass and makes the image display effect more vivid.
[0123] The embodiments described above can be implemented individually or in any combination without conflict. The specific implementation can be set according to actual needs, and this disclosure does not limit them.
[0124] Any of the image generation methods provided in this disclosure can be executed by any suitable device with data processing capabilities, including but not limited to: terminal devices and servers. Alternatively, any of the image generation methods provided in this disclosure can be executed by a processor, such as by a processor executing any of the image generation methods mentioned in this disclosure by calling corresponding instructions stored in memory. Further details will not be elaborated below.
[0125] Exemplary device
[0126] Figure 10This is a schematic diagram of an image generation apparatus provided in an exemplary embodiment of the present disclosure. The image generation apparatus of this disclosure can be used to implement the image generation method provided in any of the above embodiments of the present disclosure, such as... Figure 10 The image generation device shown may include: an acquisition module 51, a first processing module 52, a second processing module 53, and a third processing module 54.
[0127] The acquisition module 51 is used to acquire the current vehicle status information of the vehicle;
[0128] The first processing module 52 is used to determine the first angle information of the sun in the first coordinate system based on the current vehicle status information and the current time.
[0129] The second processing module 53 is used to determine the current highlight angle based on the first angle information and the normal vector of the plane where the vehicle screen is located.
[0130] The third processing module 54 is used to generate the target image based on the current highlight angle and source image data.
[0131] Figure 11 This is a schematic diagram of the structure of an image generation apparatus provided in another exemplary embodiment of the present disclosure.
[0132] In some alternative embodiments, in the above... Figure 10 Based on the illustrated embodiments, as Figure 11 As shown, the apparatus of this embodiment may further include: a fourth processing module 55.
[0133] The acquisition module 51 is also used to acquire the current ambient brightness information inside the vehicle.
[0134] The fourth processing module 55 is used to determine the current highlight intensity based on the current ambient brightness information.
[0135] The third processing module 54 is specifically used to generate a target image based on the current highlight angle, the current highlight intensity, and the source image data.
[0136] In some optional embodiments, the fourth processing module 55 is specifically used to: determine the current highlight intensity based on the current ambient brightness information, the pre-configured highlight intensity range and the highlight intensity calculation function.
[0137] Figure 12 This is a schematic diagram of the structure of an image generation apparatus provided in another exemplary embodiment of the present disclosure.
[0138] In some alternative embodiments, based on any of the above embodiments, the first coordinate system is a vehicle coordinate system. For example... Figure 12 As shown, the first processing module 52 includes: a first processing unit 521 and a second processing unit 522.
[0139] The first processing unit 521 is used to determine the second angle information of the sun based on the current vehicle position and current time in the current vehicle status information and using the solar angle calculation model.
[0140] The second angle information includes the sun's pitch angle relative to the horizontal plane and its yaw angle relative to a preset direction.
[0141] The second processing unit 522 is used to convert the second angle information to the vehicle coordinate system to obtain the first angle information.
[0142] In some optional embodiments, the second processing unit 522 is specifically used for:
[0143] The pitch angle of the sun relative to the horizontal plane is determined as the first pitch angle of the sun in the vehicle coordinate system; based on the pre-configured yaw angle mapping function, the yaw angle of the sun relative to the preset direction is mapped as the first yaw angle in the vehicle coordinate system; based on the first pitch angle and the first yaw angle, the first angle information is determined.
[0144] Figure 13 This is a schematic diagram of the structure of an image generation apparatus provided in yet another exemplary embodiment of this disclosure.
[0145] In some alternative embodiments, based on any of the above embodiments, such as Figure 13 As shown, the second processing module 53 includes: a first determining unit 531, a second determining unit 532, and a third determining unit 533.
[0146] The first determining unit 531 is used to determine the unit vector of sunlight based on the first angle information.
[0147] The second determining unit 532 is used to determine the second yaw angle of the sunlight relative to the vehicle screen based on the unit vector and normal vector of the light rays.
[0148] The third determining unit 533 is used to determine the current highlight angle based on the second yaw angle.
[0149] In some optional embodiments, the second determining unit 532 is specifically used for:
[0150] Based on the unit vector and normal vector of the ray, determine the projection vector of the unit vector of the ray onto the plane where the vehicle screen is located; based on the projection vector, the first direction vector and the second direction vector of the plane where the vehicle screen is located, determine the second yaw angle.
[0151] Figure 14 This is a schematic diagram of the structure of an image generation apparatus provided in another exemplary embodiment of the present disclosure.
[0152] In some alternative embodiments, based on any of the above embodiments, such as Figure 14 As shown, the third processing module 54 includes: a third processing unit 541, a fourth processing unit 542, and a fifth processing unit 543.
[0153] The third processing unit 541 is used to generate a liquid glass layer based on the current specular angle, the current specular intensity, and the first source image data to be rendered in the source image data.
[0154] The fourth processing unit 542 is used to generate a first layer based on the second source image data in the source image data; the second source image data is the data in the source image data other than the first source image data.
[0155] The fifth processing unit 543 is used to generate a target image based on the liquid glass layer and the first layer.
[0156] In some optional embodiments, the third processing unit 541 is specifically used for:
[0157] Based on the current highlight angle, current highlight intensity, and first source image data, a liquid glass layer is generated using a pre-configured liquid glass algorithm.
[0158] In some optional embodiments, the apparatus of this disclosure further includes a display module for displaying a target image on an in-vehicle screen.
[0159] The exemplary embodiments of this device correspond to the exemplary method section described above in terms of implementation. The corresponding content between the two can be referenced, combined, and cited, and will not be repeated here. The beneficial technical effects corresponding to the exemplary embodiments of this device can be found in the corresponding beneficial technical effects of the exemplary method section described above, and will not be repeated here.
[0160] Exemplary electronic devices
[0161] Figure 15 A structural diagram of an electronic device provided in this disclosure includes at least one processor 91 and a memory 92.
[0162] The processor 91 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 90 to perform desired functions.
[0163] The memory 92 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 91 may execute one or more computer program instructions to implement the image generation methods and / or other desired functions of the various embodiments of this disclosure described above.
[0164] In one example, the electronic device 90 may also include an input device 93 and an output device 94, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0165] The input device 93 may also include, for example, a touchscreen, a microphone, various sensors, etc. Sensors may include, for example, image sensors (e.g., cameras, webcams), LiDAR, millimeter-wave radar, ultrasonic radar, positioning sensors, pressure sensors, air quality sensors, temperature sensors, etc. Image sensors, LiDAR, millimeter-wave radar, ultrasonic radar, etc., can be used for environmental perception, i.e., detecting moving and static objects in the surrounding environment. Moving and static objects may include, for example, static objects such as lane lines, curbs, arrows, signs, trees, and buildings, as well as dynamic objects such as surrounding vehicles, pedestrians, and cyclists. Positioning sensors are used to locate the mobile device (e.g., a bicycle, a robot, etc.) where the electronic device is located. Positioning sensors may include, for example, an Inertial Measurement Unit (IMU), a Global Positioning System (GPS), etc. Pressure sensors can be used to detect seat pressure. Temperature sensors can be used to detect the temperature inside the vehicle cabin. Air quality sensors can be used to detect the air quality inside the vehicle cabin.
[0166] The output device 94 can output various information to the outside, including, for example, a display, a speaker, a communication network and its connected remote output devices, etc.
[0167] Of course, for the sake of simplicity, Figure 15 Only some of the components of the electronic device 90 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 90 may include any other suitable components depending on the specific application.
[0168] Exemplary computer program products and computer-readable storage media
[0169] In addition to the methods and apparatus described above, embodiments of this disclosure may also provide a computer program product, including computer program instructions that, when executed by a processor, cause the processor to perform the steps of the image generation methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.
[0170] Computer program products can be written in any combination of one or more programming languages to perform the operations of embodiments of this disclosure. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0171] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the image generation methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.
[0172] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, but is not limited to, systems, apparatuses, or devices that are electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0173] The basic principles of this disclosure have been described above with reference to specific embodiments. However, the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0174] Various modifications and variations can be made to this disclosure without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.
Claims
1. An image generation method, comprising: Obtain the vehicle's current status information; Based on the current vehicle status information and the current time, determine the first angle information of the sun in the first coordinate system; Based on the first angle information and the normal vector of the plane where the vehicle screen is located, the current highlight angle is determined; Based on the current highlight angle and source image data, a target image is generated.
2. The method according to claim 1, further comprising: Obtain the current ambient brightness information inside the vehicle; Based on the current ambient brightness information, determine the current highlight intensity; The step of generating a target image based on the current highlight angle and source image data includes: The target image is generated based on the current highlight angle, the current highlight intensity, and the source image data.
3. The method according to claim 1, wherein, The first coordinate system is a vehicle coordinate system; determining the first angle information of the sun in the first coordinate system based on the current vehicle status information and the current time includes: Based on the current vehicle position and current time in the current vehicle status information, the second angle information of the sun is determined using a solar angle calculation model; the second angle information includes the sun's pitch angle relative to the horizontal plane and its yaw angle relative to a preset direction; The second angle information is converted to the vehicle coordinate system to obtain the first angle information.
4. The method according to claim 3, wherein, The step of converting the second angle information to the vehicle coordinate system to obtain the first angle information includes: The pitch angle of the sun relative to the horizontal plane is determined as the first pitch angle of the sun in the vehicle coordinate system; Based on a pre-configured yaw angle mapping function, the yaw angle of the sun relative to a preset direction is mapped to the first yaw angle in the vehicle coordinate system; The first angle information is determined based on the first pitch angle and the first yaw angle.
5. The method according to claim 1, wherein, Determining the current highlight angle based on the first angle information and the normal vector of the plane where the vehicle screen is located includes: Based on the first angle information, determine the unit vector of the sun's rays; Based on the unit vector of the light rays and the normal vector, the second yaw angle of the sunlight relative to the vehicle screen is determined; The current highlight angle is determined based on the second yaw angle.
6. The method according to claim 5, wherein, Determining the second yaw angle of the sunlight on the vehicle screen based on the unit vector of the light ray and the normal vector includes: Based on the unit ray vector and the normal vector, determine the projection vector of the unit ray vector onto the plane where the vehicle screen is located; The second yaw angle is determined based on the projection vector and the first and second direction vectors of the plane where the vehicle screen is located.
7. The method according to claim 2, wherein, The step of determining the current specular intensity based on the current ambient brightness information includes: The current highlight intensity is determined based on the current ambient brightness information, the pre-configured highlight intensity range, and the highlight intensity calculation function.
8. The method according to claim 2, wherein, The step of generating a target image based on the current highlight angle, the current highlight intensity, and the source image data includes: Based on the current highlight angle, the current highlight intensity, and the first source image data to be rendered in the source image data, a liquid glass layer is generated; A first layer is generated based on the second source image data in the source image data; the second source image data is the data in the source image data other than the first source image data. The target image is generated based on the liquid glass layer and the first layer.
9. The method according to claim 8, wherein, The process of generating a liquid glass layer based on the current highlight angle, the current highlight intensity, and the first source image data to be rendered in the source image data includes: Based on the current highlight angle, the current highlight intensity, and the first source image data, the liquid glass layer is generated using a pre-configured liquid glass algorithm.
10. The method according to any one of claims 1-9, wherein, Also includes: The target image is displayed on the vehicle's in-vehicle screen.
11. An image generation apparatus, comprising: The acquisition module is used to acquire the current vehicle status information; The first processing module is used to determine the first angle information of the sun in the first coordinate system based on the current vehicle status information and the current time. The second processing module is used to determine the current highlight angle based on the first angle information and the normal vector of the plane where the vehicle screen is located; The third processing module is used to generate the target image based on the current highlight angle and source image data.
12. A computer-readable storage medium storing a computer program, which, when executed, implements the image generation method according to any one of claims 1-10.
13. An electronic device, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the image generation method according to any one of claims 1-10.