Three-dimensional rendering method and device for vehicle surrounding scene, vehicle and storage medium
By identifying targets around the vehicle, calculating the optimal rendering position, and adjusting the camera, combined with force analysis control parameters, the problem of fixed camera position and viewing angle was solved, improving the user experience and viewing angle effect of 3D rendering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING CHANGAN AUTOMOBILE CO LTD
- Filing Date
- 2022-08-19
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, the camera position is fixed during vehicle 3D rendering, resulting in poor viewing angles and reduced user experience.
By identifying rendering targets around the vehicle, calculating the optimal rendering position based on the actual distance, adjusting the camera position, and acquiring images for 3D rendering, the camera parameters are controlled by combining force analysis.
It achieves dynamic visual positioning, enhances the user's rendering perspective experience, avoids the impact of rendering targets being too large or too small, and improves the imaging perspective of the rendering results to match user habits.
Smart Images

Figure CN115471601B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automotive technology, and in particular to a three-dimensional rendering method, apparatus, vehicle, and storage medium for a scene surrounding a vehicle. Background Technology
[0002] In vehicle infotainment systems using relevant technologies, such as Figure 1 As shown, when the vehicle is rendered in 3D to view the surrounding scene, the vehicle is always located in the center of the screen, which greatly limits the comfort of the visual experience. This is especially unfriendly for some scenarios that require clear differentiation. For example, if a large truck is passing by, there will be a noticeable sense of oppression if the camera position remains unchanged. Furthermore, because the truck itself is too large, the overall viewing angle is limited, making it impossible to see the overall situation. Summary of the Invention
[0003] This application provides a 3D rendering method, apparatus, vehicle, and storage medium for a scene surrounding a vehicle, in order to solve problems such as the fixed camera position during 3D rendering in related technologies, which leads to poor rendering perspective and reduced user experience.
[0004] The first aspect of this application provides a three-dimensional rendering method for a scene surrounding a vehicle, comprising the following steps: identifying at least one preset rendering target around the vehicle; calculating an optimal rendering position based on the actual distance between the vehicle and each preset rendering target, and moving a preset camera of the vehicle to the optimal rendering position; performing three-dimensional rendering based on the actual image of the at least one preset rendering target captured by the preset camera, and generating a three-dimensional rendering result for each preset rendering target.
[0005] Based on the above technical means, the embodiments of this application can adjust the position of the camera according to the actual situation of the rendering target around the vehicle, and collect the actual image through the optimal rendering position for three-dimensional rendering, thereby obtaining a rendering result with a better perspective, avoiding rendering targets that are too large or too small and affecting the user's rendering visual experience, and greatly improving the user's experience.
[0006] Optionally, calculating the optimal rendering position based on the actual distance between the vehicle and each preset rendering target includes: matching the adjustment value of the adjustment force corresponding to each preset rendering target based on the actual distance between the vehicle and each preset rendering target; determining the direction of the adjustment force corresponding to each preset rendering target based on the actual type of each preset rendering target; obtaining an actual adjustment value and an actual adjustment direction by superimposing the actual adjustment value and the actual direction of the adjustment force corresponding to each preset rendering target; and matching the actual adjustment value and the actual adjustment direction to obtain the optimal rendering position.
[0007] Based on the above technical means, the embodiments of this application can control the parameters of the lens in a trigger-based and force-like analysis manner to achieve the effect of dynamic visual position. Since the specific parameters, such as position and pitch angle, are affected by numerical values throughout the calculation process, the tedious process of interpolating animation keyframes can be omitted, and the drawback of the difficulty of superimposing multiple animations can also be avoided.
[0008] Optionally, before obtaining the optimal rendering position by matching the actual adjustment value and the actual adjustment direction, the method further includes: obtaining the current position and initial position of the preset lens; determining the direction of the adjustment force corresponding to the preset lens based on the current position and the initial position; and correcting the actual adjustment direction based on the direction of the adjustment force corresponding to the preset lens.
[0009] Based on the above technical means, the embodiments of this application can correct and adjust the direction according to the actual position of the lens, improve the rationality and accuracy of lens adjustment, make the imaging perspective of the rendering result more in line with the user's viewing habits, and enhance the user experience.
[0010] Optionally, before calculating the optimal rendering position based on the actual distance between the vehicle and each preset rendering target, the method includes: determining whether the actual distance between any preset rendering target and the vehicle is greater than an adjustment threshold; if the actual distance between any preset rendering target and the vehicle is greater than the adjustment threshold, then the optimal rendering position is calculated; otherwise, the current position of the preset camera remains unchanged.
[0011] Based on the above technical means, the embodiments of this application can adjust the camera position when the rendering target is close to the vehicle to adapt to different rendering scenarios and improve the viewing effect of the rendering scene.
[0012] Optionally, before performing 3D rendering on the actual image of the at least one preset rendering target acquired based on the preset lens, the method includes: obtaining the actual length between the optimal rendering position and the preset center position; matching the pitch angle adjustment parameters of the preset lens based on the actual length; and adjusting the pitch angle of the preset lens to the target angle using the adjustment parameters.
[0013] Based on the above technical means, the embodiments of this application can also determine the pitch angle according to the actual position of the lens. In the entire calculation process, the numerical values affect the specific parameters. Therefore, the tedious process of interpolating keyframes for animation can be omitted, and the drawback of the difficulty in superimposing multiple animations can also be avoided.
[0014] Optionally, when performing 3D rendering based on the actual image of the at least one preset rendering target captured by the preset lens, the method further includes: identifying whether a preset playback animation exists; if the preset playback animation exists, stopping the 3D rendering, and continuing the 3D rendering after the preset playback animation finishes playing.
[0015] Based on the above technical means, in the embodiments of this application, if certain animations need to be played during the rendering process, all calculation modules can be set to inactive, thereby seamlessly connecting to keyframe animation-driven processing.
[0016] A second aspect of this application provides a 3D rendering apparatus for a scene surrounding a vehicle, comprising: an identification module for identifying at least one preset rendering target around the vehicle; a calculation module for calculating an optimal rendering position based on the actual distance between the vehicle and each preset rendering target; and a control module for moving a preset camera of the vehicle to the optimal rendering position and performing 3D rendering based on the actual image of the at least one preset rendering target captured by the preset camera, thereby generating a 3D rendering result for each preset rendering target.
[0017] Optionally, the calculation module is used to: match the adjustment value of the adjustment force corresponding to each preset rendering target according to the actual distance between the vehicle and each preset rendering target; determine the direction of the adjustment force corresponding to each preset rendering target according to the actual type of each preset rendering target; obtain the actual adjustment value and the actual adjustment direction by superimposing the actual adjustment value and the actual direction of the adjustment force corresponding to each preset rendering target, and obtain the optimal rendering position by matching the actual adjustment value and the actual adjustment direction.
[0018] Optionally, it further includes: a correction module, configured to obtain the current position and initial position of the preset lens before matching the optimal rendering position according to the actual adjustment value and the actual adjustment direction; determine the direction of the adjustment force corresponding to the preset lens according to the current position and the initial position; and correct the actual adjustment direction according to the direction of the adjustment force corresponding to the preset lens.
[0019] Optionally, it further includes: a judgment module, used to determine whether the actual distance between any preset rendering target and the vehicle is greater than an adjustment threshold before calculating the optimal rendering position based on the actual distance between the vehicle and each preset rendering target; if the actual distance between any preset rendering target and the vehicle is greater than the adjustment threshold, then the optimal rendering position is calculated, otherwise the current position of the preset lens remains unchanged.
[0020] Optionally, it further includes: an adjustment module, configured to obtain the actual length between the optimal rendering position and the preset center position before performing 3D rendering on the actual image of the at least one preset rendering target acquired based on the preset lens; match the pitch angle adjustment parameters of the preset lens based on the actual length, and adjust the pitch angle of the preset lens to the target angle using the adjustment parameters.
[0021] Optionally, the control module is further configured to identify whether a preset playback animation exists when performing 3D rendering based on the actual image of the at least one preset rendering target acquired by the preset lens; if the preset playback animation exists, the 3D rendering is stopped, and the 3D rendering continues after the preset playback animation ends.
[0022] A third aspect of this application provides a vehicle, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a three-dimensional rendering method for a scene surrounding the vehicle as described in the above embodiments.
[0023] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement a three-dimensional rendering method for a vehicle surrounding scene as described in the above embodiments.
[0024] Therefore, this application has at least the following beneficial effects:
[0025] (1) The embodiments of this application can adjust the position of the lens according to the actual situation of the rendering target around the vehicle, and collect the actual image through the best rendering position for three-dimensional rendering, so as to obtain the rendering result of a better perspective, avoid rendering targets that are too large or too small, which will affect the user's rendering visual experience and greatly improve the user's experience.
[0026] (2) The embodiments of this application can control the parameters of the lens in a trigger-based and force-like manner to achieve the effect of dynamic visual position. Since the specific parameters, such as position and pitch angle, are affected by numerical values throughout the calculation process, the tedious process of interpolating key frames of animation can be omitted, and the drawback of difficulty in superimposing multiple animations can also be avoided.
[0027] (3) The embodiments of this application can correct and adjust the direction according to the actual position of the lens, improve the rationality and accuracy of lens adjustment, make the imaging angle of the rendering result more in line with the user's viewing habits, and improve the user's user experience;
[0028] (4) The embodiments of this application can adjust the camera position when the rendering target is close to the vehicle to adapt to different rendering scenarios and improve the viewing effect of the rendering scenario;
[0029] (5) The embodiments of this application can also determine the pitch angle according to the actual position of the lens. In the entire calculation process, the numerical values affect the specific parameters. Therefore, the tedious process of interpolating key frames of animation can be omitted, and the drawback of the difficulty of superimposing multiple animations can be avoided.
[0030] (6) In this embodiment of the application, if certain animations need to be played during the rendering process, all calculation modules can be set to inactive, so that they can be seamlessly connected to keyframe animation driven.
[0031] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0032] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0033] Figure 1 This is a schematic diagram from the perspective of a vehicle in related technologies;
[0034] Figure 2 This is a flowchart of a 3D rendering method for a vehicle surrounding scene according to an embodiment of this application;
[0035] Figure 3 This is a force diagram provided according to an embodiment of this application;
[0036] Figure 4 This is a schematic diagram of the force analysis process provided according to an embodiment of this application;
[0037] Figure 5 This is a flowchart of a 3D rendering method for a vehicle surrounding scene according to an embodiment of this application;
[0038] Figure 6 This is an example diagram of a 3D rendering apparatus for a vehicle surrounding scene provided according to an embodiment of this application;
[0039] Figure 7 This is a structural schematic diagram of a vehicle provided according to an embodiment of this application. Detailed Implementation
[0040] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0041] Because dynamic scene signals change frequently, using forced and explicit segmented adjustment of the camera can result in an unsmooth rendering, especially on the vehicle's center console. For example, if the movement of a moving camera is too large or too frequent, it can distract the driver and increase the risk of accidents.
[0042] Therefore, this application embodiment employs a trigger-based, force-analysis-like method to control the lens parameters, thereby achieving a dynamic visual position effect. This application embodiment is used in vehicle intelligent driving HMI (human-machine interface) to control the lens perspective and position during 3D scene reconstruction, specifically including the control of Field of View, 3D coordinate points, and lens rotation.
[0043] The following description, with reference to the accompanying drawings, describes a 3D rendering method, apparatus, vehicle, and storage medium for a scene surrounding a vehicle according to embodiments of this application. Specifically, Figure 2 This is a flowchart illustrating a three-dimensional rendering method for a scene surrounding a vehicle, as provided in an embodiment of this application.
[0044] like Figure 1 As shown, the 3D rendering method for the scene surrounding the vehicle includes the following steps:
[0045] In step S101, at least one preset rendering target around the vehicle is identified.
[0046] The preset rendering target can be set according to the actual rendering needs, such as large vehicles and pedestrians, without specific limitations.
[0047] It is understood that the embodiments of this application can identify targets that need to be rendered around the vehicle through sensors or other means, and the specific identification method is not specifically limited.
[0048] In step S102, the optimal rendering position is calculated based on the actual distance between the vehicle and each preset rendering target, and the preset camera of the vehicle is moved to the optimal rendering position.
[0049] The optimal rendering position can be understood as the best shooting position for the camera, used to achieve optimal rendering of the surrounding scene and avoid issues such as... Figure 1 The vehicle shown is always centered on the screen, even when surrounded by various vehicles and road conditions; the preset camera can be set according to the actual situation without specific limitations.
[0050] It is understood that, in the embodiments of this application, the optimal rendering position can be determined based on the distance between the preset rendering target and the vehicle, and after determining the optimal rendering position, the lens can be moved to the designated position to complete the lens position adjustment.
[0051] In this embodiment of the application, the optimal rendering position is calculated based on the actual distance between the vehicle and each preset rendering target, including: matching the adjustment value of the adjustment force corresponding to each preset rendering target based on the actual distance between the vehicle and each preset rendering target; determining the direction of the adjustment force corresponding to each preset rendering target based on the actual type of each preset rendering target; obtaining the actual adjustment value and the actual adjustment direction by superimposing the actual adjustment value and the actual adjustment direction of the adjustment force corresponding to each preset rendering target, and obtaining the optimal rendering position by matching the actual adjustment value and the actual adjustment direction.
[0052] It is understood that the embodiments of this application can control the parameters of the lens in a trigger-based and force-like manner to achieve the effect of dynamic visual position. Since the specific parameters, such as position and pitch angle, are affected by numerical values throughout the calculation process, the tedious process of interpolating animation keyframes can be omitted, and the drawback of the difficulty of superimposing multiple animations can be avoided.
[0053] Specifically, taking large vehicles and pedestrians as preset rendering targets, when a large vehicle approaches the vehicle and the horizontal distance is less than a threshold (e.g., about 1 meter), a constant force is generated in the upper right direction, such as... Figure 3 The arrow marked 1 is shown. The rule for pedestrians is that when a pedestrian is 10 meters ahead, a vertically upward force will be generated, such as... Figure 3 The arrow labeled 2 is shown. For clarity, the magnitudes of the two forces are set differently, but this can be adjusted in actual operation. Figure 3 In the diagram, a virtual force 1 is applied by the bus on the left side of the vehicle, and a virtual force 2 is applied by the pedestrian on the right side. The directions of these two forces are indicated by the arrows in the diagram, and the magnitudes of the forces are the lengths of the arrows. Neither force has been normalized. The magnitudes of the forces can be adjusted by program parameters, and the directions can also be set manually.
[0054] This application embodiment allows all force-generating modules to be added to a container within the program for easy subsequent adjustments. Furthermore, for ease of debugging, each force-generating module is assigned a `name` field to specify which forces are currently in effect. If an error occurs, the `name` field is printed for troubleshooting.
[0055] During vehicle movement, the surrounding dynamic information needed for rendering is passed to the program through an intermediate layer, which can select large vehicles and pedestrian information. This real-time data is passed to the large vehicle module and the pedestrian module, and the GetForce() method of each module is called to obtain a 3D vector data. If a vehicle reaches the trigger force range, a non-zero force will be generated. Similarly, when a pedestrian reaches the trigger force range, a non-zero force will also be generated. If the threshold condition for generating a force is not met, the generated force is 0 and has no effect.
[0056] It is called after the main program loops through all the force-generating modules, accumulating and superimposing all the forces, such as... Figure 4 As shown, determine the final camera movement direction. Wherein, Figure 4 This refers to the force analysis process using Newtonian mechanics, as shown in the diagram. Figure 3 The forces generated during the rendering process were analyzed. The resultant force, formed by the forces of vector 1 and vector 2, influences the camera's movement direction during scene rendering. Similarly, it can affect the camera's FOV parameter and other adjustable parameters. After the force analysis, the movement speed is mapped to the magnitude of the resultant force, and finally, the camera is moved to the designated position to complete the camera position adjustment.
[0057] In this embodiment of the application, before obtaining the optimal rendering position by matching the actual adjustment value and the actual adjustment direction, the method further includes: obtaining the current position and initial position of the preset lens; determining the direction of the adjustment force corresponding to the preset lens based on the current position and the initial position; and correcting the actual adjustment direction based on the direction of the adjustment force corresponding to the preset lens.
[0058] It is understandable that when the lens position is not in the default initial position, a force will be generated towards the initial position. Therefore, the embodiments of this application can correct and adjust the direction according to the actual position of the lens, improve the rationality and accuracy of lens adjustment, make the imaging perspective of the rendering result more in line with the user's viewing habits, and improve the user experience.
[0059] Before calculating the optimal rendering position based on the actual distance between the vehicle and each preset rendering target, the process includes: determining whether the actual distance between any preset rendering target and the vehicle is greater than an adjustment threshold; if the actual distance between any preset rendering target and the vehicle is greater than the adjustment threshold, then the optimal rendering position is calculated; otherwise, the current position of the preset camera remains unchanged.
[0060] The threshold can be adjusted according to the actual situation. For example, the threshold for large vehicles can be set to 1 meter or 2 meters, and the threshold for pedestrians can be set to 10 or 15 meters, without specific limitations.
[0061] It is understood that the embodiments of this application can adjust the camera position when the rendering target is close to the vehicle to adapt to different rendering scenarios and improve the viewing effect of the rendering scenario.
[0062] In step S103, three-dimensional rendering is performed on the actual image of at least one preset rendering target captured by a preset lens to generate a three-dimensional rendering result for each preset rendering target.
[0063] It is understood that the embodiments of this application can perform 3D rendering after the camera adjustment is completed. In the entire calculation process, numerical values affect specific parameters, such as position and pitch angle, thereby omitting the tedious process of traditional animation keyframe interpolation and avoiding the drawback of difficulty in superimposing multiple animations.
[0064] In this embodiment of the application, before performing 3D rendering on the actual image of at least one preset rendering target acquired by a preset lens, the method includes: obtaining the actual length between the optimal rendering position and the preset center position; matching the pitch angle adjustment parameters of the preset lens based on the actual length; and adjusting the pitch angle of the preset lens to the target angle using the adjustment parameters.
[0065] It is understood that the embodiments of this application can also use the length of the new position from the center position to map other parameter adjustments, such as the FOV of the camera, which shrinks after moving away from the center position, with the shrinkage amount varying according to the distance. Therefore, the embodiments of this application can also determine the pitch angle based on the actual position of the camera. Since the entire calculation process involves numerical values affecting specific parameters, the tedious process of interpolating animation keyframes can be omitted, and the drawback of the difficulty in superimposing multiple animations can be avoided.
[0066] It should be noted that the above steps can be repeated in this embodiment until the program exits. Throughout the process, all modules can be freely added or removed as needed. Removing a class that calculates a single force has no impact on the overall program operation; it simply means the corresponding force is no longer involved. Adding a new class can handle new calculation requirements without requiring a complete redesign, achieving flexible scalability. Debugging also becomes easier because specific error points are divided into smaller modules, making it very user-friendly for the overall development process.
[0067] In this embodiment of the application, when performing 3D rendering on an actual image of at least one preset rendering target captured by a preset lens, the method further includes: identifying whether a preset playback animation exists; if a preset playback animation exists, stopping the 3D rendering and continuing the 3D rendering after the preset playback animation ends.
[0068] Understandably, if certain animations need to be played during the process, all calculation modules can be set to inactive, thus seamlessly transitioning to traditional keyframe animation-driven animation.
[0069] The following specific embodiments illustrate the three-dimensional rendering method for the scene around the vehicle. In this embodiment, the camera can be adjusted using a system including a force module, a force analysis module, an external signal module, a parameter adjustment module, and a program backbone module.
[0070] Specifically, 1. External signal module
[0071] This module forwards external signals to internal processing, such as transmitting the distance to surrounding vehicles for subsequent processing.
[0072] 2. Force-bearing module
[0073] This module is responsible for generating force classes that are designed by humans. Each force-generating class has a public method called GetForce(), which is used to calculate the magnitude and direction of the force.
[0074] 3. Force Analysis Module
[0075] This module stores all force modules and obtains the force of each force module before each drawing, and calculates the resultant force of all forces.
[0076] 4. Parameter adjustment module
[0077] This module is used to map the force analysis results with other parameters that need to be adjusted, so as to achieve the result that force affects motion.
[0078] 5. Main Program Module
[0079] This is used to schedule the various modules mentioned above, such as initializing each module during program runtime. Each time the program draws, it calls the corresponding methods of other modules to drive the entire calculation process.
[0080] Based on the above system, the 3D rendering method for the scene around the vehicle is as follows: Figure 5 As shown, the program starts by loading various configuration parameters and force-generating modules. Then, before rendering each frame, it iterates through all the force-generating code, calculates the resultant force, performs force analysis, and finally adjusts the camera position to achieve correct rendering.
[0081] In summary, the lens parameter control method based on the force analysis principle of this application can achieve flexible, fast and accurate expression of the changes in lens and other related parameters under various conditions during driving. It has the characteristics of low overall code overhead, low production cost, and smooth transition between various states.
[0082] The 3D rendering method for a vehicle surrounding scene proposed in this application can adjust the camera position according to the actual situation of the rendering target around the vehicle. It captures actual images from the optimal rendering position for 3D rendering, thereby obtaining a better rendering result from a better perspective. This avoids rendering targets that are too large or too small, which could negatively impact the user's visual experience and greatly improve the user experience. The camera parameters can be controlled using trigger-based and force-like analysis methods to achieve a dynamic visual position effect. Since numerical values influence specific parameters such as position and pitch angle throughout the calculation process, the tedious process of keyframe interpolation for animation can be omitted, and the difficulty of superimposing multiple animations can be avoided. The camera direction can be corrected and adjusted according to its actual position, improving the rationality and accuracy of camera adjustments, making the rendering result's imaging perspective more in line with the user's viewing habits and enhancing the user experience. The camera position can be adjusted when the rendering target is close to the vehicle to adapt to different rendering scenarios and improve the viewing effect of the rendered scene. If certain animations need to be played during the rendering process, all calculation modules can be set to inactive, allowing for seamless transitions to keyframe animation-driven rendering.
[0083] Next, referring to the accompanying drawings, a three-dimensional rendering apparatus for a vehicle surrounding scene according to an embodiment of this application is described.
[0084] Figure 6 This is a block diagram of a three-dimensional rendering device for a scene around a vehicle according to an embodiment of this application.
[0085] like Figure 6 As shown, the 3D rendering device 10 for the scene around the vehicle includes: a recognition module 100, a calculation module 200, and a control module 300.
[0086] The identification module 100 is used to identify at least one preset rendering target around the vehicle; the calculation module 200 is used to calculate the optimal rendering position based on the actual distance between the vehicle and each preset rendering target; and the control module 300 is used to move the vehicle's preset camera to the optimal rendering position and perform three-dimensional rendering based on the actual image of at least one preset rendering target captured by the preset camera, generating a three-dimensional rendering result for each preset rendering target.
[0087] In this embodiment of the application, the calculation module 200 is used to: match the adjustment value of the adjustment force corresponding to each preset rendering target according to the actual distance between the vehicle and each preset rendering target; determine the direction of the adjustment force corresponding to each preset rendering target according to the actual type of each preset rendering target; obtain the actual adjustment value and the actual adjustment direction by superimposing the actual adjustment value and the actual direction of the adjustment force corresponding to each preset rendering target, and obtain the optimal rendering position by matching the actual adjustment value and the actual adjustment direction.
[0088] In this embodiment of the application, the apparatus 10 further includes a correction module. The correction module is configured to: obtain the current position and initial position of a preset lens before matching the optimal rendering position based on the actual adjustment value and the actual adjustment direction; determine the direction of the adjustment force corresponding to the preset lens based on the current position and the initial position; and correct the actual adjustment direction based on the direction of the adjustment force corresponding to the preset lens.
[0089] In this embodiment of the application, the apparatus 10 further includes a judgment module. The judgment module is configured to determine whether the actual distance between any preset rendering target and the vehicle is greater than an adjustment threshold before calculating the optimal rendering position based on the actual distance between the vehicle and each preset rendering target; if the actual distance between any preset rendering target and the vehicle is greater than the adjustment threshold, then the optimal rendering position is calculated; otherwise, the current position of the preset camera remains unchanged.
[0090] In this embodiment of the application, the apparatus 10 further includes an adjustment module. The adjustment module is used to obtain the actual length between the optimal rendering position and the preset center position before performing 3D rendering on an actual image of at least one preset rendering target acquired by a preset lens; match the pitch angle adjustment parameters of the preset lens based on the actual length; and adjust the pitch angle of the preset lens to the target angle using the adjustment parameters.
[0091] In this embodiment of the application, the control module 300 is further configured to identify whether a preset playback animation exists when performing 3D rendering based on the actual image of at least one preset rendering target acquired by a preset lens; if a preset playback animation exists, the 3D rendering is stopped, and 3D rendering continues after the preset playback animation ends.
[0092] It should be noted that the explanation of the above-mentioned three-dimensional rendering method embodiment for the scene around the vehicle also applies to the three-dimensional rendering device for the scene around the vehicle in this embodiment, and will not be repeated here.
[0093] The 3D rendering device for a vehicle surrounding scene proposed in this application can adjust the position of the camera according to the actual situation of the rendering target around the vehicle. It can acquire actual images from the optimal rendering position for 3D rendering, thereby obtaining a rendering result with a better perspective. This avoids rendering targets that are too large or too small, which could negatively impact the user's rendering visual experience and greatly improve the user experience. The camera parameters can be controlled using trigger-based and force-like analysis methods to achieve a dynamic visual position effect. Since numerical values influence specific parameters such as position and pitch angle throughout the calculation process, the tedious process of keyframe interpolation for animation can be omitted, and the difficulty of superimposing multiple animations can be avoided. The camera direction can be corrected and adjusted according to its actual position, improving the rationality and accuracy of camera adjustments, making the rendering result's imaging perspective more in line with the user's viewing habits and enhancing the user experience. The camera position can be adjusted when the rendering target is close to the vehicle to adapt to different rendering scenarios and improve the viewing effect of the rendering scene. If certain animations need to be played during the rendering process, all calculation modules can be set to inactive, allowing for seamless transitions to keyframe animation-driven rendering.
[0094] Figure 7 A schematic diagram of the structure of a vehicle provided in an embodiment of this application. The vehicle may include:
[0095] The memory 701, the processor 702, and the computer program stored on the memory 701 and executable on the processor 702.
[0096] When the processor 702 executes the program, it implements the three-dimensional rendering method for the scene around the vehicle provided in the above embodiments.
[0097] Furthermore, the vehicle also includes:
[0098] Communication interface 703 is used for communication between memory 701 and processor 702.
[0099] The memory 701 is used to store computer programs that can run on the processor 702.
[0100] The memory 701 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.
[0101] If the memory 701, processor 702, and communication interface 703 are implemented independently, then the communication interface 703, memory 701, and processor 702 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0102] Optionally, in a specific implementation, if the memory 701, processor 702, and communication interface 703 are integrated on a single chip, then the memory 701, processor 702, and communication interface 703 can communicate with each other through an internal interface.
[0103] The processor 702 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.
[0104] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for rendering a 3D scene around a vehicle.
[0105] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0106] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0107] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0108] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.
[0109] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0110] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A method for rendering a 3D scene around a vehicle, characterized in that, Includes the following steps: Identify at least one pre-defined rendered target around the vehicle; The optimal rendering position is calculated based on the actual distance between the vehicle and each preset rendering target, and the preset camera of the vehicle is moved to the optimal rendering position. Based on the actual image of the at least one preset rendering target captured by the preset lens, perform three-dimensional rendering to generate a three-dimensional rendering result for each preset rendering target; The step of calculating the optimal rendering position based on the actual distance between the vehicle and each preset rendering target includes: The adjustment value of the corresponding adjustment force for each preset rendering target is matched according to the actual distance between the vehicle and each preset rendering target. The direction of the adjustment force corresponding to each preset rendering target is determined according to the actual type of each preset rendering target; The actual adjustment value and actual adjustment direction are obtained by superimposing the actual adjustment value and actual direction of the adjustment force corresponding to each preset rendering target, and the optimal rendering position is obtained by matching the actual adjustment value and actual adjustment direction.
2. The method according to claim 1, characterized in that, Before determining the optimal rendering position based on the actual adjustment value and the actual adjustment direction, the process also includes: Obtain the current position and initial position of the preset lens; The direction of the adjustment force corresponding to the preset lens is determined based on the current position and the initial position; The actual adjustment direction is corrected according to the direction of the adjustment force corresponding to the preset lens.
3. The method according to claim 1, characterized in that, Before calculating the optimal rendering position based on the actual distance between the vehicle and each preset rendering target, the following steps are included: Determine whether the actual distance between any preset rendering target and the vehicle is greater than the adjustment threshold; If the actual distance between any preset rendering target and the vehicle is greater than the adjustment threshold, then the optimal rendering position is calculated; otherwise, the current position of the preset camera remains unchanged.
4. The method according to claim 1, characterized in that, Before performing 3D rendering on the actual image of the at least one preset rendering target acquired based on the preset lens, the process includes: Obtain the actual length between the optimal rendering position and the preset center position; The pitch angle adjustment parameters of the preset lens are matched based on the actual length, and the pitch angle of the preset lens is adjusted to the target angle using the adjustment parameters.
5. The method according to claim 1, characterized in that, When performing 3D rendering based on the actual image of the at least one preset rendering target acquired by the preset lens, the method further includes: Identify whether a preset playback animation exists; If the preset playback animation exists, the 3D rendering is stopped, and the 3D rendering continues after the preset playback animation finishes playing.
6. A three-dimensional rendering device for a scene surrounding a vehicle, characterized in that, include: The recognition module is used to identify at least one preset rendering target around the vehicle; The calculation module is used to calculate the optimal rendering position based on the actual distance between the vehicle and each preset rendering target; The control module is used to move the preset camera of the vehicle to the optimal rendering position, and perform three-dimensional rendering based on the actual image of the at least one preset rendering target captured by the preset camera, so as to generate a three-dimensional rendering result for each preset rendering target. The calculation module is used for: The adjustment value of the corresponding adjustment force for each preset rendering target is matched according to the actual distance between the vehicle and each preset rendering target. The direction of the adjustment force corresponding to each preset rendering target is determined according to the actual type of each preset rendering target; The actual adjustment value and actual adjustment direction are obtained by superimposing the actual adjustment value and actual direction of the adjustment force corresponding to each preset rendering target, and the optimal rendering position is obtained by matching the actual adjustment value and actual adjustment direction.
7. A vehicle, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement a three-dimensional rendering method for a scene surrounding a vehicle as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the three-dimensional rendering method for the scene around the vehicle as described in any one of claims 1-5.