Rendering method and device, computer equipment and storage medium
By distinguishing the camera coordinate system area in the camera coordinate system of the target vehicle, only objects with close distances are generated, the problems of waste of resources and low rendering efficiency caused by the superposition of multiple objects are solved, and the authenticity of the rendering results are improved. Visual experience.
Patent Information
- Application Number
- CN202411323909.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-20
AI Technical Summary
In a human-machine co-driving scene, the superposition of reflection objects of multiple objects leads to waste of resources and the reality of rendering results, and it takes a long time to generate reflection objects, resulting in lag and visual mess.
By determining the first camera coordinate system area and the second camera coordinate system area in the camera coordinate system of the target vehicle, only the reflection object of the first target object with a nearer distance is generated, and no reflection of the second target object with a far distance is generated Objects, save resources and improve rendering efficiency.
Avoid resource waste, reduce rendering time, improve the authenticity and visual experience of rendering results, and avoid visual mess caused by superposition of reflected objects.
Smart Images

Figure CN119169196A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a rendering method, apparatus, computer equipment and storage medium. Background Art
[0002] In some scenarios, such as human-machine co-driving scenarios, obtaining the rendering results of objects that need to be rendered in the area where the vehicle is located by rendering and displaying the rendering results of the objects that need to be rendered are key technologies of intelligent driving systems such as Advanced Driving Assistance System (ADAS) systems. Rendering the objects that need to be rendered includes generating a three-dimensional (3D) model of the objects that need to be rendered. At the same time, since objects in the real world, such as buildings, have reflections, in order to enhance the realism of the rendering results and improve the quality of the rendering results, rendering the objects that need to be rendered also includes generating a reflection object representing the reflection of the objects that need to be rendered.
[0003] In the related art, a reflection object of each object to be rendered in the area where the vehicle is located is generated during the rendering process. However, the reflection objects of multiple objects in a front-to-back position relationship are superimposed, which is equivalent to repeatedly generating substantially the same reflection objects, resulting in over-drawing, i.e., repeatedly drawing the same screen pixels, wasting resources used for rendering. How to save resources used for rendering has become a problem that needs to be solved. Summary of the invention
[0004] In view of this, embodiments of the present disclosure provide a rendering method, apparatus, computer device, and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a rendering method, the method comprising:
[0006] Obtaining positions of a plurality of target objects in a camera coordinate system of a camera of a target vehicle, wherein the target objects are objects to be rendered whose positions in the world space are in a target world space region related to a current position of the target vehicle;
[0007] Determine, from among the multiple target objects, a first target object whose position in the camera coordinate system is within a first camera coordinate system region, and determine, from among the multiple target objects, a second target object whose position in the camera coordinate system is within a second camera coordinate system region, wherein a distance between a first world space region corresponding to the first camera coordinate system region and the current position is smaller than a distance between a second world space region corresponding to the second camera coordinate system region and the current position, and the second camera coordinate system region is a region in the target camera coordinate system region corresponding to the target world space region in the camera coordinate system excluding the first camera coordinate system region;
[0008] A first rendering is performed on the first target object, and a second rendering is performed on the second target object. The first rendering includes: generating a three-dimensional model of the first target object and a reflection object representing a reflection of the first target object. The second rendering includes: generating a three-dimensional model of the second target object.
[0009] In a possible implementation, it also includes:
[0010] A first camera coordinate system area is determined according to a horizontal coordinate value of a horizontal coordinate axis boundary on the horizontal coordinate axis in the camera coordinate system and a vertical coordinate value of a vertical coordinate axis boundary on the vertical coordinate axis in the camera coordinate system.
[0011] In a possible implementation, determining the first camera coordinate system area according to a horizontal coordinate value of a horizontal axis boundary on the horizontal axis in the camera coordinate system and a vertical coordinate value of a vertical axis boundary on the vertical axis in the camera coordinate system includes:
[0012] The first camera coordinate system area is determined according to the horizontal coordinate value of the positive direction boundary of the horizontal axis of the camera coordinate system, the horizontal coordinate value of the negative direction boundary of the horizontal axis of the camera coordinate system, the vertical coordinate value of the positive direction boundary of the vertical axis of the camera coordinate system, and the vertical coordinate value of the negative direction boundary of the vertical axis of the camera coordinate system.
[0013] In a possible implementation manner, determining, from a plurality of target objects, a first target object whose position in the camera coordinate system is within a first camera coordinate system area includes:
[0014] When the target object satisfies the first condition and / or the second condition, the target object is determined as the first target object, wherein the first condition is that the horizontal coordinate value of the position of the target object in the camera coordinate system is greater than the horizontal coordinate value of the negative boundary of the horizontal coordinate axis and is less than the horizontal coordinate value of the positive boundary of the horizontal coordinate axis, and the second condition is that the vertical coordinate value of the position of the target object in the camera coordinate system is greater than the vertical coordinate value of the negative boundary of the vertical coordinate axis and is less than the vertical coordinate value of the positive boundary of the vertical coordinate axis.
[0015] In a possible implementation, it also includes:
[0016] Based on the high-precision map, multiple target objects are identified.
[0017] In a possible implementation, the multiple target objects include: a building that needs to be rendered and whose position in the world space is in a target world space area related to the current position of the target vehicle.
[0018] In a second aspect, an embodiment of the present disclosure provides a rendering device, the rendering device comprising:
[0019] an acquisition unit, configured to acquire positions of a plurality of target objects in a camera coordinate system of a camera of a target vehicle, wherein the target objects are objects to be rendered whose positions in the world space are in a target world space region associated with a current position of the target vehicle;
[0020] a determining unit, configured to determine, from among a plurality of target objects, a first target object whose position in the camera coordinate system is within a first camera coordinate system region, and to determine, from among a plurality of target objects, a second target object whose position in the camera coordinate system is within a second camera coordinate system region, wherein a distance between a first world space region corresponding to the first camera coordinate system region and the current position is smaller than a distance between a second world space region corresponding to the second camera coordinate system region and the current position, and the second camera coordinate system region is a region in the target camera coordinate system region excluding the first camera coordinate system region;
[0021] The rendering unit is used to perform a first rendering on a first target object and a second rendering on a second target object, wherein the first rendering includes: generating a three-dimensional model of the first target object and a reflection object representing a reflection of the first target object, and the second rendering includes: generating a three-dimensional model of the second target object.
[0022] In a possible implementation, the rendering device further includes:
[0023] The first camera coordinate system area determining unit is used to determine the first camera coordinate system area according to the horizontal coordinate value of the horizontal coordinate axis boundary on the horizontal coordinate axis in the camera coordinate system and the vertical coordinate value of the vertical coordinate axis boundary on the vertical coordinate axis in the camera coordinate system.
[0024] In one possible implementation, the first camera coordinate system area determination unit is further used to determine the first camera coordinate system area based on the horizontal coordinate value of the positive direction boundary of the horizontal axis in the camera coordinate system, the horizontal coordinate value of the negative direction boundary of the horizontal axis in the camera coordinate system, the vertical coordinate value of the positive direction boundary of the vertical axis in the camera coordinate system, and the vertical coordinate value of the negative direction boundary of the vertical axis in the camera coordinate system.
[0025] In one possible implementation, the determination unit is further used to determine the target object as the first target object when the target object satisfies a first condition and / or a second condition, wherein the first condition is that the horizontal coordinate value of the position of the target object in the camera coordinate system is greater than the horizontal coordinate value of the negative boundary of the horizontal coordinate axis and is less than the horizontal coordinate value of the positive boundary of the horizontal coordinate axis, and the second condition is that the vertical coordinate value of the position of the target object in the camera coordinate system is greater than the vertical coordinate value of the negative boundary of the vertical coordinate axis and is less than the vertical coordinate value of the positive boundary of the vertical coordinate axis.
[0026] In a possible implementation, the rendering device further includes:
[0027] The target object determination unit is used to determine multiple target objects based on the high-precision map.
[0028] In a possible implementation, the multiple target objects include: a building that needs to be rendered and whose position in the world space is in a target world space area related to the current position of the target vehicle.
[0029] In a third aspect, an embodiment of the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0030] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding implementation manner thereof.
[0031] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0032] The rendering method provided by the embodiment of the present disclosure generates a reflection object of the first target object whose position in the camera coordinate system of the camera of the target vehicle is within the area of the first camera coordinate system, and does not generate a reflection object of the second target object whose position in the camera coordinate system of the camera of the target vehicle is within the area of the second camera coordinate system. The distance between the first world space area corresponding to the first camera coordinate system area and the current position of the target vehicle is less than the distance between the second world space area corresponding to the second camera coordinate system area and the current position of the target vehicle. Therefore, it is equivalent to generating a reflection object of the first target object in the first world space area that is closer to the current position of the target vehicle, and not generating a reflection object of the second target object in the second world space area that is farther from the current position of the target vehicle. Resources used for rendering are saved. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 is a schematic diagram of the principle of the rendering method provided by an embodiment of the present disclosure;
[0035] Figure 2 is a flowchart of a rendering method provided by an embodiment of the present disclosure;
[0036] Figure 3 is a flowchart of another rendering method provided by an embodiment of the present disclosure;
[0037] Figure 4 is a schematic diagram of an example of a first camera coordinate system area and a second camera coordinate system area;
[0038] Figure 5 is a flowchart of an example of determining whether to generate a reflection object of an object;
[0039] Figure 6 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0041] In order to solve the problem of how to save resources used for rendering, the embodiments of the present disclosure provide a rendering method.
[0042] In the related art, a reflection object of each object to be rendered is generated during the rendering process. However, the reflection objects of multiple objects with a front-to-back position relationship are superimposed, which is equivalent to repeatedly generating substantially the same reflection object. This leads to over-drawing, i.e., repeatedly drawing the same screen pixels, wasting resources for rendering. How to save resources for rendering becomes a problem that needs to be solved. In addition, it takes a long time to generate the reflection object of each object to be rendered, resulting in a freeze when displaying the rendering result of each object to be rendered. In addition, in the real world, the reflection of the frontmost object among the multiple objects with a front-to-back position relationship covers the reflection of the object behind the frontmost object among the multiple objects with a front-to-back position relationship, and the reflection of the object behind the frontmost object among the multiple objects with a front-to-back position relationship cannot be seen in the real world. Generating a reflection object for each object to be rendered reduces the authenticity of the rendering result of the object to be rendered. In addition, the visual effect of the superposition of the reflection objects of multiple objects with a front-to-back position relationship is messy and disordered, resulting in a poor visual experience for the person viewing the rendering result in the target vehicle.
[0043] The rendering method provided by the embodiment of the present disclosure generates a reflection object of the first target object whose position in the camera coordinate system of the camera of the target vehicle is within the area of the first camera coordinate system, and does not generate a reflection object of the second target object whose position in the camera coordinate system of the camera of the target vehicle is within the area of the second camera coordinate system. The distance between the first world space area corresponding to the first camera coordinate system area and the current position of the target vehicle is less than the distance between the second world space area corresponding to the second camera coordinate system area and the current position of the target vehicle. Therefore, it is equivalent to generating a reflection object of the first target object in the first world space area that is closer to the current position of the target vehicle, and not generating a reflection object of the second target object in the second world space area that is farther from the current position of the target vehicle. Resources used for rendering are saved.
[0044] In addition, the rendering method provided by the embodiment of the present disclosure can avoid the time-consuming generation of the reflection object of each object to be rendered, which causes a freeze when displaying the rendering result of each object to be rendered. It can also avoid the situation where the generation of the reflection object of each object to be rendered reduces the realism of the rendering result of the object to be rendered. It can also avoid the situation where the superposition of the reflection objects of multiple objects with a front-to-back position relationship creates a messy and disordered visual effect, causing a poor visual experience for people in the target vehicle who view the rendering results.
[0045] refer to Figure 1 , which shows a schematic diagram of the principle of the rendering method provided by an embodiment of the present disclosure.
[0046] Figure 1The diagram shows an origin 101 of the camera coordinate system of the target vehicle's camera, a 3D model 102 of a building whose position in the camera coordinate system of the target vehicle's camera is within the area of the first camera coordinate system, and a reflection object 103 of the building whose position in the camera coordinate system of the target vehicle's camera is within the area of the first camera coordinate system. The diagram also shows 3D models 104 of multiple buildings whose positions in the camera coordinate system of the target vehicle's camera are within the area of the second camera coordinate system.
[0047] It should be noted that the reflection object representing the reflection of the building may specifically refer to a translucent reflection object representing the reflection of the building. During rendering, an opaque material is applied to the 3D model of the building to obtain a 3D model of the building with an opaque material, and the 3D model of the building with the opaque material represents the building. A translucent material is applied to the copied 3D model of the building, i.e., a copy of the 3D model of the building, to obtain a translucent copied 3D model of the building, and the translucent copied 3D model of the building is used as a reflection object representing the reflection of the building. The reflection object representing the reflection of the building is placed under the 3D model of the building to form a display effect of the reflection of the building. While displaying the 3D model of the building, the reflection object representing the reflection of the building is displayed.
[0048] like Figure 1 As shown, a reflection object of a building whose position in the camera coordinate system of the target vehicle's camera is within the first camera coordinate system area is generated, and a reflection object of a building whose position in the camera coordinate system of the target vehicle's camera is within the second camera coordinate system area is not generated.
[0049] The distance between the first world space region corresponding to the first camera coordinate system region and the current position of the target vehicle is smaller than the distance between the second world space region corresponding to the second camera coordinate system region and the current position of the target vehicle. Therefore, a reflection object of a building in the first world space region that is closer to the current position of the target vehicle is generated, and a reflection object of a building in the second world space region that is farther from the current position of the target vehicle is not generated.
[0050] The second world space region corresponding to the second camera coordinate system region is: a region in the target world space region related to the current position of the target vehicle except the first world space region corresponding to the first camera coordinate system region.
[0051] The rendering method provided by the embodiment of the present disclosure can avoid the following situation: it takes a long time to generate the reflection object of each building in the target area, resulting in a freeze when displaying the rendering result of each object that needs to be rendered.
[0052] The rendering method provided by the embodiments of the present disclosure can avoid the following situations: generating a reflection object of a building whose position in the camera coordinate system of the target vehicle's camera is within the area of the first camera coordinate system, and generating a reflection object of a building whose position in the camera coordinate system of the target vehicle's camera is within the area of the second camera coordinate system. However, in the real world, the building whose position in the camera coordinate system of the target vehicle's camera is within the area of the first camera coordinate system is located before the building whose position in the camera coordinate system of the target vehicle's camera is within the area of the second camera coordinate system. The reflection of the building whose position in the camera coordinate system of the target vehicle's camera is within the area of the second camera coordinate system covers the reflection of any building whose position in the camera coordinate system of the target vehicle's camera is within the area of the second camera coordinate system. The reflection of any building whose position in the camera coordinate system of the target vehicle's camera is within the area of the second camera coordinate system cannot be seen in the real world. Instead, the reflection object of the building whose position in the camera coordinate system of the target vehicle's camera is within the area of the second camera coordinate system reduces the realism of the rendering result of the object to be rendered.
[0053] The rendering method provided by the embodiment of the present disclosure can avoid the following situation: the superposition of the reflection object of the building whose position in the camera coordinate system of the target vehicle's camera is within the area of the first camera coordinate system and the reflection object of the building whose position in the camera coordinate system of the target vehicle's camera is within the area of the second camera coordinate system creates a messy and disordered visual effect, resulting in a poor visual experience for people in the target vehicle who view the rendering results.
[0054] refer to Figure 2 , which shows a flowchart of the rendering method provided by an embodiment of the present disclosure.
[0055] In step S201 , positions of a plurality of target objects in a camera coordinate system of a camera of a target vehicle are acquired.
[0056] The target object is an object that needs to be rendered and whose position in the world space is in a target world space region related to the current position of the target vehicle.
[0057] The origin of the camera coordinate system of the target vehicle's camera is the optical center of the target vehicle's camera. The camera coordinate system of the target vehicle's camera includes: an X coordinate axis of the camera coordinate system of the target vehicle's camera, a Y coordinate axis of the camera coordinate system of the target vehicle's camera, and a Z coordinate axis of the camera coordinate system of the target vehicle's camera.
[0058] The X-axis of the camera coordinate system of the target vehicle's camera is the horizontal axis of the camera coordinate system of the target vehicle's camera, and the Y-axis of the camera coordinate system of the target vehicle's camera is the vertical axis of the camera coordinate system of the target vehicle's camera. The Z-axis of the camera coordinate system of the target vehicle's camera is perpendicular to the X-axis of the camera coordinate system of the target vehicle's camera and perpendicular to the Y-axis of the camera coordinate system of the target vehicle's camera.
[0059] In the embodiment of the present disclosure, the target world space area related to the current position of the target vehicle is the world space, that is, the ground area in the real world.
[0060] The current position of the target vehicle may specifically refer to: the current position of the target vehicle in the world space, that is, the real world. The current position of the target vehicle in the world space may be the position of the target vehicle in the world space at the moment when step S201 is started.
[0061] The current position of the target vehicle may be represented by three-dimensional coordinates of the current position of the target vehicle in a world coordinate system.
[0062] It should be noted that in the embodiments of the present disclosure, the size and shape of the target world space area can be preset.
[0063] As an example, the target world space area is a circular area with a preset radius and a current position of the target vehicle as a center point.
[0064] As another example, the target world space region is a semicircular region in a circular region with the current position of the target vehicle as the center point, and the target object in the target world space region is directly in front of, right in front of, or left in front of the current position of the target vehicle.
[0065] It should be noted that the position of an object in the world space may specifically refer to: the position of a target point of the object in the world space.
[0066] As an example, the target point of an object is the center point of the object or the geometric center of the object.
[0067] For a target object, the position of the target object in the world space can be represented by three-dimensional coordinates in the world coordinate system.
[0068] For a target object, a navigation system such as Beidou navigation can provide the longitude and latitude representing the position of the target object in the world space. The longitude and latitude representing the position of the target object in the world space are converted into three-dimensional coordinates in the world coordinate system representing the position of the target object in the world space.
[0069] It should be noted that the position of the target object in the world space in the target world space region related to the current position of the target vehicle may specifically mean that the position of the target object on the ground in the world space is in the target world space region related to the current position of the target vehicle.
[0070] The position of an object on the ground in the world space may be: a projected position obtained by vertically projecting the position of an object in the world space onto the ground in the world space.
[0071] The position of an object in the world space, i.e., the ground in the real world, can be represented by the X-axis coordinate value in the three-dimensional coordinates representing the position of the object in the world space and the Y-axis coordinate value in the three-dimensional coordinates representing the position of the object in the world space.
[0072] For an object, if the position of the object in the ground in the world space is in the target world space region associated with the current position of the target vehicle, then the position of the object in the world space is in the target world space region associated with the current position of the target vehicle.
[0073] In the embodiment of the present disclosure, for a target object, the position of the target object in the camera coordinate system of the target vehicle's camera can be determined based on the position of the target object in the world space, the mapping relationship between the position of an object in the world space and the position of the object in the camera coordinate system of the target vehicle's camera.
[0074] In the embodiment of the present disclosure, before step S201, multiple target objects may be determined.
[0075] In one possible implementation, multiple target objects are determined based on a high-precision map. Multiple rendering types can be preset. Objects of the rendering type are objects that need to be rendered. Multiple target objects are determined based on the high-precision map and the type of the rendering object. The high-precision map records information such as the position of an object in the world space, i.e., the real world, and the type of the object. Based on the high-precision map, an object whose position in the ground of the world space is in the target world space area and whose type is the rendering type can be determined, and an object whose position in the ground of the world space is in the target world space area and whose type is the rendering type can be determined as a target object.
[0076] In another possible implementation, a target detection network running on an operating system of the target vehicle is used to perform target detection on an environment image of an environment in which the target vehicle is located, which is collected by the target vehicle. For a detected object, if an object representing the object in the image is within an area of a target world space area associated with a current position of the target vehicle in the image and the type of the detected object is a rendering type, the detected object is determined to be a target object.
[0077] In step 202 , a first target object whose position in the camera coordinate system of the camera of the target vehicle is within a first camera coordinate system area is determined from among multiple target objects, and a second target object whose position in the camera coordinate system of the camera of the target vehicle is within a second camera coordinate system area is determined from among multiple target objects.
[0078] The first camera coordinate system area and the second camera coordinate system area both belong to the target camera coordinate system area in the camera coordinate system of the target vehicle's camera.
[0079] The target camera coordinate system area is on an XY plane where an X coordinate axis of the camera coordinate system of the camera of the target vehicle and a Y coordinate axis of the camera coordinate system of the camera of the target vehicle are located.
[0080] The second camera coordinate system area is: the camera coordinate system area in the target camera coordinate system area except the first camera coordinate system area.
[0081] The target camera coordinate system region corresponds to the target world space region associated with the current position of the target vehicle.
[0082] The target camera coordinate system area may be understood as: a representation of a target world space area associated with the current position of the target vehicle in the camera coordinate system of the camera of the target vehicle.
[0083] The target world space area related to the current position of the target vehicle includes a first world space area and a second world space area.
[0084] The first camera coordinate system area corresponds to the first world space area.
[0085] The first camera coordinate system area may be understood as: a representation of the first world space area in the camera coordinate system of the camera of the target vehicle.
[0086] The second camera coordinate system region corresponds to the second world space region.
[0087] The second camera coordinate system area may be understood as: a representation of the second world space area in the camera coordinate system of the camera of the target vehicle.
[0088] In the disclosed embodiment, the distance between the first world space region corresponding to the first camera coordinate system region and the current position of the target vehicle is smaller than the distance between the second world space region corresponding to the second camera coordinate system region and the current position of the target vehicle.
[0089] The first world space region corresponding to the first camera coordinate system region is closer to the current position of the target vehicle.
[0090] The second world space area corresponding to the second camera coordinate system area is far away from the current position of the target vehicle.
[0091] It should be noted that, for an object, the position of the object in the camera coordinate system of the target vehicle's camera within the first camera coordinate system region may specifically refer to:
[0092] The position of the object in the camera coordinate system of the camera of the target vehicle is vertically projected onto the XY plane in the camera coordinate system, and the projection position is within the first camera coordinate system area. For an object, the position of the object in the camera coordinate system of the camera of the target vehicle is within the second camera coordinate system area, which may specifically mean that the position of the object in the camera coordinate system of the camera of the target vehicle is vertically projected onto the XY plane in the camera coordinate system, and the projection position is within the second camera coordinate system area.
[0093] In step 203 , a first rendering is performed on the first target object, and a second rendering is performed on the second target object.
[0094] By performing a first rendering on the first target object, a rendering result of the first target object can be obtained. By performing a second rendering on the second target object, a rendering result of the second target object can be obtained.
[0095] The first rendering includes: generating a three-dimensional model of the first target object and a reflection object representing a reflection of the first target object.
[0096] The second rendering includes: generating a three-dimensional model of a second target object.
[0097] In step S203 , a reflection object representing the reflection of the second target object is not generated.
[0098] It should be noted that the number of the first target objects is one or more. When the number of the first objects is multiple, the first rendering is performed on each first target object respectively. The number of the second target objects is one or more. When the number of the second objects is multiple, the second rendering is performed on each second target object respectively.
[0099] It should be noted that the reflection object representing the reflection of the first target object may specifically refer to a translucent reflection object representing the reflection of the first target object. During rendering, an opaque material is applied to the 3D model of the first target object to obtain a 3D model of the first target object having an opaque material, and the 3D model of the first target object having an opaque material represents the first target object. A translucent material is applied to the copied 3D model of the first target object, i.e., a copy of the 3D model of the first target object, to obtain a translucent copied 3D model of the first target object, and the translucent copied 3D model of the first target object can be used as a reflection object representing the reflection of the first target object. The reflection object representing the reflection of the first target object is placed below the 3D model of the first target object to form a display effect of the reflection of the first target object. While displaying the 3D model of the first target object, the reflection object representing the reflection of the first target object is displayed.
[0100] refer to Figure 3 , which shows a flow chart of another rendering method provided by an embodiment of the present disclosure.
[0101] In step S301 , positions of a plurality of target objects in a camera coordinate system of a camera of a target vehicle are acquired.
[0102] Step S301 is the same as step S201, and step S301 refers to step S201.
[0103] In step S302, a first target object whose position in the camera coordinate system of the camera of the target vehicle is within a first camera coordinate system area is determined from multiple target objects, and a second target object whose position in the camera coordinate system of the camera of the target vehicle is within a second camera coordinate system area is determined from multiple target objects, wherein the first camera coordinate system area is determined based on the horizontal coordinate value of the horizontal axis boundary on the horizontal axis in the camera coordinate system of the camera of the target vehicle and the vertical coordinate value of the vertical axis boundary on the vertical axis in the camera coordinate system of the camera of the target vehicle.
[0104] The horizontal coordinate axis in the camera coordinate system of the target vehicle's camera is: the X coordinate axis in the camera coordinate system of the target vehicle's camera.
[0105] The horizontal coordinate axis in the camera coordinate system of the target vehicle's camera is: the Y coordinate axis in the camera coordinate system of the target vehicle's camera.
[0106] In the disclosed embodiment, the first camera coordinate system area can be determined only according to the horizontal coordinate value of the horizontal axis boundary and the vertical coordinate value of the vertical axis boundary, thereby improving the convenience of determining the first camera coordinate system area and quickly determining the first camera coordinate system area.
[0107] In one possible implementation, the horizontal coordinate value of the positive boundary direction of the horizontal axis on the X-axis in the camera coordinate system of the target vehicle's camera, the horizontal coordinate value of the negative boundary direction of the horizontal axis on the X-axis in the camera coordinate system of the target vehicle's camera, and the vertical coordinate value of the positive boundary direction of the vertical axis on the Y-axis in the camera coordinate system of the target vehicle's camera are preset.
[0108] Among them, the horizontal coordinate value of the positive direction boundary of the horizontal coordinate axis and the horizontal coordinate value of the negative direction boundary of the horizontal coordinate axis are both the horizontal coordinate value of the horizontal coordinate axis boundary. The vertical coordinate value of the positive direction boundary of the vertical coordinate axis is the vertical coordinate value of the vertical coordinate axis boundary.
[0109] The horizontal coordinate value of the positive direction boundary of the horizontal coordinate axis on the X-axis in the camera coordinate system of the target vehicle's camera is a positive value. The horizontal coordinate value of the positive direction boundary of the horizontal coordinate axis on the X-axis in the camera coordinate system of the target vehicle's camera is on the sub-axis of the positive direction of the X-axis in the camera coordinate system of the target vehicle's camera.
[0110] The negative boundary abscissa value of the abscissa axis on the X-axis in the camera coordinate system of the target vehicle's camera is a negative value. The negative boundary abscissa value of the abscissa axis on the X-axis in the camera coordinate system of the target vehicle's camera is on the negative sub-axis of the X-axis in the camera coordinate system of the target vehicle's camera.
[0111] The ordinate value of the positive direction boundary of the ordinate axis on the Y coordinate axis in the camera coordinate system of the target vehicle's camera is a positive value. The ordinate value of the positive direction boundary of the ordinate axis on the Y coordinate axis in the camera coordinate system of the target vehicle's camera is on the sub-axis of the positive direction of the Y coordinate axis in the camera coordinate system of the target vehicle's camera.
[0112] In step S302, a first point may be determined whose abscissa value is the abscissa value of the positive boundary of the abscissa axis and whose ordinate value is 0. A second point may be determined whose abscissa value is the abscissa value of the negative boundary of the abscissa axis and whose ordinate value is 0. A third point may be determined whose ordinate value is the ordinate value of the positive boundary of the ordinate axis and whose abscissa value is 0.
[0113] In step S302, a rectangular area may be determined according to the first point, the second point, and the third point, and the rectangular area may be used as the first camera coordinate system area.
[0114] Among them, one end point of a horizontal side of the rectangular area is the first point and the other end point of the horizontal side is the second point. The third point is on another horizontal side of the rectangular area. The first point is an end point of a vertical side of the rectangular area, and the second point is an end point of another vertical side of the rectangular area.
[0115] In a possible implementation, step S302 includes: step S3021. In step S3021, the first camera coordinate system area is determined according to the horizontal coordinate value of the positive boundary of the horizontal axis in the camera coordinate system of the target vehicle's camera, the horizontal coordinate value of the negative boundary of the horizontal axis in the camera coordinate system of the target vehicle's camera, the vertical coordinate value of the positive boundary of the vertical axis in the camera coordinate system of the target vehicle's camera, and the vertical coordinate value of the negative boundary of the vertical axis in the camera coordinate system of the target vehicle's camera.
[0116] The objects in the first world space area corresponding to the first camera coordinate system area determined in step S3021 block the objects in the second world space area corresponding to the second camera coordinate system area, and the objects in the area closer to the current position of the target vehicle block the objects in the area farther from the current position of the target vehicle. The reflection objects of the objects in the area farther from the current position of the target vehicle will not be generated, which is in line with the actual situation that the reflections of the blocked objects cannot be seen in the real world, thereby improving the realism of the rendering results.
[0117] In step S3021, a first point in the camera coordinate system of the camera of the target vehicle may be determined, whose abscissa value is the abscissa value of the positive boundary of the abscissa axis and whose ordinate value is 0. A first straight line parallel to the Y coordinate axis in the camera coordinate system of the camera of the target vehicle and passing through the first point may be determined.
[0118] In step S3021, a second point in the camera coordinate system of the camera of the target vehicle may be determined, the second point having a horizontal coordinate value that is a negative boundary horizontal coordinate value of the horizontal coordinate axis and a vertical coordinate value of 0. A second straight line parallel to the Y coordinate axis in the camera coordinate system of the camera of the target vehicle and passing through the second point may be determined.
[0119] In step S3021, a third point in the camera coordinate system of the camera of the target vehicle may be determined, the third point having a ordinate value that is a ordinate value of a positive boundary of the ordinate axis and a lateral coordinate value of 0. A third straight line parallel to the X-axis in the camera coordinate system of the camera of the target vehicle and passing through the third point may be determined.
[0120] In step S3021, a fourth point in the camera coordinate system of the camera of the target vehicle may be determined, the fourth point having a ordinate value that is a negative boundary ordinate value of the ordinate axis and a horizontal coordinate value of 0. A fourth straight line parallel to the X-axis in the camera coordinate system of the camera of the target vehicle and passing through the fourth point may be determined.
[0121] In step S3021, a first camera coordinate system area may be determined according to the first straight line, the second straight line, the third straight line, and the fourth straight line.
[0122] In a possible implementation, in step S3021, the camera coordinate system area between the first straight line and the second straight line and the camera coordinate system area between the third straight line and the fourth straight line are respectively taken as part of the first camera coordinate system area, thereby determining a cross-shaped first camera coordinate system area.
[0123] refer to Figure 4 , which shows a schematic diagram of an example of a first camera coordinate system area and a second camera coordinate system area.
[0124] X1 is the horizontal coordinate value of the negative boundary of the horizontal axis, X1 is -h. X2 is the horizontal coordinate value of the positive boundary of the horizontal axis, X2 is h. Y1 is the vertical coordinate value of the negative boundary of the vertical axis, Y1 is -h. Y2 is the vertical coordinate value of the positive boundary of the vertical axis, Y2 is h.
[0125] The first point is: a point having a horizontal coordinate value of X2 and a vertical coordinate value of 0 in the camera coordinate system of the camera of the target vehicle.
[0126] The first straight line is parallel to the Y coordinate axis in the camera coordinate system of the camera of the target vehicle and passes through the first point.
[0127] The second point is: a point having a horizontal coordinate value of X1 and a vertical coordinate value of 0 in the camera coordinate system of the camera of the target vehicle.
[0128] The second straight line is parallel to the Y coordinate axis in the camera coordinate system of the camera of the target vehicle and passes through the second point.
[0129] The third point is that the ordinate value in the camera coordinate system of the camera of the target vehicle is Y2 and the abscissa value is 0.
[0130] The third straight line is parallel to the X-coordinate axis in the camera coordinate system of the camera of the target vehicle and passes through the third point.
[0131] The fourth point is that the ordinate value of the camera of the target vehicle in the camera coordinate system is Y1 and the abscissa value is 0.
[0132] The fourth straight line is parallel to the X-coordinate axis in the camera coordinate system of the camera of the target vehicle and passes through the fourth point.
[0133] The camera coordinate system area between the first straight line and the second straight line and the camera coordinate system area between the third straight line and the fourth straight line are respectively used as a part of the first camera coordinate system area, and the first camera coordinate system area is a cross-shaped camera coordinate system area.
[0134] The position of building A2 in the camera coordinate system of the camera of the target vehicle is within the first camera coordinate system region, and a reflection object of building A2 is generated. The position of building A1 in the camera coordinate system of the camera of the target vehicle is within the second camera coordinate system region, and a reflection object of building A1 is not generated.
[0135] In a possible implementation, determining a first target object whose position in the camera coordinate system of the camera of the target vehicle is within the first camera coordinate system region from multiple target objects includes: for a target object, when the target object satisfies the first condition and / or the second condition, determining that the position of the target object in the camera coordinate system of the camera of the target vehicle is within the first camera coordinate system region, and determining the target object as the first target object, where the first condition is that the abscissa value of the position of the target object in the camera coordinate system of the camera of the target vehicle is greater than the abscissa value of the negative direction boundary of the horizontal axis and less than the abscissa value of the positive direction boundary of the horizontal axis, and the second condition is that the ordinate value of the position of the target object in the camera coordinate system of the camera of the target vehicle is greater than the ordinate value of the negative direction boundary of the vertical axis and less than the ordinate value of the positive direction boundary of the vertical axis.
[0136] For a target object, when the target object does not satisfy the first condition and does not satisfy the second condition, determining that the position of the target object in the camera coordinate system of the camera of the target vehicle is within the second camera coordinate system region, and determining the target object as the second target object.
[0137] Reference Figure 5 which shows a flowchart of an example for determining whether to generate a reflection object of an object.
[0138] Obtain the position of a building in the world space within a target world space region related to the current position of the target vehicle. Convert the position of the building in the world space to the position of the building in the camera coordinate system of the camera of the target vehicle. The position of the building in the camera coordinate system of the camera of the target vehicle is denoted as (Ax, Ay, Az). Ax is the abscissa value of the position of the building in the camera coordinate system of the camera of the target vehicle, and Ay is the ordinate value of the position of the building in the camera coordinate system of the camera of the target vehicle. The abscissa value of the negative direction boundary of the horizontal axis is denoted as X1. The abscissa value of the positive direction boundary of the horizontal axis is denoted as X2. The ordinate value of the negative direction boundary of the vertical axis is denoted as Y1. The ordinate value of the positive direction boundary of the vertical axis is denoted as Y2. The first condition is X1 < Ax < X2, and the second condition is Y1 < Ay < Y2. When the target object satisfies the first condition and / or the second condition, that is, X1 < Ax < X2 and / or Y1 < Ay < Y2, a reflection object of the building is generated. If the target object does not satisfy the first condition and does not satisfy the second condition, a reflection object of the building is not generated.
[0139] The embodiments of the present disclosure provide a rendering device. The rendering device is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "unit" can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0140] The rendering device comprises:
[0141] an acquisition unit, configured to acquire positions of a plurality of target objects in a camera coordinate system of a camera of a target vehicle, wherein the target objects are objects to be rendered whose positions in the world space are in a target world space region associated with a current position of the target vehicle;
[0142] a determining unit, configured to determine, from among a plurality of target objects, a first target object whose position in the camera coordinate system is within a first camera coordinate system region, and to determine, from among a plurality of target objects, a second target object whose position in the camera coordinate system is within a second camera coordinate system region, wherein a distance between a first world space region corresponding to the first camera coordinate system region and the current position is smaller than a distance between a second world space region corresponding to the second camera coordinate system region and the current position, and the second camera coordinate system region is a region in the target camera coordinate system region excluding the first camera coordinate system region;
[0143] The rendering unit is used to perform a first rendering on a first target object and a second rendering on a second target object, wherein the first rendering includes: generating a three-dimensional model of the first target object and a reflection object representing a reflection of the first target object, and the second rendering includes: generating a three-dimensional model of the second target object.
[0144] In a possible implementation, the rendering device further includes:
[0145] The first camera coordinate system area determining unit is used to determine the first camera coordinate system area according to the horizontal coordinate value of the horizontal coordinate axis boundary on the horizontal coordinate axis in the camera coordinate system and the vertical coordinate value of the vertical coordinate axis boundary on the vertical coordinate axis in the camera coordinate system.
[0146] In one possible implementation, the first camera coordinate system area determination unit is further used to determine the first camera coordinate system area based on the horizontal coordinate value of the positive direction boundary of the horizontal axis in the camera coordinate system, the horizontal coordinate value of the negative direction boundary of the horizontal axis in the camera coordinate system, the vertical coordinate value of the positive direction boundary of the vertical axis in the camera coordinate system, and the vertical coordinate value of the negative direction boundary of the vertical axis in the camera coordinate system.
[0147] In one possible implementation, the determination unit is further used to determine the target object as the first target object when the target object satisfies a first condition and / or a second condition, wherein the first condition is that the horizontal coordinate value of the position of the target object in the camera coordinate system is greater than the horizontal coordinate value of the negative boundary of the horizontal coordinate axis and is less than the horizontal coordinate value of the positive boundary of the horizontal coordinate axis, and the second condition is that the vertical coordinate value of the position of the target object in the camera coordinate system is greater than the vertical coordinate value of the negative boundary of the vertical coordinate axis and is less than the vertical coordinate value of the positive boundary of the vertical coordinate axis.
[0148] In a possible implementation, the rendering device further includes:
[0149] The target object determination unit is used to determine multiple target objects based on the high-precision map.
[0150] In a possible implementation, the multiple target objects include: a building that needs to be rendered and whose position in the world space is in a target world space area related to the current position of the target vehicle.
[0151] In this embodiment, the device is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and a memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0152] The further functional description of each of the above units is the same as that of the above corresponding embodiments and will not be repeated here.
[0153] refer to Figure 6 It shows a schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure, and the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0154] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0155] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0156] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0157] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0158] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means.
[0159] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0160] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0161] A portion of the embodiments of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can execute or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in a computer-readable medium includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which the computer program instructions are executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0162] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A rendering method, characterized in that: The method comprises: Obtaining positions of a plurality of target objects in a camera coordinate system of a camera of a target vehicle, wherein the target objects are objects to be rendered whose positions in the world space are in a target world space region related to a current position of the target vehicle; Determine, from among the multiple target objects, a first target object whose position in the camera coordinate system is within a first camera coordinate system region, and determine, from among the multiple target objects, a second target object whose position in the camera coordinate system is within a second camera coordinate system region, wherein a distance between a first world space region corresponding to the first camera coordinate system region and the current position is smaller than a distance between a second world space region corresponding to the second camera coordinate system region and the current position, the second camera coordinate system region is a region in the target camera coordinate system region corresponding to the target world space region in the camera coordinate system excluding the first camera coordinate system region, and the second world space region is a region in the target world space region excluding the first world space region; A first rendering is performed on the first target object, and a second rendering is performed on the second target object. The first rendering includes: generating a three-dimensional model of the first target object and a reflection object representing a reflection of the first target object. The second rendering includes: generating a three-dimensional model of the second target object.
2. The method according to claim 1, characterized in that The method further comprises: A first camera coordinate system area is determined according to a horizontal coordinate value of a horizontal coordinate axis boundary on the horizontal coordinate axis in the camera coordinate system and a vertical coordinate value of a vertical coordinate axis boundary on the vertical coordinate axis in the camera coordinate system.
3. The method according to claim 2, characterized in that Determining the first camera coordinate system area according to the horizontal coordinate value of the horizontal coordinate axis boundary on the horizontal coordinate axis in the camera coordinate system and the vertical coordinate value of the vertical coordinate axis boundary on the vertical coordinate axis in the camera coordinate system comprises: The first camera coordinate system area is determined according to the horizontal coordinate value of the positive direction boundary of the horizontal axis of the camera coordinate system, the horizontal coordinate value of the negative direction boundary of the horizontal axis of the camera coordinate system, the vertical coordinate value of the positive direction boundary of the vertical axis of the camera coordinate system, and the vertical coordinate value of the negative direction boundary of the vertical axis of the camera coordinate system.
4. The method according to claim 3, characterized in that Determining, from among the plurality of target objects, a first target object whose position in the camera coordinate system is within a first camera coordinate system region comprises: When the target object satisfies the first condition and / or the second condition, the target object is determined as the first target object, wherein the first condition is that the horizontal coordinate value of the position of the target object in the camera coordinate system is greater than the horizontal coordinate value of the negative boundary of the horizontal coordinate axis and is less than the horizontal coordinate value of the positive boundary of the horizontal coordinate axis, and the second condition is that the vertical coordinate value of the position of the target object in the camera coordinate system is greater than the vertical coordinate value of the negative boundary of the vertical coordinate axis and is less than the vertical coordinate value of the positive boundary of the vertical coordinate axis.
5. The method according to claim 1, characterized in that The method further comprises: Based on the high-precision map, multiple target objects are identified.
6. The method according to any one of claims 1 to 5, characterized in that The multiple target objects include: a building that needs to be rendered and whose position in the world space is in a target world space area related to the current position of the target vehicle.
7. A rendering device, characterized in that: The device comprises: an acquisition unit, configured to acquire positions of a plurality of target objects in a camera coordinate system of a camera of a target vehicle, wherein the target objects are objects to be rendered whose positions in the world space are in a target world space region associated with a current position of the target vehicle; a determining unit, configured to determine, from among a plurality of target objects, a first target object whose position in the camera coordinate system is within a first camera coordinate system region, and to determine, from among a plurality of target objects, a second target object whose position in the camera coordinate system is within a second camera coordinate system region, wherein a distance between a first world space region corresponding to the first camera coordinate system region and the current position is smaller than a distance between a second world space region corresponding to the second camera coordinate system region and the current position, and the second camera coordinate system region is a region in the target camera coordinate system region excluding the first camera coordinate system region; The rendering unit is used to perform a first rendering on a first target object and a second rendering on a second target object, wherein the first rendering includes: generating a three-dimensional model of the first target object and a reflection object representing a reflection of the first target object, and the second rendering includes: generating a three-dimensional model of the second target object.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 6.
