A virtual-real light alignment method, device, electronic device and medium

By obtaining the light illuminance distribution map in the virtual scene, calculating the illuminance extreme points and gradients, and adjusting the location and parameters of the physical lamps, the problems of poor alignment of virtual and real lights and complex layout are solved, and efficient and accurate lighting alignment is achieved.

CN117422844BActive Publication Date: 2025-07-22DIVINE VISION (SHENZHEN) CULTURE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311433094.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-27
Publication Date
2025-07-22
Estimated Expiration
2043-10-27

AI Technical Summary

Technical Problem

In the prior art, virtual and real lighting alignment effect is poor, and the lighting layout is complex and difficult, making it difficult to achieve efficient lighting alignment.

Method used

By obtaining the light illuminance distribution map of the virtual area in the virtual scene, calculating the illuminance extreme point and illuminance gradient, determining the incident position point and attitude information of the virtual light, and then adjusting the position and parameters of the physical lamp to achieve the alignment of the lights of the virtual area and the target area.

Benefits of technology

It achieves a more efficient light alignment effect, reduces the difficulty of light layout in actual scenes, and improves the accuracy and efficiency of light alignment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117422844B_ABST
    Figure CN117422844B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a virtual-real light alignment method, device, electronic device, and medium. The virtual-real light alignment method includes: obtaining a light intensity distribution map inside a virtual area in a virtual scene; calculating an extreme point of light intensity according to the light intensity distribution map to obtain an incident position point of the irradiation center line of the virtual light in the virtual area; determining incident attitude information of the irradiation center line based on the light intensity gradient distribution around the incident position point; determining a position range of an entity lamp in the actual scene based on the incident position point and the incident attitude information; adjusting the set position of the entity lamp within the position range and adjusting the light parameters of the entity lamp to achieve virtual-real light alignment between the virtual area and the target area. The embodiment of the present application can more efficiently achieve a better light alignment effect, and can also effectively reduce the difficulty of light layout in the actual scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of computer technology, and in particular, to a method, apparatus, electronic device, and computer storage medium for aligning virtual and real lights. Background Art

[0002] Virtual shooting based on a screen (such as an LED screen) is to project the rendered image in the virtual asset scene obtained by virtual engine rendering onto the LED screen for display. Then, the actor uses the LED screen as the background for performance, and the image acquisition device simultaneously shoots the actor and the LED screen. After that, the captured camera image is synthesized with the rendered image, so that the real actor is placed in the virtual scene, achieving the effect of shooting an outdoor scene or a science fiction background in the studio.

[0003] Aligning virtual and real lights means aligning the lights in the actual foreground shooting area at the shooting site with the lights in the virtual asset scene on the LED background screen at the shooting site. Specifically, it is to make the illuminance of the light at the actual foreground target position consistent with the illuminance of the virtual light at the corresponding position in the virtual asset scene. In a virtual shooting project based on an LED screen, aligning virtual and real lights is an important prerequisite for obtaining a real and vivid shooting effect.

[0004] In the related art, virtual and real light alignment is mainly achieved by manually adjusting the intensity of the actual lights with fixed physical positions. However, the alignment effect finally obtained by this method is poor. Summary of the Invention

[0005] In view of this, embodiments of the present application provide a virtual and real light alignment solution to at least partially solve the above problems.

[0006] According to the first aspect of the embodiments of the present application, a method for aligning virtual and real lights is provided, including:

[0007] Obtain a light intensity distribution map inside a virtual area in a virtual scene; the virtual area is a position corresponding to a target area in the actual scene;

[0008] Calculate the extreme points of illuminance according to the light intensity distribution map to obtain the incident position points of the irradiation center line of the virtual light in the virtual area; and determine the incident attitude information of the irradiation center line based on the illuminance gradient distribution around the incident position points;

[0009] Determine the position range of the physical lamps in the actual scene based on the incident position points and the incident attitude information;

[0010] Adjust the set position of the physical lamps and adjust the light parameters of the physical lamps within the position range to achieve virtual and real light alignment between the virtual area and the target area.

[0011] According to the second aspect of the embodiments of the present application, a virtual-real light alignment device is provided, including:

[0012] An illuminance acquisition module, configured to acquire a light illuminance distribution map inside a virtual area in a virtual scene; the virtual area is a position corresponding to a target area in the actual scene;

[0013] A calculation module, configured to calculate an illuminance extreme point according to the light illuminance distribution map to obtain an incident position point of the irradiation center line of the virtual light in the virtual area; and determine the incident attitude information of the irradiation center line based on the illuminance gradient distribution around the incident position point;

[0014] A position range determination module, configured to determine the position range of the physical lamp in the actual scene based on the incident position point and the incident attitude information;

[0015] An alignment module, configured to adjust the installation position of the physical lamp and adjust the light parameters of the physical lamp within the position range to achieve virtual-real light alignment between the virtual area and the target area.

[0016] According to the third aspect of the embodiments of the present application, an electronic device is provided, including: a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface complete communication with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operations corresponding to the method in the first aspect.

[0017] According to the fourth aspect of the embodiments of the present application, a computer storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, it implements the method in the first aspect.

[0018] According to the virtual light alignment solution provided by the embodiments of the present application, a light illuminance distribution map inside a virtual area in a virtual scene is acquired; an illuminance extreme point is calculated according to the light illuminance distribution map to obtain an incident position point of the irradiation center line of the virtual light in the virtual area; and the incident attitude information of the irradiation center line is determined based on the illuminance gradient distribution around the incident position point; the position range of the physical lamp in the actual scene is determined based on the incident position point and the incident attitude information; the installation position of the physical lamp is adjusted within the position range and the light parameters of the physical lamp are adjusted to achieve virtual-real light alignment between the virtual area and the target area.

[0019] In the embodiments of the present application, according to the light intensity distribution map inside the virtual area in the virtual scene, through the calculation of the extreme points of illumination, the incident position points of the virtual light irradiation center line are determined. That is, through the calculation of the extreme points of illumination, the large-scale and complexly arranged lighting system in the virtual scene is simplified, and the number of virtual lamps (equal to the number of incident position points) is determined simply. Moreover, through the calculation of the illumination gradient, the incident postures of the irradiation center lines of each virtual lamp are determined, and then the position range of the physical lamps is determined more accurately. In this way, by adjusting the setting positions of the physical lamps within the above-mentioned relatively accurate position range and adjusting the lighting parameters, a better virtual-real alignment effect can be obtained. In summary, the embodiments of the present application can more efficiently achieve a better lighting alignment effect, and can also effectively reduce the difficulty of lighting layout in the actual scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application, and those of ordinary skill in the art can also obtain other drawings based on these drawings.

[0021] Figure 1 FIG. is a flowchart of the steps of a virtual-real lighting alignment method according to Embodiment 1 of the present application;

[0022] Figure 2 FIG. is a schematic diagram of the light irradiation line obliquely incident on the virtual area at the position of the irradiation center line;

[0023] Figure 3 FIG. is a structural block diagram of a virtual-real lighting alignment device according to Embodiment 2 of the present application;

[0024] Figure 4 FIG. is a schematic structural diagram of an electronic device according to Embodiment 3 of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0025] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art shall fall within the protection scope of the embodiments of the present application.

[0026] In virtual shooting technology based on a screen of a type such as an LED, before formal shooting, it is necessary to first perform real - virtual light alignment, and control the illuminance difference between the actual light illuminance in the actual foreground shooting area of the shooting site and the virtual light illuminance in the virtual scene of the background screen within a certain range. In this way, the shooting effect obtained by the virtual shooting technology can be real and vivid.

[0027] Currently, there are mainly two ways to achieve real - virtual light alignment:

[0028] First, set multiple physical lamps at several fixed physical positions in the actual scene. Then, rely on manual adjustment of the light parameters of each lamp, and visually and intuitively feel whether real - virtual light alignment is achieved. This method has low efficiency. In addition, since only the light parameters are adjusted during the alignment process, and the alignment effect is judged subjectively by vision, the final real - virtual light alignment effect obtained by this method is poor.

[0029] Second, according to the set positions and light parameters of the virtual lamps in the virtual scene, set the layout positions and light parameters of the physical lamps in the actual scene to achieve the effect of real - virtual light alignment. In this method, since the positions of the physical lamps and the virtual lamps in the virtual scene need to be in one - to - one correspondence, the complexity and difficulty of lamp layout are increased. Moreover, due to the space limitation of the actual shooting scene, it is usually impossible to achieve one - to - one correspondence of positions. In addition, even if the positions of the virtual lamps and the physical lamps are set corresponding to each other, since the physical lamps in the actual scene cannot be exactly the same as the virtual lamps in the virtual rendering engine, even under the control of the same light parameters, the light intensities irradiated to the target area by the two cannot be kept consistent.

[0030] The real - virtual light alignment solution provided by the embodiments of the present application simplifies the large - scale and complexly - laid - out light system in the virtual scene through illuminance extreme point calculation according to the light illuminance distribution map inside the virtual area in the virtual scene, and simply determines the number of incident position points as the number of virtual lamps; and determines the incident postures of the irradiation centerlines of each virtual lamp through illuminance gradient calculation, and then more accurately determines the position range of the physical lamps. In this way, by adjusting the setting positions of the physical lamps and the light parameters within the above - mentioned relatively accurate position range, a better real - virtual alignment effect can be obtained.

[0031] Compared with the first method above, the embodiments of the present application do not require manual participation and can more efficiently achieve a better light alignment effect; compared with the second method above, the embodiments of the present application simplify the large - scale and complexly - laid - out light system in the virtual scene and can effectively reduce the difficulty of light layout in the actual scene.

[0032] The specific implementation of the embodiments of the present application will be further described below in conjunction with the accompanying drawings of the embodiments of the present application.

[0033] Embodiment 1

[0034] Refer to Figure 1 , Figure 1 which is a flowchart of the steps of a virtual light alignment method according to Embodiment 1 of the present application. Specifically, the virtual light alignment method provided in this embodiment includes the following steps:

[0035] Step 102, obtain the light intensity distribution map inside the virtual area in the virtual scene.

[0036] Among them, the virtual area is the position corresponding to the target area in the actual scene.

[0037] Before shooting a video or a picture using virtual shooting technology, a virtual scene can be pre-rendered by a rendering server installed with a virtual rendering engine. During the subsequent shooting process, the rendered virtual scene can be projected onto a display screen as the background of the video or the picture. To ensure that the background has a real and vivid visual effect, the rendered virtual scene is spatially aligned with the actual scene, that is: the rendered virtual scene contains virtual objects corresponding to the physical objects in the actual scene, and the relative positions between the virtual objects are the same as the relative positions between the corresponding physical objects.

[0038] For example: if you want to shoot a video clip with a classroom background, you can pre-render a virtual classroom scene through a rendering server. This scene can contain virtual objects such as virtual desks, virtual display screens, virtual cameras, virtual lamps, virtual podiums, virtual blackboards, etc. The relative positions between the above virtual desks, virtual display screens, virtual cameras and other virtual objects can be the same as the relative positions between the real desks, real display screens, real cameras in the actual scene. During the shooting process, the virtual classroom scene can be projected onto a real display screen, and a real desk corresponding to the virtual desk can be placed at the target area in front of the real display screen. Then, the actor can perform in front of the real desk, and at the same time, the corresponding virtual scene picture is displayed on the real display screen.

[0039] The virtual area in the embodiments of the present application is an area in the virtual scene that has a spatial alignment relationship with the target area in the real scene where virtual-real light alignment is to be performed. In the embodiments of the present application, there are no restrictions on the selection methods for the virtual area and the target area, and any virtual-real areas with a spatial alignment relationship can be custom-set according to actual shooting requirements. For example: in the above example, the virtual area can be a virtual desk in the virtual scene, and the target area can be a real desk in the real scene. Additionally, the target area can be an area that remains fixed during the shooting process, or an area that changes continuously according to shooting requirements. For example: the central area of the camera shooting range can be determined as the target area, in which case the target area remains fixed during the shooting process; or the position area where the actor is located can be determined as the target position, and when the actor moves, the target area also changes accordingly.

[0040] In this step, the obtained light intensity distribution map characterizes the light intensity information of each position point inside the above virtual area, that is, the luminous flux received per unit area inside the above virtual area, or in other words, how much light is received per unit area inside the above virtual area. In the embodiments of the present application, the light intensity distribution map inside the virtual area can be obtained based on a virtual rendering engine.

[0041] Step 104: Calculate the extreme illumination points based on the light intensity distribution map to obtain the incident position points of the illumination center line of the virtual light in the virtual area; and determine the incident attitude information of the illumination center line based on the illumination gradient distribution around the incident position points.

[0042] Among them, the incident attitude information characterizes the incident attitude of the illumination center line relative to the virtual area.

[0043] Generally speaking, after the light emitted by a lamp irradiates a certain area, the light intensity is non-uniformly distributed inside the area. Among them, the light intensity value at the incident position point of the illumination center line of the light in the area should be the largest. Further, when the light emitted by multiple lamps irradiates the area simultaneously, considering that the intensity of some or certain lights may be weak, or the light intensities may cancel each other out, there is at least one extreme illumination point in the area.

[0044] Based on the above rules, the embodiments of the present application simplify the large number and complex layout of the lighting systems in the virtual scene in terms of quantity. Specifically: first, calculate the extreme illumination points according to the light intensity distribution map to obtain one or more extreme illumination points, and then, determine the calculated extreme illumination points as the incident position points of the illumination center line of the virtual light in the virtual area, or determine the incident position points of the illumination center line of the virtual light in the virtual area based on the positions of the extreme illumination points. Among them, one extreme illumination point corresponds to one incident position point, and further, also corresponds to one virtual light.

[0045] Further, after determining the incident position point, for a single incident position point, the incident attitude information of the illumination center line can be determined based on the illumination gradient distribution around the incident position point. Specifically: the incident attitude information characterizes the incident attitude of the illumination center line relative to the virtual area.

[0046] The illumination gradient distribution refers to the attenuation of the illumination values in all directions starting from the incident position point. In this step, based on the illumination distribution map of the light, a two-dimensional gradient calculation can be performed at the incident position point to obtain the illumination gradient values in all directions starting from the incident position point. The illumination gradient value characterizes the attenuation degree of the illumination value in the corresponding direction and can be calculated based on the difference in illumination between two points (the incident position point and the target point in that direction). When the distances between two points in all directions are equal, the larger the illumination gradient value, the higher the attenuation degree. After obtaining the illumination gradient distribution, the incident attitude information of the illumination center line can be determined based on the correlation between the incident attitude of the light and the distribution of the illumination gradient values around the incident position point and the analysis of the above distribution.

[0047] Based on the above step 104, the number of virtual lamps can be simply determined, and moreover, the incident pose information of the illumination center lines emitted by each virtual lamp can be accurately determined: the incident position point and the incident attitude information.

[0048] Step 106, based on the incident position point and the incident attitude information, determine the position range of the physical lamp in the actual scene.

[0049] After the incident pose information of the illumination center lines emitted by the virtual lamps is determined in step 104, the position range where the virtual lamps are located can be determined. Specifically: given the incident pose of the illumination center line, the layout position of the lamp is on the straight line where the illumination center line is located. More precisely, it is on the ray after the illumination center line is truncated by the incident position point.

[0050] After determining the position range of the virtual lamps, according to the spatial alignment relationship between the virtual lamps and the physical lamps, the position range of the physical lamps in the actual scene can also be determined.

[0051] Step 108, adjust the setting position of the physical lamp within the position range and adjust the lighting parameters of the physical lamp to achieve the alignment of the virtual and real lights between the virtual area and the target area.

[0052] Specifically, in this step, the installation position and light parameters of the physical lamp can be adjusted simultaneously, so that the information difference value between the actual light illumination information at the target area and the virtual light illumination information at the virtual area is less than a preset difference threshold. The preset difference threshold can be customized according to the actual situation, and the value principle of the preset difference threshold is not limited here. In addition, in the embodiments of the present application, the specific position adjustment strategy and light parameter adjustment strategy adopted in the process of realizing the alignment of virtual and real lights are not limited and can be customized according to the actual situation.

[0053] The virtual-real alignment method provided by the embodiments of the present application determines the incident position point of the virtual light irradiation center line through the calculation of the illumination extreme points according to the light illumination distribution map inside the virtual area in the virtual scene. That is, through the calculation of the illumination extreme points, the large-scale and complexly arranged light system in the virtual scene is simplified, and the number of virtual lamps (equal to the number of incident position points) is determined simply; and the incident attitude of the irradiation center line of each virtual lamp is determined through the calculation of the illumination gradient, and then the position range of the physical lamp is determined more accurately. In this way, through the adjustment of the installation position of the physical lamp within the above-mentioned relatively accurate position range and the adjustment of the light parameters, a better virtual-real alignment effect can be obtained. In summary, the embodiments of the present application can more efficiently achieve a better light alignment effect, and can also effectively reduce the difficulty of light layout in the actual scene.

[0054] Optionally, in some embodiments, the incident attitude information in step 104 may include: the elevation angle and the light projection direction; the elevation angle is the angle between the light irradiation line at the position of the irradiation center line and the plane where the incident position point is located; the light projection direction is the direction of the projection of the light irradiation line at the position of the irradiation center line in the above plane; correspondingly, the process of determining the incident attitude information of the irradiation center line based on the illumination gradient distribution around the incident position point in step 104 may include:

[0055] Based on the light illumination distribution map, calculate the illumination gradient values around the irradiation center point;

[0056] Determine that the opposite direction of the target direction where the maximum illumination gradient value is located is the light projection direction;

[0057] Based on the maximum illumination gradient value and the illumination gradient value in the light projection direction, perform inverse trigonometric function calculation to obtain the elevation angle.

[0058] Specifically, when the light irradiation line at the irradiation center line position is perpendicularly incident on the virtual area, the illuminance attenuation degrees in all directions around the incident position point are basically the same. When the light irradiation line at the irradiation center line position is obliquely incident on the virtual area, the distribution of the illuminance attenuation degrees in all directions around the incident position point is no longer uniform. Moreover, the attenuation degree along the light projection direction (the direction of the projection of the light irradiation line at the irradiation center line position on the plane where the incident position point is located) is the smallest, and the attenuation degree along the opposite direction of the above light projection direction is the largest. That is: the illuminance gradient along the light projection direction is the smallest, and the illuminance gradient along the opposite direction of the light projection direction is the largest. Further, the cosine value of the elevation angle of the light irradiation line at the irradiation center line position is equal to the ratio between the minimum illuminance gradient value in the above light projection direction and the illuminance gradient value in the opposite direction.

[0059] See Figure 2 , Figure 2 is a schematic diagram of the light irradiation line at the irradiation center line position being obliquely incident on the virtual area. For ease of understanding, the following will explain the above content in conjunction with Figure 2 :

[0060] The light irradiation line L at the irradiation center line position is incident on the virtual area at an elevation angle α, and the incident position point is D. Among the illuminance gradient values in all directions around D, the illuminance gradient value T1 along the light projection direction S is the smallest, and the illuminance gradient value T2 along the opposite direction F of the light projection direction S is the largest. Moreover, see Figure 2 shown, the cosine value cosα of the elevation angle α = T1 / T2. Wherein, both T1 and T2 are illuminance gradient values, and the illuminance gradient value is a scalar without direction, Figure 2 the T1 and T2 shown in only represent the numerical relationship between the magnitudes of T1 and T2 and the elevation angle α, Figure 2 the positions of T1 and T2 in do not represent the directions of T1 and T2.

[0061] Therefore, in the embodiments of the present application, the opposite direction of the target direction where the maximum illuminance gradient value is located (that is, the direction with the largest gradient descent) can be determined as the light projection direction. And, based on the maximum illuminance gradient value and the illuminance gradient value in the light projection direction, inverse trigonometric calculation is performed to obtain the elevation angle. That is: based on the maximum illuminance gradient value and the illuminance gradient value in the light projection direction, inverse cosine (arccos) calculation is performed to obtain the elevation angle.

[0062] In the above process, the distribution law of the illuminance attenuation degrees in different directions when the light irradiation line at the irradiation center line position is obliquely incident on the virtual area is utilized, and the elevation angle is obtained through inverse trigonometric calculation. Therefore, the accuracy of the calculation result is relatively high. Furthermore, based on this calculation result with relatively high accuracy for subsequent virtual and real light alignment, a better alignment effect can be obtained.

[0063] Optionally, in some embodiments, the above step 106 can be specifically implemented through the following steps:

[0064] Based on the incident position point and the incident pose information, determine the virtual position range of the virtual light in the virtual scene; the virtual position range is the position range relative to the virtual area;

[0065] Based on the virtual position range and the correspondence between the target area and the virtual area, obtain the position range of the physical lamp in the actual scene; the position range of the physical lamp is the position range relative to the target area.

[0066] After determining the incident pose information of the irradiation center line emitted by the virtual lamp, the virtual position range where the virtual lamp is located can be determined. This virtual position range is the position range relative to the virtual area. Since there is a spatial alignment relationship between the virtual area and the target area, based on the virtual position range and the correspondence between the target area and the virtual area, the position range of the physical lamp relative to the target area can be finally obtained.

[0067] In addition, since in the actual scene, when laying out the positions of physical lamps, the world coordinate system is usually used as the reference, after obtaining the position range of the physical lamp relative to the target area, coordinate transformation can be performed based on the relative pose of the target area relative to the world coordinate system, so as to convert the position range of the physical lamp relative to the target area into the position range of the physical lamp in the world coordinate system. In this way, it is convenient to layout the positions of physical lamps in the actual scene.

[0068] Optionally, in some embodiments, a virtual target object with known light attribute information is set at the virtual area of the above step 102; correspondingly, the above step 102 can be implemented as:

[0069] In the virtual scene, determine the virtual position of the virtual area corresponding to the target area in the actual scene;

[0070] Based on the virtual position, obtain the virtual brightness distribution map of the virtual target object;

[0071] Based on the virtual brightness distribution map, the light attribute information, and the preset relationship satisfied among the virtual brightness, the light attribute information, and the light illuminance, calculate the light illuminance distribution map inside the virtual area.

[0072] Specifically, in the embodiments of the present application, the shape, size, material, etc. of the virtual target object are not limited, and any virtual target object with known illumination attribute information can be used. Further, in order to more accurately obtain the light intensity distribution map inside the virtual area, the virtual target object can be set as a plate-shaped object that can cover the above virtual area, and the position of the plate-shaped object can be set to face the virtual camera directly, so as to ensure that the illumination conditions in the virtual area are aligned with the illumination conditions in the target area.

[0073] Specifically, the virtual brightness distribution map of the virtual target object represents the virtual brightness distribution of each position point in the virtual target object. The virtual brightness distribution map of the virtual target object can be obtained through a virtual rendering engine.

[0074] For a target object with known illumination attributes, there is a certain relationship between the brightness information irradiated onto the target object and the illuminance information irradiated onto the target object. Therefore, in the embodiments of the present application, by setting a virtual target object with known illumination attributes at a virtual position, and then through the way of reasoning and calculation based on a preset relationship, the light intensity distribution map inside the virtual area can be obtained. The above method for obtaining the light intensity distribution map has a simple calculation process, high calculation efficiency, and more accurate calculation results.

[0075] Further, the above illumination attribute information may include the light reflection characteristics of the surface of the virtual target object, and the reflection characteristics include the reflectivity and the surface structure; correspondingly, the process of calculating the light intensity distribution map inside the virtual area based on the virtual brightness distribution map, the illumination attribute information, and the preset relationship satisfied among the virtual brightness, the illumination attribute information, and the light intensity may include:

[0076] Based on the virtual brightness of each point in the virtual brightness distribution map, the illumination attribute information, and the preset relationship satisfied among the virtual brightness, the illumination attribute information, and the light intensity, calculate the light intensity information of each point inside the virtual area:

[0077] The preset relational expression is:

[0078] π*L = E*R

[0079] Wherein, L is the virtual brightness of each point in the virtual brightness distribution map; E is the light intensity information of each point inside the virtual area; R is the reflectivity information of the virtual target object; and π is the pi.

[0080] In the above process, based on the relational expression among the reflectivity, the virtual brightness, and the virtual light intensity, the light intensity information of each point inside the virtual area can be obtained through reasoning and calculation. The calculation process is simple and the efficiency is high.

[0081] Optionally, in some of these embodiments, in the above implementation process, the step of obtaining the virtual brightness distribution map of the virtual target object based on the virtual position may include:

[0082] Based on the virtual position, obtain the initial virtual brightness distribution map of the virtual target object from a preset perspective through a virtual rendering engine;

[0083] Perform an affine transformation on the initial virtual brightness distribution map to obtain the virtual brightness distribution map of the processed virtual target object.

[0084] Specifically, since the virtual scene and the virtual target object rendered by the virtual rendering engine are usually three-dimensional scenes, that is, three-dimensional target objects, and from a certain perspective, the shape of the virtual target object obtained usually does not match the true shape of the virtual target object (there is a certain deformation). In this way, the initial virtual brightness distribution map of the virtual target object obtained also cannot represent the true virtual brightness distribution of the virtual target object. Therefore, in the above process, after obtaining the initial virtual brightness distribution map, it can be corrected by affine transformation processing to obtain a more accurate virtual brightness distribution map that can truly reflect the virtual brightness distribution of the virtual target object. Furthermore, based on this more accurate virtual brightness distribution map for subsequent virtual-real light alignment operations can effectively improve the effect of light alignment.

[0085] For example: If the virtual target object is a rectangular plate-shaped object, after obtaining the initial virtual brightness distribution map of the virtual target object from a certain perspective through the virtual rendering engine, it can be found that: this distribution map is not a regular rectangle, but an irregular quadrilateral. Therefore, through affine transformation processing, the above irregular quadrilateral can be corrected to a regular rectangle that matches the shape of the above rectangular plate-shaped virtual target object.

[0086] Optionally, in some of these embodiments, the above step 108 may include:

[0087] Adjust the setting position of the physical lamp within the position range and adjust the light parameters of the physical lamp;

[0088] Obtain the actual light illuminance information inside the target area in the actual scene;

[0089] Calculate the difference between the actual light illuminance information and the light illuminance information inside the virtual area in the virtual scene;

[0090] If the difference is greater than or equal to the preset difference threshold, return to the step of adjusting the setting position of the physical lamp within the position range and adjusting the light parameters of the physical lamp until the difference is less than the preset difference threshold.

[0091] Specifically, during the virtual-real light alignment process, by adjusting the set position of the physical lamp within a relatively accurate position range and adjusting the light parameters, a better virtual-real alignment effect can be obtained, and the difficulty of lighting layout in the actual scene can be effectively reduced.

[0092] Embodiment 2

[0093] Referring to Figure 3 , Figure 3 is a structural block diagram of a virtual-real light alignment device according to Embodiment 2 of the present application. The device includes:

[0094] An illuminance acquisition module 302, configured to acquire a light illuminance distribution map inside a virtual area in a virtual scene; the virtual area is a position corresponding to a target area in the actual scene;

[0095] A calculation module 304, configured to calculate an incident position point of the irradiation center line of the virtual light in the virtual area according to the light illuminance distribution map; and determine the incident attitude information of the irradiation center line based on the illuminance gradient distribution around the incident position point;

[0096] A position range determination module 306, configured to determine the position range of the physical lamp in the actual scene based on the incident position point and the incident attitude information;

[0097] An alignment module 308, configured to adjust the set position of the physical lamp within the position range and adjust the light parameters of the physical lamp to achieve virtual-real light alignment between the virtual area and the target area.

[0098] Optionally, in some embodiments, the incident attitude information includes: an elevation angle and a light projection direction; the elevation angle is the angle between the light irradiation line at the position of the irradiation center line and the plane where the incident position point is located; the light projection direction is the direction of the projection of the light irradiation line at the position of the irradiation center line in the above plane; when the calculation module 304 executes the step of determining the incident attitude information of the irradiation center line based on the illuminance gradient distribution around the incident position point, it is specifically configured to:

[0099] Calculate the illuminance gradient value around the irradiation center point based on the light illuminance distribution map;

[0100] Determine the opposite direction of the target direction where the maximum illuminance gradient value is located as the light projection direction;

[0101] Perform inverse trigonometric calculation based on the maximum illuminance gradient value and the illuminance gradient value in the light projection direction to obtain the elevation angle.

[0102] Optionally, in some embodiments, the position range determination module 306 is specifically configured to:

[0103] Based on the incident position point and incident attitude information, determine the virtual position range of the virtual light in the virtual scene; the virtual position range is the position range of the virtual light relative to the virtual area;

[0104] Based on the virtual position range and the corresponding relationship between the target area and the virtual area, obtain the position range of the physical lamp in the actual scene; the position range of the physical lamp is the position range relative to the target area.

[0105] Optionally, in some embodiments, a virtual target object with known illumination attribute information is set at the virtual area; the illuminance acquisition module 302 is specifically configured to:

[0106] In the virtual scene, determine the virtual position of the virtual area corresponding to the target area in the actual scene;

[0107] Based on the virtual position, obtain the virtual brightness distribution map of the virtual target object;

[0108] Based on the virtual brightness distribution map, the illumination attribute information, and the preset relationship satisfied among the virtual brightness, the illumination attribute information, and the lamp illuminance, calculate and obtain the lamp illuminance distribution map inside the virtual area.

[0109] Optionally, in some embodiments, when the illuminance acquisition module 302 executes the step of obtaining the virtual brightness distribution map of the virtual target object based on the virtual position, it is specifically configured to:

[0110] Based on the virtual position, obtain the initial virtual brightness distribution map of the virtual target object under a preset viewing angle through the virtual rendering engine;

[0111] Perform an affine transformation process on the initial virtual brightness distribution map to obtain the virtual brightness distribution map of the processed virtual target object.

[0112] Optionally, in some embodiments, the alignment module 308 is specifically configured to:

[0113] Adjust the set position of the physical lamp within the position range and adjust the lighting parameters of the physical lamp;

[0114] Obtain the actual lamp illuminance information inside the target area in the actual scene;

[0115] Calculate the difference between the actual lamp illuminance information and the lamp illuminance information inside the virtual area in the virtual scene;

[0116] If the difference is greater than or equal to the preset difference threshold, return to the step of adjusting the set position of the physical lamp within the position range and adjusting the lighting parameters of the physical lamp until the difference is less than the preset difference threshold.

[0117] The virtual-real light alignment device of this embodiment is used to implement the corresponding virtual-real light alignment method in the foregoing virtual-real light alignment method embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be elaborated here. In addition, the function implementation of each module in the virtual-real light alignment device of this embodiment can refer to the description of the corresponding part in the foregoing method embodiment, which will not be elaborated here either.

[0118] Embodiment III

[0119] Referring to Figure 4 , a schematic structural diagram of an electronic device according to Embodiment III of the present application is shown. The specific implementation of the electronic device is not limited in the specific embodiments of the present application.

[0120] As Figure 4 shown, the control terminal may include: a processor 402, a communications interface 404, a memory 406, and a communication bus 408.

[0121] Among them:

[0122] The processor 402, the communications interface 404, and the memory 406 communicate with each other through the communication bus 408.

[0123] The communications interface 404 is used to communicate with other electronic devices or servers.

[0124] The processor 402 is used to execute the program 410, and specifically can execute the relevant steps in the foregoing virtual-real light alignment method embodiment.

[0125] Specifically, the program 410 may include program code, and the program code includes computer operation instructions.

[0126] The processor 402 may be a CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. One or more processors included in the intelligent device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.

[0127] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0128] The program 410 may include multiple computer instructions. Specifically, the program 410 may cause the processor 402 to perform the operations corresponding to the methods described in the foregoing multiple method embodiments through the multiple computer instructions.

[0129] For the specific implementation of each step in the program 410, reference may be made to the corresponding descriptions in the corresponding steps and units in the foregoing method embodiments, and they have the corresponding beneficial effects, which will not be elaborated here. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the devices and modules described above can refer to the corresponding process descriptions in the foregoing method embodiments, which will not be elaborated here.

[0130] The embodiments of the present application also provide a computer storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the method described in any one of the foregoing multiple method embodiments. The computer storage medium includes, but is not limited to: Compact Disc Read-Only Memory (CD-ROM), Random Access Memory (RAM), floppy disk, hard disk, magneto-optical disk, etc.

[0131] The embodiments of the present application also provide a computer program product, including computer instructions, and the computer instructions instruct a computing device to perform the operations corresponding to any one of the foregoing multiple method embodiments.

[0132] In addition, it should be noted that the information related to users (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data for training a model, data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the users or fully authorized by all parties. And the collection, use, and processing of the relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject.

[0133] It should be pointed out that according to the needs of implementation, each component / step described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.

[0134] The method according to the embodiments of the present application can be implemented in hardware, firmware, or be implemented as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or be implemented as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium and downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored on such a recording medium for software processing using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an Application Specific Integrated Circuit (ASIC) or a Field Programmable Gate Array (FPGA)). It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component (such as a Random Access Memory (RAM), a Read-Only Memory (ROM), a flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown herein.

[0135] Those of ordinary skill in the art can realize that the units and method steps of each example described in combination with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such an implementation should not be considered to exceed the scope of the embodiments of the present application.

[0136] The above embodiments are only used to illustrate the embodiments of the present application, rather than to limit the embodiments of the present application. Those of ordinary skill in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The patent protection scope of the embodiments of the present application shall be defined by the claims.

Claims

1. A method for aligning virtual and real lights, comprising: Obtaining a light intensity distribution map inside a virtual area in a virtual scene; the virtual area is a position corresponding to a target area in the real scene and having a spatial alignment relationship; Calculating extreme points of light intensity according to the light intensity distribution map to obtain incident position points of the irradiation center line of the virtual light in the virtual area; and determining incident attitude information of the irradiation center line based on the light intensity gradient distribution around the incident position points, wherein the number of the incident position points is equal to the number of simplified virtual lamps in the virtual scene; Determining the position range of the physical lamp in the real scene based on the incident position points and the incident attitude information, including: determining the virtual position range of the virtual light in the virtual scene based on the incident position points and the incident attitude information; the virtual position range is located on the straight line where the irradiation center line is located, and the virtual position range is the position range of the virtual light relative to the virtual area; obtaining the position range of the physical lamp in the real scene based on the virtual position range and the corresponding relationship between the target area and the virtual area; the position range of the physical lamp is the position range relative to the target area, wherein the position range of the physical lamp and the position range of the virtual lamp satisfy a spatial alignment relationship; Adjusting the setting position of the physical lamp and adjusting the light parameters of the physical lamp within the position range of the physical lamp to achieve the alignment of virtual and real lights between the virtual area and the target area.

2. The method according to claim 1, wherein The incident attitude information includes: altitude angle and light projection direction; the altitude angle is the angle between the light irradiation line at the position of the irradiation center line and the plane where the incident position points are located; the light projection direction is the direction of the projection of the light irradiation line at the position of the irradiation center line in the plane; The determining the incident attitude information of the irradiation center line based on the light intensity gradient distribution around the incident position points includes: Calculating the light intensity gradient values around the irradiation center point based on the light intensity distribution map; Determining the reverse direction of the target direction where the maximum light intensity gradient value is located as the light projection direction; Performing inverse trigonometric calculation based on the maximum light intensity gradient value and the light intensity gradient values in the light projection direction to obtain the altitude angle.

3. The method according to any one of claims 1-2, wherein, A virtual target object with known light attribute information is set at the virtual area; The obtaining the light intensity distribution map inside the virtual area in the virtual scene includes: Determining the virtual position of the virtual area corresponding to the target area in the real scene in the virtual scene; Obtaining the virtual brightness distribution map of the virtual target object based on the virtual position; Calculating and obtaining the light intensity distribution map inside the virtual area based on the virtual brightness distribution map, the light attribute information, and a preset relationship satisfied among virtual brightness, light attribute information, and light intensity; 4. The method according to claim 3, wherein, The obtaining the virtual brightness distribution map of the virtual target object based on the virtual position includes: Based on the virtual position, obtain an initial virtual brightness distribution map of the virtual target object from a preset perspective through a virtual rendering engine; Perform an affine transformation on the initial virtual brightness distribution map to obtain the virtual brightness distribution map of the processed virtual target object.

5. The method according to any one of claims 1-2, wherein, Adjusting the setting position of the physical lamp within the position range of the physical lamp and adjusting the lighting parameters of the physical lamp to achieve virtual-real lighting alignment between the virtual area and the target area includes: Adjust the setting position of the physical lamp within the position range of the physical lamp and adjust the lighting parameters of the physical lamp; Obtain the actual lighting illuminance information inside the target area in the actual scene; Calculate the difference between the actual lighting illuminance information and the lighting illuminance information inside the virtual area in the virtual scene; If the difference is greater than or equal to a preset difference threshold, return to the step of adjusting the setting position of the physical lamp within the position range of the physical lamp and adjusting the lighting parameters of the physical lamp until the difference is less than the preset difference threshold.

6. A virtual-real lighting alignment device, comprising: An illuminance acquisition module for acquiring the lighting illuminance distribution map inside the virtual area in the virtual scene; the virtual area is a position corresponding to the target area in the actual scene and having a spatial alignment relationship; A calculation module for calculating the illuminance extreme point according to the lighting illuminance distribution map to obtain the incident position point of the irradiation center line of the virtual light in the virtual area; and determining the incident attitude information of the irradiation center line based on the illuminance gradient distribution around the incident position point, wherein the number of incident position points is equal to the number of simplified virtual lamps in the virtual scene; A position range determination module for determining the position range of the physical lamp in the actual scene based on the incident position point and the incident attitude information, including: determining the virtual position range of the virtual light in the virtual scene based on the incident position point and the incident attitude information; the virtual position range is located on the straight line where the irradiation center line is located, and the virtual position range is the position range of the virtual light relative to the virtual area; based on the virtual position range and the corresponding relationship between the target area and the virtual area, obtain the position range of the physical lamp in the actual scene; the position range of the physical lamp is the position range relative to the target area, wherein the position range of the physical lamp and the position range of the virtual lamp satisfy the spatial alignment relationship; An alignment module for adjusting the setting position of the physical lamp within the position range of the physical lamp and adjusting the lighting parameters of the physical lamp to achieve virtual-real lighting alignment between the virtual area and the target area.

7. An electronic device, comprising: A processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the operations corresponding to the method according to any one of claims 1-5.

8. A computer storage medium having a computer program stored thereon, the program, when executed by a processor, implementing the method according to any one of claims 1-5.

9. A computer program product comprising computer instructions that direct a computing device to execute the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Method for modifying stereoscopic pairs of images and apparatus

    CN112789849A

  • Image display method and device, AR head-mounted equipment and storage medium

    CN114494659A

  • Light control method and storage medium

    CN116506993A