Vehicle-machine interface switching method and device, computer device, and storage medium
By capturing vehicle model data from the rendering camera and the main camera and fusing them to generate a third model image, the memory usage problem during vehicle interface switching is solved, achieving a natural transition and reducing storage requirements, thus improving the smoothness and efficiency of interface switching.
Patent Information
- Application Number
- CN202511255728.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-09-04
AI Technical Summary
Existing methods for switching in-vehicle infotainment systems cannot reduce memory usage while achieving a natural transition. Traditional direct switching is abrupt, while transitional switching requires pre-storing a large number of images, which consumes memory.
The first model image is generated by capturing vehicle model data from the first interface using a rendering camera, and the third model image is generated by merging the data from the second interface using a main camera and a shader. This achieves a natural transition and reduces memory usage.
It achieves natural interface switching while reducing memory usage, avoiding the need to pre-store a large number of images, and improving the smoothness and efficiency of interface switching.
Smart Images

Figure CN120743422B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicles, in particular to a car-machine interface switching method and device, computer equipment and a computer readable storage medium. BACKGROUND
[0002] With the development of vehicle technology, a technology of displaying a three-dimensional model of a vehicle on a car-machine interface has appeared, and the display of the three-dimensional model of the vehicle is different on different interfaces. For example, the display of the three-dimensional model of the vehicle on a vehicle control interface is not the same as that on an energy flow interface. When a user switches from the vehicle control interface to the energy flow interface to view the state of the vehicle battery and the tire pressure, the three-dimensional model of the vehicle displayed on the central control screen of the vehicle also needs to be switched from the display form on the vehicle control interface to the display form on the energy flow interface.
[0003] In the traditional technology, the switching of the car-machine interface can be achieved in two ways. One is direct switching, but this switching method is too harsh and not natural enough. The other is transition switching, which uses pre-stored pictures to transition when switching by correcting the position, so that people can see the switching effect. However, this switching method requires pre-storing a large number of pictures, thus occupying a large amount of memory. It can be seen that the current car-machine interface switching method cannot achieve natural switching while reducing memory occupation. SUMMARY
[0004] Therefore, it is necessary to provide a car-machine interface switching method, device, computer equipment, computer readable storage medium and computer program product which can achieve natural switching while reducing memory occupation.
[0005] In a first aspect, the present application provides a car-machine interface switching method, comprising:
[0006] In response to a request for switching the car-machine interface from a first interface to a second interface, model data of a first vehicle model displayed in the first interface is collected by a rendering camera, and a first model image of the first vehicle model is obtained according to the model data of the first vehicle model;
[0007] Model data of a second vehicle model displayed in the second interface is collected by a main camera to obtain a second model image of the second vehicle model according to the model data of the second vehicle model; wherein the first vehicle model and the second vehicle model maintain the same pose;
[0008] The first model image and the second model image are fused by a shader to obtain a third model image, and the third model image is displayed on the car machine interface in a transition process from the first interface to the second interface.
[0009] In one of the embodiments, the fusing the first model image and the second model image by a shader to obtain a third model image comprises: obtaining a first image pixel from the first model image and a second image pixel at the same position as the first image pixel from the second model image; the first image pixel is any image pixel in the first model image; obtaining a horizontal coordinate of the first image pixel in the first model image, and obtaining a first blur coefficient corresponding to the first image pixel based on the horizontal coordinate, and obtaining a second blur coefficient corresponding to the second image pixel based on the horizontal coordinate; obtaining a third pixel value of a third image pixel based on a first pixel value of the first image pixel, the first blur coefficient, a second pixel value of the second image pixel, and the second blur coefficient; the third image pixel is at the same position as the first image pixel; and generating the third model image according to each third image pixel.
[0010] In one of the embodiments, the transition process comprises a plurality of image frames; the obtaining a first blur coefficient corresponding to the first image pixel based on the horizontal coordinate, and the obtaining a second blur coefficient corresponding to the second image pixel based on the horizontal coordinate comprise: obtaining a current image frame and a first reference blur coefficient and a second reference blur coefficient set in advance for the current image frame; obtaining a difference between the horizontal coordinate and half of the image width of a model image; the model image is the first model image or the second model image; obtaining a first initial blur coefficient based on the difference and the first reference blur coefficient, and obtaining a second initial blur coefficient based on the difference and the second reference blur coefficient; adjusting the first initial blur coefficient and the second initial blur coefficient by a saturation adjustment function to obtain the first blur coefficient and the second blur coefficient.
[0011] In one of the embodiments, the obtaining the first model image of the first vehicle model according to the model data of the first vehicle model comprises: filtering background data other than the first vehicle model by the rendering camera to obtain the model data of the first vehicle model; creating a rendering texture; the size of the rendering texture is the same as the interface size of the car machine interface; and importing the model data of the first vehicle model into the rendering texture to obtain the first model image.
[0012] In one of the embodiments, the collecting, by the main camera, of the model data of the second vehicle model displayed in the second interface to obtain a second model image of the second vehicle model according to the model data of the second vehicle model comprises: collecting, by the main camera, the model data of the second vehicle model and importing the model data of the second vehicle model into the shader; and generating, in the shader, the second model image by using the model data of the second vehicle model.
[0013] In one of the embodiments, after displaying the third model image on the car-machine interface during the transition process of switching the first interface to the second interface, the method further comprises: clearing the model data of the first vehicle model in the rendering texture to clear the first model image after the transition process ends; obtaining, by the shader, the second model image and displaying the second model image on the car-machine interface after the transition process ends.
[0014] In one of the embodiments, the collecting, by the rendering camera, of the model data of the first vehicle model displayed in the first interface comprises: adjusting the spatial position and orientation of the rendering camera to make the spatial position and orientation of the rendering camera the same as the spatial position and orientation of the main camera; adjusting the field of view range of the rendering camera to make the field of view range of the rendering camera the same as the field of view range of the main camera; and collecting, by the adjusted rendering camera, the model data of the first vehicle model to make the first vehicle model keep the same pose as the second vehicle model.
[0015] In a second aspect, the application further provides a car-machine interface switching device, comprising:
[0016] a first image rendering module configured to, in response to an interface switching request of switching a car-machine interface from a displayed first interface to a second interface, collect, by a rendering camera, model data of a first vehicle model displayed in the first interface and obtain a first model image of the first vehicle model according to the model data of the first vehicle model;
[0017] a second image rendering module configured to collect, by a main camera, model data of a second vehicle model displayed in the second interface to obtain a second model image of the second vehicle model according to the model data of the second vehicle model; wherein the first vehicle model keeps the same pose as the second vehicle model;
[0018] a third image display module configured to fuse, by a shader, the first model image and the second model image to obtain a third model image and display the third model image on the car-machine interface during a transition process of switching the first interface to the second interface.
[0019] In a third aspect, the present application also provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any one of the embodiments of the first aspect when executing the computer program.
[0020] In a fourth aspect, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the method in any one of the embodiments of the first aspect when executed by a processor.
[0021] In a fifth aspect, the present application also provides a computer program product comprising a computer program, and the computer program implements the steps of the method in any one of the embodiments of the first aspect when executed by a processor.
[0022] The above-mentioned vehicle machine interface switching method and device, computer device, computer readable storage medium and computer program product, by responding to the interface switching request of switching the vehicle machine interface from the displayed first interface to the second interface, by rendering the model data of the first vehicle model displayed in the first interface through the rendering camera, and obtaining the first model image of the first vehicle model according to the model data of the first vehicle model; by capturing the model data of the second vehicle model displayed in the second interface through the main camera, to obtain the second model image of the second vehicle model according to the model data of the second vehicle model; wherein the first vehicle model and the second vehicle model maintain the same posture; by the shader, the first model image and the second model image are fused to obtain the third model image, and the third model image is displayed on the vehicle machine interface in the transition process of switching the first interface to the second interface. The present application can generate the first model image of the first vehicle model by rendering the model data of the first vehicle model displayed in the first interface before switching through the rendering camera when detecting the vehicle machine interface switching request, and then can generate the second model image by capturing the model data of the second vehicle model displayed in the second interface after switching through the main camera, and the first vehicle model and the second vehicle model maintain the same posture, and finally the first model image and the second model image are fused through the shader to obtain the third model image, so as to be displayed in the transition process of switching the first interface to the second interface. Through this way, the model image fused with the first vehicle model before switching and the second vehicle model after switching is displayed in the transition process, so as to realize natural transition switching, and the process does not need to store a large number of pictures in advance, but can utilize the data collected by two cameras in real time and perform fusion rendering, so as to reduce the memory occupation. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application or the related art. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained on the basis of these drawings without creative labor.
[0024] Figure 1 A flowchart of a vehicle machine interface switching method in an embodiment;
[0025] Figure 2 A flowchart of obtaining a third model image in an embodiment;
[0026] Figure 3 A flowchart of obtaining a blur coefficient in an embodiment;
[0027] Figure 4 A flowchart of obtaining a first model image in an embodiment;
[0028] Figure 5 A flowchart of a real-time vehicle control switching energy flow method in an embodiment;
[0029] Figure 6 A flowchart of completing a rendered screenshot in an embodiment;
[0030] Figure 7 A schematic diagram of a rendered screenshot in an embodiment;
[0031] Figure 8 A display schematic diagram of a vehicle machine interface in a transition process in an embodiment;
[0032] Figure 9 A display schematic diagram of a vehicle machine interface after switching in an embodiment;
[0033] Figure 10 A structural block diagram of a vehicle machine interface switching device in an embodiment;
[0034] Figure 11 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0035] In order to make the purposes, technical solutions and advantages of the present application clearer, the following will further describe the present application in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0036] It should be noted that the terms "first", "second", etc. used in the present 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 "include" and "have" and any variations thereof used in the present application are intended to cover non-exclusive inclusion. The term "a plurality of" used in the present application means two or more. The term "and / or" used in the present application means one of the options or any combination of the options.
[0037] In one embodiment, as shown in Figure 1 A car-machine interface switching method is provided, and the present embodiment takes the method applied to a vehicle terminal as an example. It should be understood that the method can also be applied to a server, and can also be applied to a system including a vehicle terminal and a server, and is implemented through the interaction of the vehicle terminal and the server. In the present embodiment, the method includes the following steps:
[0038] In step S101, in response to a request for switching the car-machine interface from a displayed first interface to a second interface, the model data of a first vehicle model displayed in the first interface is collected by rendering a camera, and a first model image of the first vehicle model is obtained according to the model data of the first vehicle model.
[0039] The car-machine interface refers to the screen display interface of the vehicle display device in the vehicle, which can be used to realize human-computer interaction, for example, it can be the interface of the central control screen of the intelligent cockpit. The first interface refers to the current display interface, and the second interface refers to the display interface after the car-machine interface is switched. The switching operation can be realized by the user initiating a request for switching the interface. For example, when the user switches the car-machine interface from the vehicle control interface to the energy flow interface to view the vehicle battery status and tire pressure, the request for switching the interface can be initiated. At this time, the vehicle control interface is the first interface, and the energy flow interface is the second interface.
[0040] The first vehicle model refers to the three-dimensional model of the vehicle presented in the first interface, and the first model image refers to the model image rendered by the first vehicle model. Taking the vehicle control interface as the first interface, the three-dimensional model of the vehicle displayed in the vehicle control interface is the first vehicle model. In the present embodiment, the three-dimensional model of the vehicle can be displayed in the first interface and the second interface. When the interface is switched, the presented three-dimensional model of the vehicle also needs to be switched.
[0041] Specifically, when the user initiates an interface switching request for switching the in-vehicle terminal interface from the first interface to the second interface, the in-vehicle terminal can open the rendering camera, align the first vehicle model displayed in the first interface through the rendering camera, and thus collect model data of the first vehicle model. Then, the model data of the first vehicle model can be used to obtain a model screenshot corresponding to the first vehicle model as the first model image.
[0042] In step S102, model data of a second vehicle model displayed in the second interface is collected through the main camera to obtain a second model image of the second vehicle model according to the model data of the second vehicle model; wherein the first vehicle model and the second vehicle model maintain the same pose.
[0043] The second vehicle model is a vehicle three-dimensional model presented in the second interface, and the second model image refers to a model image rendered by the second vehicle model. Taking the energy flow interface as the second interface, for example, the transparent vehicle three-dimensional model displayed in the energy flow is the second vehicle model, and the first vehicle model used for rendering the image maintains the same pose as the second vehicle model.
[0044] Specifically, after the user initiates the interface switching request, the in-vehicle terminal can also open the main camera to align the second vehicle model in the second interface, and thus collect model data of the second vehicle model to obtain the second model image of the second vehicle model using the model data. The second vehicle model photographed by the main camera maintains the same pose as the first vehicle model photographed by the rendering camera.
[0045] In step S103, the first model image and the second model image are fused through a shader to obtain a third model image, and the third model image is displayed in the in-vehicle terminal interface during the transition process of switching the first interface to the second interface.
[0046] The third model image is an image generated by fusing the first model image and the second model image. This image can represent the transformation process of transforming the first fused image into the second model image. Therefore, the third model image can be displayed during the transition process of switching the first interface to the second interface to display the transformation process of transforming the first fused image into the second model image, thereby realizing natural switching of the interface.
[0047] In the above vehicle machine interface switching method, by responding to the interface switching request of switching the vehicle machine interface from the displayed first interface to the second interface, the model data of the first vehicle model displayed in the first interface is collected by the rendering camera, and the first model image of the first vehicle model is obtained according to the model data of the first vehicle model; the model data of the second vehicle model displayed in the second interface is collected by the main camera, so as to obtain the second model image of the second vehicle model according to the model data of the second vehicle model; wherein the first vehicle model and the second vehicle model maintain the same posture; the first model image and the second model image are fused by the shader to obtain the third model image, and the third model image is displayed on the vehicle machine interface in the transition process of switching the first interface to the second interface. When the vehicle machine interface switching request is detected, the model data of the first vehicle model displayed in the first interface before switching can be collected by the rendering camera to generate the first model image of the first vehicle model, then the model data of the second vehicle model displayed in the second interface after switching can be collected by the main camera to generate the second model image, and the first vehicle model and the second vehicle model maintain the same posture, and finally the first model image and the second model image are fused by the shader to obtain the third model image, which is displayed in the transition process of switching the first interface to the second interface. In this way, the model image of the first vehicle model before switching and the second vehicle model after switching is fused and displayed in the transition process, so that natural transition switching can be realized, and the process does not need to store a large number of pictures in advance, but can use two cameras to collect data and perform fusion rendering in real time, so that the memory occupation can be reduced.
[0048] In one embodiment, as shown in FIG. 1 1, Figure 2 Step S103 can further include:
[0049] Step S201, obtaining a first image pixel from the first model image, and obtaining a second image pixel at the same position as the first image pixel from the second model image; the first image pixel is any image pixel in the first model image.
[0050] The first image pixel refers to any image pixel in the first model image, and the second image pixel is the image pixel corresponding to the first image pixel in the second model image, i.e. the second image pixel at the same position as the first image pixel. Specifically, the vehicle terminal can take any image pixel in the first model image as the first image pixel, and then collect the pixel at the same position as the first image pixel from the second model image as the second image pixel.
[0051] Step S202, obtaining a horizontal coordinate of the first image pixel in the first model image, and obtaining a first blur coefficient corresponding to the first image pixel based on the horizontal coordinate, and obtaining a second blur coefficient corresponding to the second image pixel based on the horizontal coordinate.
[0052] The horizontal coordinate can refer to the horizontal coordinate of the first image pixel in the first model image, and the first blur coefficient refers to the blur coefficient used for blurring the first image pixel. The first blur coefficient can be calculated based on the horizontal coordinate of the first image pixel. Similarly, the second blur coefficient refers to the blur coefficient used for blurring the second image pixel. Since the positions of the first image pixel and the second image pixel are the same, the horizontal coordinates of the first image pixel and the second image pixel are the same, and therefore the second blur coefficient can be calculated based on the horizontal coordinate of the first image pixel.
[0053] Step S203, obtaining a third pixel value of a third image pixel based on the first pixel value of the first image pixel, the first blur coefficient, the second pixel value of the second image pixel, and the second blur coefficient; the third image pixel has the same position as the first image pixel;
[0054] Step S204, generating a third model image according to each third image pixel.
[0055] The third image pixel refers to the image pixel in the third model image that has the same position as the first image pixel. The third image pixel can be obtained by fusing the first image pixel and the second image pixel. After obtaining the first blur coefficient and the second blur coefficient, the vehicle-mounted terminal can blur the first pixel value of the first image pixel and the second pixel value of the second image pixel using the first blur coefficient and the second blur coefficient respectively, and fuse the blurred first pixel value and the second pixel value to obtain the third pixel value of the third image pixel. In this way, the pixel values of all image pixels in the third model image can be obtained, thereby constructing and generating the third model image.
[0056] In this embodiment, the first image pixel and the second image pixel at the same position can also be obtained, and the first blur coefficient and the second blur coefficient can be calculated based on the horizontal coordinate of the first image pixel in the first model image. In this way, the pixel values can be blurred and fused using the blur coefficients, which can improve the display effect of the fused third model image.
[0057] Further, the transition process includes a plurality of image frames; as Figure 3 As shown in FIG. 7, step S202 can further include:
[0058] Step S301, obtaining a current image frame, and a first reference blur coefficient and a second reference blur coefficient set in advance for the current image frame.
[0059] In this embodiment, the transition process from switching from the first interface to the second interface is displayed, which usually needs to be displayed through multiple image frames, and the current image frame refers to any one of the multiple image frames, and the first reference blur coefficient and the second reference blur coefficient refer to two reference blur coefficients set in advance for the current image frame. For example, a mapping relationship between the image frame and the two reference blur coefficients can be set in advance, so that the two reference blur coefficients set in advance for the current image frame can be determined according to the current image frame, wherein the first reference blur coefficient is used to obtain the first blur coefficient, and the second reference blur coefficient is used to obtain the second blur coefficient.
[0060] Specifically, the vehicle-mounted terminal can calculate the first reference blur coefficient and the second reference blur coefficient according to the mapping relationship between the image frame and the two reference blur coefficients after determining the current image frame.
[0061] In step S302, the difference between the horizontal coordinate and half of the image width of the model image is obtained; the model image is the first model image or the second model image;
[0062] In step S303, the first initial blur coefficient is obtained based on the difference and the first reference blur coefficient, and the second initial blur coefficient is obtained based on the difference and the second reference blur coefficient.
[0063] After the horizontal coordinate is obtained, the difference between the horizontal coordinate and half of the image width of the model image can be calculated, wherein the model image refers to the first model image or the second model image, and then the first initial blur coefficient can be calculated using the difference and the first reference blur coefficient, and the second initial blur coefficient can be obtained using the difference and the second reference blur coefficient.
[0064] In step S304, the first initial blur coefficient and the second initial blur coefficient are adjusted by a saturation adjustment function to obtain the first blur coefficient and the second blur coefficient.
[0065] The saturation adjustment function can be a saturate function. After the first initial blur coefficient and the second initial blur coefficient are obtained, the first initial blur coefficient and the second initial blur coefficient can be further adjusted by the saturation adjustment function to obtain the final first blur coefficient and the second blur coefficient.
[0066] For example, the third pixel value can be calculated by the following formula:
[0067] OutColor = colorA * saturate((uv.x - width / 2) / Fuzziness) + colorB * saturate((width / 2 - uv.x) / Fuzziness)
[0068] wherein OutColor represents the third pixel value, colorA represents the first pixel value, colorB represents the second pixel value, saturate represents a saturation adjustment function for limiting the value between 0-1, uv.x is the x value of uv of the picture, i.e. the horizontal coordinate, width is the picture width, fuzziness is a self-defined fuzziness parameter, i.e. a reference fuzziness coefficient, which can manually adjust the fuzziness effect.
[0069] In the embodiment, the first fuzziness coefficient and the second fuzziness coefficient can also be obtained based on the difference between the horizontal coordinate and half of the image width of the model image, and the first reference fuzziness coefficient and the second reference fuzziness coefficient of the current image frame. In this way, the horizontal coordinate of the picture can be used to transition the pixel information from the middle of the picture to both ends, further improving the display effect of the interface switching transition process.
[0070] In one embodiment, as shown in FIG. 1, step S101 can further include: Figure 4
[0071] Step S401 filters the background data other than the first vehicle model through the rendering camera to obtain model data of the first vehicle model.
[0072] In the embodiment, since only the vehicle model needs to be transitioned in the transition process from the first interface to the second interface, and the background other than the vehicle model does not need to be transitioned, the background data can be filtered by the rendering camera, for example, the places other than the vehicle model are set to be transparent, so as to only retain the model data of the vehicle model.
[0073] Specifically, the background Type of the rendering camera, i.e. background Type, can be set to SolidColor, the color can be set to pure black, the alpha channel can be set to 0, and the Culling Mask can be set to only render the vehicle model, so as to filter the background data other than the first vehicle model, thereby only retaining the model data of the first vehicle model.
[0074] Step S402 creates a rendering texture, and the size of the rendering texture is the same as the interface size of the vehicle machine interface.
[0075] Step S403 imports the model data of the first vehicle model into the rendering texture to obtain a first model image.
[0076] After the model data of the first vehicle model is collected, the first model image can be generated based on the model data collected by the rendering camera. In this way, a rendering texture RenderTexture with the same size as the car interface can be newly created, and the format can be set as ARGB. Then, the model data of the first vehicle model can be imported into the rendering texture RenderTexture, so as to obtain the model screenshot of the first vehicle model as the first model image.
[0077] In this embodiment, the background data can be filtered by the rendering camera, so as to only retain the model data of the first vehicle model. The rendering texture RenderTexture can be newly created, and the model data can be imported into the rendering texture RenderTexture to obtain the first model image. In this way, the pixels of the rendering camera are rendered onto the RenderTexture to complete the rendering screenshot, and the data amount of the first model image collection can be reduced.
[0078] Further, the step S402 can further include: collecting the model data of the second vehicle model by the main camera, and importing the model data of the second vehicle model into the shader; and generating the second model image by using the model data of the second vehicle model in the shader.
[0079] The second model image is generated by the shader. Since the model data of the second vehicle model is generated by the main camera, the vehicle terminal can directly import the model data of the second vehicle model collected by the main camera into the shader, so as to generate the second model image by using the model data of the second vehicle model in the shader. Then, the vehicle terminal can also import the pixels of the first model image completed on the RenderTexture into the shader, so as to fuse the generated second model image and the pixels of the first model image imported from the RenderTexture in the shader, to obtain the third model image fused with the first model image and the second model image.
[0080] In this embodiment, the model data of the second vehicle model collected by the main camera can be obtained by the shader to generate the second model image. Then, the generated second model image and the pixels of the first model image imported from the RenderTexture can be fused to obtain the third model image fused with the first model image and the second model image. In this way, the efficiency of generating the second model image can be improved.
[0081] In addition, after step S103, the method can further include: clearing the model data of the first vehicle model in the rendering texture to clear the first model image after the transition process ends; obtaining the second model image through the shader, and displaying the second model image on the in-vehicle interface after the transition process ends.
[0082] After the transition process ends, the first interface has been switched to the second interface, and thus the third model image obtained by fusing the first model image and the second model image is no longer needed to be displayed on the in-vehicle interface, and only the second model image displayed in the second interface after the switching needs to be displayed, and thus the model data of the first vehicle model in the rendering texture can be cleared to clear the first model image after the transition process ends, so that the shader can stop fusing the first model image and the second model image, and thus only the second model image is displayed on the in-vehicle interface.
[0083] After the transition process ends, the model data of the first vehicle model in the rendering texture can be cleared, so that only the second model image is displayed on the in-vehicle interface to complete the switching from the first interface to the second interface, and thus the fluency of the interface switching can be improved.
[0084] In an embodiment, step S101 can further include: adjusting the spatial position and orientation of the rendering camera to make the spatial position and orientation of the rendering camera the same as the spatial position and orientation of the main camera; adjusting the field of view range of the rendering camera to make the field of view range of the rendering camera the same as the field of view range of the main camera; and collecting the model data of the first vehicle model through the adjusted rendering camera, so that the first vehicle model and the second vehicle model maintain the same pose.
[0085] In the embodiment, in order to make the first vehicle model and the second vehicle model maintain the same pose, the rendering camera and the main camera need to be aligned when collecting the model data through the rendering camera and the main camera, to ensure that the first vehicle model rendered by the rendering camera and the second vehicle model rendered by the main camera have the same pose.
[0086] Specifically, the spatial position and orientation of the rendering camera can be adjusted, that is, the Position and Rotation under Transform of the rendering camera are set to be the same as those of the main camera, and the field of view range of the rendering camera is adjusted, that is, the Field of View under Projection of the rendering camera is set to be the same as that of the main camera, so that the rendering camera and the main camera are aligned. Then, the model data of the first vehicle model displayed in the first interface can be collected through the rendering camera. Since the rendering camera and the main camera have been aligned, the first vehicle model rendered by the rendering camera can maintain the same pose as the second vehicle model rendered by the main camera.
[0087] In this embodiment, the alignment of the rendering camera and the main camera can also be achieved by adjusting the spatial position, orientation and field of view of the rendering camera so that the spatial position, orientation and field of view of the rendering camera are consistent with those of the main camera. In this way, the first vehicle model rendered by the rendering camera can maintain the same pose as the second vehicle model rendered by the main camera, thereby further improving the accuracy of model image fusion.
[0088] In one embodiment, a method for switching energy flow of a vehicle control in real time is also provided. By using a multi-camera real-time rendering technology, the vehicle control module and the energy flow module are simultaneously rendered when switching the vehicle model. A camera is used to render a screenshot of the vehicle control at a fixed angle, and the real-time screenshot is transmitted to the shader and the transparent vehicle shell of the energy flow for transition, so as to achieve a natural transition effect. Since this method is real-time rendering, it can be compatible with any vehicle configuration without the need for pre-configuration, has low performance consumption, and can provide users with a smooth transition effect of the vehicle control switching energy flow, thereby providing a better experience. As shown in FIG. 8, this method can be implemented by the following steps: Figure 5
[0089] Step 1: Start the rendering camera, adjust the Position and Rotation under Transform and the Field of View under Projection of the rendering camera, so that they are consistent with those of the main camera, and align the vehicle model. In this way, the rendering textures RenderTexture rendered by the two cameras will be consistent. The Position and Rotation under Transform of the energy flow vehicle model are consistent with those of the vehicle control vehicle model, the Position of the energy flow vehicle model and the main camera is moved to a distance of 1000, and the main camera only renders the energy flow vehicle model, and the rendering camera only renders the vehicle control vehicle model. Because the relative position and rotation of the position information and rotation information of the rendering camera relative to the vehicle control vehicle model are consistent with those of the main camera relative to the energy flow vehicle model, the vehicle control vehicle model and the energy flow vehicle model will maintain the same pose.
[0090] Step 2, use the code to create a new render texture RenderTexture, set the size to the size of the transparent car shell, the format is ARGB, only the car model needs to be transitioned during the transition, and the background does not need to be transitioned, so the place outside the car model needs to be set to transparent. Set the background Type of the render camera to Solid Color, the color to pure black, the alpha to 0, and the Culling Mask to only render the car control car model. At this time, the pixels rendered on the render camera will be transparent except for the car model. Because it is necessary to ensure that the RenderTexture correctly receives the rendering of the camera, it is necessary to enable the Alpha of the RenderTexture. Set the targetTexture of the render camera to the current RenderTexture, enable rendering, and render the pixels of the render camera to the RenderTexture to complete the rendering screenshot. The specific steps can be as shown in Figure 6 , and the rendering screenshot can be as shown in Figure 7 .
[0091] Step 3, after completing the rendering screenshot, the transition effect of the energy flow car model and the car control car model needs to be displayed. Close the render camera, only use the main camera to render the energy flow car model, and pass the RenderTexture of the rendering screenshot obtained in the previous step into the shader. In the shader, get the pixel information of the RenderTexture pixel by pixel, display it in front of the current main camera, so that the main camera seems to still be rendering the car control car model.
[0092] Step 4, get the pixel information of the transparent car shell in the shader, use the UV coordinates of the picture, and transition the pixel information from the middle of the picture to the two ends. When transitioning, use color blending to avoid looking too harsh at the blending position. The specific effect can be as shown in Figure 8 , and the blending formula is as follows:
[0093] OutColor=colorA*saturate((uv.x-width / 2) / Fuzziness)+colorB*saturate((width / 2-uv.x) / Fuzziness)
[0094] Where outColor represents the color to be returned, colorA represents the screenshot of the car control car model, colorB represents the picture of the transparent car shell, saturate represents limiting the value to 0-1, uv.x is the x value of the uv of the picture, width is the picture width, and fuzziness is a custom fuzziness parameter that can manually adjust the fuzziness effect.
[0095] Step 5, finally, after the transition is completed, the render camera is closed, the pixels of the RenderTexture rendering are cleared, and the picture rendered by the main camera is completely the energy flow module, and the switching from the vehicle control module to the energy flow module is completed. Due to the use of multi-camera rendering and Shader fusion in the middle, the whole effect is smoother, looks like one shot, and provides a better experience for users. The effect after the switching is completed can be seen in Figure 9 .
[0096] In this embodiment, the multi-camera rendering technology is used to render the vehicle control module and the energy flow module in real time. The rendered screenshot of the vehicle control module is fused into the transparent vehicle shell of the energy flow using Shder, so that the switching is smoother and provides a better experience for users. Since the scheme is real-time rendering, it is not necessary to load the screenshot in advance according to the multiple configurations, which reduces the memory and CPU occupation of the program running, saves the bandwidth used for downloading the configuration graph, and can adapt to any newly added configuration without the need to add a new screenshot, thereby saving the development cost.
[0097] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination belong to the scope of protection of the present application.
[0098] Based on the same inventive concept, the present application also provides a vehicle-machine interface switching device for implementing the vehicle-machine interface switching method described above. The problem-solving implementation scheme provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more vehicle-machine interface switching device embodiments provided below can refer to the limitations of the vehicle-machine interface switching method described above, which will not be described here.
[0099] In one embodiment, as Figure 10 shown, a vehicle-machine interface switching device is provided, comprising: a first image rendering module 1001, a second image rendering module 1002, and a third image display module 1003, wherein:
[0100] The first image rendering module 1001 is configured to, in response to an interface switching request of switching the in-vehicle interface from a displayed first interface to a second interface, render model data of a first vehicle model displayed in the first interface by using a camera, and acquire a first model image of the first vehicle model according to the model data of the first vehicle model.
[0101] The second image rendering module 1002 is configured to acquire model data of a second vehicle model displayed in the second interface by using a main camera, and acquire a second model image of the second vehicle model according to the model data of the second vehicle model; wherein the first vehicle model and the second vehicle model maintain the same posture.
[0102] The third image display module 1003 is configured to fuse the first model image and the second model image by using a shader to obtain a third model image, and display the third model image on the in-vehicle interface in a transition process of switching the first interface to the second interface.
[0103] In an embodiment, the third image display module 1003 is further configured to acquire a first image pixel from the first model image, and acquire a second image pixel at the same position as the first image pixel from the second model image; the first image pixel is any image pixel in the first model image; acquire a horizontal coordinate of the first image pixel in the first model image, and acquire a first blur coefficient corresponding to the first image pixel based on the horizontal coordinate, and acquire a second blur coefficient corresponding to the second image pixel based on the horizontal coordinate; obtain a third pixel value of a third image pixel based on a first pixel value of the first image pixel, the first blur coefficient, a second pixel value of the second image pixel, and the second blur coefficient; the third image pixel is at the same position as the first image pixel; and generate the third model image according to each third image pixel.
[0104] In an embodiment, the transition process includes a plurality of image frames; the third image display module 1003 is further configured to acquire a current image frame, and acquire a first reference blur coefficient and a second reference blur coefficient preset for the current image frame; acquire a difference between the horizontal coordinate and half of the image width of the model image; the model image is the first model image or the second model image; obtain a first initial blur coefficient based on the difference and the first reference blur coefficient, and obtain a second initial blur coefficient based on the difference and the second reference blur coefficient; adjust the first initial blur coefficient and the second initial blur coefficient by using a saturation adjustment function to obtain the first blur coefficient and the second blur coefficient.
[0105] In an embodiment, the first image rendering module 1001 is further configured to filter out background data other than the first vehicle model by rendering the camera, to obtain model data of the first vehicle model; create a rendering texture; the size of the rendering texture is the same as the interface size of the vehicle interface; and import the model data of the first vehicle model into the rendering texture, to obtain the first model image.
[0106] In an embodiment, the second image rendering module 1002 is further configured to obtain model data of a second vehicle model captured by a main camera, and import the model data of the second vehicle model into a shader; and generate a second model image in the shader by using the model data of the second vehicle model.
[0107] In an embodiment, the vehicle interface switching apparatus further comprises a second image display module configured to, after the end of the transition process, clear the model data of the first vehicle model in the rendering texture, to clear the first model image; obtain the second model image by using the shader, and display the second model image on the vehicle interface after the end of the transition process.
[0108] In an embodiment, the first image rendering module 1001 is further configured to adjust the spatial position and orientation of the rendering camera, so that the spatial position and orientation of the rendering camera are the same as the spatial position and orientation of the main camera; adjust the field of view range of the rendering camera, so that the field of view range of the rendering camera is the same as the field of view range of the main camera; and capture the model data of the first vehicle model by using the adjusted rendering camera, so that the first vehicle model and the second vehicle model maintain the same pose.
[0109] The above-mentioned various modules in the vehicle interface switching apparatus can be all or partially realized by software, hardware, and combinations thereof. The above-mentioned various modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in the computer device in software form, so as to be called and executed by a processor to perform the operations corresponding to the above-mentioned various modules.
[0110] In an embodiment, a computer device is provided, which can be a vehicle terminal, and an internal structure diagram of the computer device can be as shown in Figure 11The computer device shown in the figure includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be realized through WIFI, mobile cellular network, Near Field Communication (NFC) or other technologies. The computer program is executed by the processor to realize a car-machine interface switching method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0111] Those skilled in the art can understand that, Figure 11 The skilled in the art can understand that,
[0112] In one embodiment, a computer device is also provided, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the steps in the above method embodiments.
[0113] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to realize the steps in the above method embodiments.
[0114] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by a processor to realize the steps in the above method embodiments.
[0115] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0116] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of each method. In the embodiments provided in the present application, any reference to memory, database or other medium 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 storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive 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. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0117] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, any combination of these technical features is deemed to be within the scope of the present application.
[0118] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that, for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for switching an interface of a car machine, characterized by, The method comprises: in response to an interface switching request of switching the in-vehicle infotainment interface from a displayed first interface to a second interface, acquiring model data of a first vehicle model displayed in the first interface through a rendering camera, and obtaining a first model image of the first vehicle model according to the model data of the first vehicle model; acquiring model data of a second vehicle model displayed in the second interface through a main camera to obtain a second model image of the second vehicle model according to the model data of the second vehicle model; wherein the first vehicle model and the second vehicle model maintain the same posture; fusing the first model image and the second model image through a shader to obtain a third model image, and displaying the third model image on the in-vehicle infotainment interface in a transition process from the first interface to the second interface; including: obtaining a first image pixel from the first model image, and obtaining a second image pixel at the same position as the first image pixel from the second model image; the first image pixel is any image pixel in the first model image; obtaining a horizontal coordinate of the first image pixel in the first model image, and obtaining a first blur coefficient corresponding to the first image pixel based on the horizontal coordinate, and obtaining a second blur coefficient corresponding to the second image pixel based on the horizontal coordinate; obtaining a third pixel value of a third image pixel based on a first pixel value of the first image pixel, the first blur coefficient, a second pixel value of the second image pixel, and the second blur coefficient; the third image pixel is at the same position as the first image pixel; generating the third model image according to each third image pixel.
2. The method of claim 1, wherein, The transition process comprises a plurality of image frames; the first blur coefficient corresponding to the first image pixel based on the horizontal coordinate, and the second blur coefficient corresponding to the second image pixel based on the horizontal coordinate, comprise: obtaining a current image frame, and a first reference blur coefficient and a second reference blur coefficient set in advance for the current image frame; obtaining a difference between the horizontal coordinate and half of the image width of the model image; the model image is the first model image or the second model image; obtaining a first initial blur coefficient based on the difference and the first reference blur coefficient, and obtaining a second initial blur coefficient based on the difference and the second reference blur coefficient; adjusting the first initial blur coefficient and the second initial blur coefficient through a saturation adjustment function to obtain the first blur coefficient and the second blur coefficient.
3. The method of claim 1, wherein, The method comprises: filtering background data other than the first vehicle model through the rendering camera to obtain the model data of the first vehicle model; creating a rendering texture; the size of the rendering texture is the same as the interface size of the in-vehicle infotainment interface; importing the model data of the first vehicle model into the rendering texture to obtain the first model image.
4. The method of claim 3, wherein, The model data of the second vehicle model displayed in the second interface is collected by the main camera, so as to obtain a second model image of the second vehicle model according to the model data of the second vehicle model. The model data of the second vehicle model is collected by the main camera and is imported into the shader. The second model image is generated in the shader by using the model data of the second vehicle model.
5. The method of claim 3, wherein, After the third model image is displayed on the car-machine interface during the transition process from the first interface to the second interface, the method further comprises: After the transition process ends, the model data of the first vehicle model in the rendering texture is cleared, so as to clear the first model image. The second model image is obtained by the shader, and the second model image is displayed on the car-machine interface after the transition process ends.
6. The method of claim 1, wherein, The model data of the first vehicle model displayed in the first interface is collected by the rendering camera, comprising: The spatial position and orientation of the rendering camera are adjusted so that the spatial position and orientation of the rendering camera are the same as those of the main camera. The field of view range of the rendering camera is adjusted so that the field of view range of the rendering camera is the same as that of the main camera. The model data of the first vehicle model is collected by the adjusted rendering camera, so that the first vehicle model and the second vehicle model maintain the same pose.
7. A device for switching a car-machine interface, characterized in that The device comprises: The first image rendering module is configured to, in response to an interface switching request of switching a car-machine interface from a displayed first interface to a second interface, collect model data of a first vehicle model displayed in the first interface by a rendering camera, and obtain a first model image of the first vehicle model according to the model data of the first vehicle model. The second image rendering module is configured to collect model data of a second vehicle model displayed in the second interface by a main camera, so as to obtain a second model image of the second vehicle model according to the model data of the second vehicle model; wherein the first vehicle model and the second vehicle model maintain the same pose. The third image display module is configured to fuse the first model image and the second model image by using a shader to obtain a third model image, and display the third model image on the vehicle machine interface in a transition process when the first interface switches to the second interface; and further configured to obtain a first image pixel from the first model image, and obtain a second image pixel at the same position as the first image pixel from the second model image; the first image pixel is any image pixel in the first model image; obtain a horizontal coordinate of the first image pixel in the first model image, and obtain a first blur coefficient corresponding to the first image pixel based on the horizontal coordinate, and obtain a second blur coefficient corresponding to the second image pixel based on the horizontal coordinate; obtain a third pixel value of a third image pixel based on a first pixel value of the first image pixel, the first blur coefficient, a second pixel value of the second image pixel, and the second blur coefficient; the third image pixel is at the same position as the first image pixel; and generate the third model image according to each third image pixel.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6. The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Image processing method and image processing apparatus
CN109410130A
Image processing method, image processing device and electronic equipment
CN112381749A