An ambient light effect simulation method, apparatus, device and readable storage medium
By fitting and mapping the initial light distribution of the ambient light source, multiple target light distributions with different brightness and color are generated and superimposed, solving the problem of insufficient simulation of ambient light effects in existing technologies and realizing efficient generation of ambient light effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUDAN UNIVERSITY
- Filing Date
- 2022-09-09
- Publication Date
- 2026-07-14
AI Technical Summary
There is a lack of effective and rapid means to simulate ambient lighting effects in existing technologies.
By acquiring the initial light distribution of a single light source of the ambient light on a preset receiving surface, fitting it using a preset fitting function, reconstructing the light distribution, and mapping it to a preset color space, multiple target light distributions with different brightness and color are generated. Finally, the simulated effect of the ambient light is formed by superimposing these distributions.
It achieves simple and low-cost simulation of ambient lighting effects, and can generate static and dynamic ambient lighting effects in real time, improving the harmony and comfort of ambient lighting.
Smart Images

Figure CN116309089B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technology, and in particular to a method, apparatus, device and readable storage medium for simulating ambient lighting effects. Background Technology
[0002] With the continuous improvement of technology, ambient lighting is being used more and more widely in indoor spaces, airplanes, cars and other places. People's requirements for the coordination and comfort of ambient lighting are also getting higher and higher. The effect of ambient lighting is related to the dynamic changes in brightness and color. Different ambient lighting effects have different effects on people's feelings. Therefore, it is necessary to design an effective way to simulate the effect of ambient lighting. Summary of the Invention
[0003] This application provides an ambient lighting effect simulation method, apparatus, device, and readable storage medium, which can at least solve the problem of the lack of effective and fast ambient lighting effect simulation means in related technologies.
[0004] The first aspect of this application provides a method for simulating ambient lighting effects, including:
[0005] Obtain the initial light distribution of a single light source of the ambient light to be simulated on a preset receiving surface;
[0006] The initial light distribution is fitted using a preset fitting function to obtain a reconstructed light distribution;
[0007] The reconstructed light distribution is mapped to a preset color space to obtain multiple different target light distributions corresponding to the single light source; wherein the multiple target light distributions have different brightness and / or color;
[0008] The target light distributions are superimposed to obtain the single-light source simulation effect data of the ambient light to be simulated.
[0009] A second aspect of this application provides an ambient lighting effect simulation device, comprising:
[0010] The acquisition module is used to acquire the initial light distribution of a single light source of the ambient light to be simulated on a preset receiving surface;
[0011] The fitting module is used to fit the initial light distribution using a preset fitting function to obtain a reconstructed light distribution;
[0012] A mapping module is used to map the reconstructed light distribution to a preset color space to obtain multiple different target light distributions corresponding to the single light source; wherein the multiple target light distributions have different brightness and / or color;
[0013] The overlay module is used to overlay multiple target light distributions to obtain single-source simulation effect data of the ambient light to be simulated.
[0014] A third aspect of this application provides an electronic device, including a memory and a processor, wherein the processor is used to execute a computer program stored in the memory, and when the processor executes the computer program, it implements the steps in the ambient lighting effect simulation method provided in the first aspect of this application.
[0015] The fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the steps of the ambient lighting effect simulation method provided in the first aspect of this application.
[0016] As can be seen from the above, according to the ambient lighting effect simulation method, apparatus, equipment, and readable storage medium provided in this application, the initial light distribution of a single light source of the ambient lighting to be simulated on a preset receiving surface is obtained; the initial light distribution is fitted by a preset fitting function to obtain a reconstructed light distribution; the reconstructed light distribution is mapped to a preset color space to obtain multiple different target light distributions corresponding to a single light source; wherein, the multiple target light distributions have different brightness and / or color; the multiple target light distributions are superimposed to obtain the single-light source simulation effect data of the ambient lighting to be simulated. Through the implementation of this application, the light distribution of the light source is reconstructed and mapped to obtain a multi-spot effect, and then the multi-spot effects are superimposed to form a simulation effect. The overall implementation is simple, low-cost, and has strong application value. Attached Figure Description
[0017] Figure 1 This is a basic flowchart illustrating an ambient lighting effect simulation method provided in the first embodiment of this application.
[0018] Figure 2 A schematic diagram of the initial light distribution of a single light source provided in the first embodiment of this application;
[0019] Figure 3 A schematic diagram of a reconstructed light distribution provided in the first embodiment of this application;
[0020] Figure 4 A detailed flowchart illustrating an ambient lighting effect simulation method provided in the second embodiment of this application;
[0021] Figure 5 This is a schematic diagram of the program modules of the ambient lighting effect simulation device provided in the third embodiment of this application;
[0022] Figure 6 This is a schematic diagram of the structure of an electronic device provided in the fourth embodiment of this application. Detailed Implementation
[0023] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] In the description of the embodiments of this application, it should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings. They are only for the convenience of describing the embodiments of this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting the present invention.
[0025] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0026] In the embodiments of this application, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0027] The above description is merely a preferred embodiment of this application and is not intended to limit the invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
[0028] To address the lack of effective and rapid methods for simulating ambient lighting effects in related technologies, the first embodiment of this application provides a method for simulating ambient lighting effects, such as... Figure 1 This is a basic flowchart illustrating the ambient lighting effect simulation method provided in this embodiment. The ambient lighting effect simulation method includes the following steps:
[0029] Step 101: Obtain the initial light distribution of a single light source of the ambient light to be simulated on the preset receiving surface.
[0030] Specifically, in this embodiment, the ambient light to be simulated can be a side-emitting ambient light (e.g., a side-emitting optical fiber) or an end-emitting ambient light. This embodiment preferably uses a side-emitting ambient light. The multiple light sources of the side-emitting ambient light are arranged according to a certain pattern, and the light-emitting surface of the light source is provided with a light-conducting medium. Depending on the different light conduction forms, the light-conducting medium in this embodiment can flexibly select its characteristic attributes according to actual needs, including but not limited to material, shape, light transmittance, color, etc. Its material type further includes optical fiber material, glass material, crystal material, acrylic material, etc., and the shape type can include planar, sheet, etc. It is worth noting that the optical effect type of each single light source in the ambient light can be different, and the characteristic attributes of the corresponding light-conducting medium of each single light source can also be different. This embodiment does not limit this to a single type. For example, the ambient light to be simulated in this embodiment can include ten single light sources, each of which can have a variety of different optical effects. Ten light-conducting media (e.g., light guide plates) are respectively set for the ten single light sources. Each light-conducting medium has different material characteristics and color characteristics. Thus, the ambient light to be simulated can form a changing dynamic effect in the actual lighting scene. In this embodiment, for a single light source of an actual side-emitting ambient light, the image spot of its emitted light after passing through the light transmission medium and appearing on a receiving surface at a preset distance can be acquired to obtain the initial light distribution of the single light source. Alternatively, this embodiment can also simulate a virtual ambient light using optical software (such as TracePro) to obtain the light distribution on a specific receiving surface. Figure 2 The diagram shown is a schematic diagram of the initial light distribution of a single light source provided in this embodiment, with the relative distance between the receiving surface and the light source being 0.5m.
[0031] Step 102: Fit the initial light distribution using a preset fitting function to obtain the reconstructed light distribution.
[0032] Specifically, the fitting function in this embodiment can preferably be implemented using a bivariate function. That is, in this embodiment, the light emission spot of the light source is fitted with a function to obtain the reconstructed light distribution.
[0033] In practical applications, different side-emitting ambient lights have different light source types and light transmission media, resulting in substantial differences in their light emission behavior. To ensure effective light distribution fitting, this embodiment obtains the characteristic attributes of the light source type (or optical effect type) and / or light transmission medium of the side-emitting ambient light before performing function fitting. Based on the characteristic attributes of the light source type and / or light transmission medium, a corresponding fitting function is selected. That is, this embodiment pre-configures multiple available fitting functions, allowing for the determination of effective fitting functions for different light source types and / or light transmission medium characteristic attributes, ensuring the accuracy of the final reconstructed light distribution.
[0034] In a preferred embodiment of this example, the above-mentioned fitting function can be expressed as:
[0035]
[0036] Where (x,y) represents the light distribution coordinates, f(x,y) represents the intensity, A represents the intensity adjustment coefficient, (x0,y0) represents the light source coordinates, and σ x σ y These represent the adjustment coefficients in the x and y directions, respectively.
[0037] In one implementation, the fitted coefficients are A = 0.000484, x0 = 2.499896, and σ x =-0.34094, y0=2.499507, σ y = -0.33992, goodness of fit is 0.986. Finally, the schematic diagram of the reconstructed light distribution corresponding to the aforementioned initial light distribution obtained by fitting the function is shown below. Figure 3 As shown, the above fitting function has high fitting accuracy and can effectively meet the needs of practical applications.
[0038] Step 103: Map the reconstructed light distribution to a preset color space to obtain multiple different target light distributions corresponding to a single light source.
[0039] Specifically, the multiple target light distributions in this embodiment have different brightness and / or color. In this embodiment, the result of fitting the light distribution of a single light source can be regarded as the unit of reconstructing the light distribution. The reconstructed light distribution is a relative value. In practical applications, its intensity and color can be mapped to the corresponding color space to obtain multiple light distributions with different brightness and color.
[0040] Step 104: Superimpose multiple target light distributions to obtain single-source simulation effect data of the ambient light to be simulated.
[0041] Specifically, in this embodiment, after obtaining the multi-spot effect of a single light source, the multi-spot effects are superimposed to obtain the simulated light distribution effect of a single light source. In this embodiment, taking an RGB system as an example, the reconstructed light distribution of a single light source is mapped to the RGB space, i.e., R(x,y)=f(x,y). R G(x,y)=f(x,y) G B(x,y)=f(x,y) B The simulated light distribution effect after superposition is H(x,y)=w1·R(x,y)+w2·G(x,y)+w3·B(x,y), where w1, w2, and w3 are weighting coefficients. The resulting H(x,y) is the simulated light emission effect of a single light source, with different brightness and color effects.
[0042] In an optional embodiment of this example, the ambient light to be simulated has multiple light sources. Accordingly, after the step of superimposing the distributions of multiple target lights to obtain the single light source simulation effect of the ambient light to be simulated, the method further includes: obtaining the single light source simulation effect data corresponding to the multiple light sources of the ambient light to be simulated; and superimposing all the single light source simulation effect data to obtain the overall simulation effect data of the ambient light to be simulated.
[0043] Specifically, the above only simulates the luminous effect of a single light source in the ambient light. However, in practical applications, ambient lights typically have multiple light sources that work together to create the desired atmosphere. Therefore, this embodiment performs steps 101 to 104 for each individual light source of the ambient light, and then synthesizes the simulated effect data of all individual light sources to obtain the overall simulated effect data of the ambient light. In complex application scenarios, the optical effect types of the multiple light sources in the ambient light of this embodiment may differ, and the characteristic properties of the light transmission medium corresponding to each light source may also differ. By obtaining the simulated effect data of each individual light source separately and then synthesizing it, the overall mixed light simulation effect data of the ambient light can be obtained.
[0044] In an optional embodiment of this example, after the step of superimposing the single-light source simulation effect data corresponding to all light sources of the ambient light to be simulated to obtain the overall simulation effect data of the ambient light to be simulated, the method further includes: obtaining the overall simulation effect data corresponding to multiple light emission moments of the ambient light to be simulated according to a preset light emission sequence; and superimposing all the overall simulation effect data to obtain the dynamic simulation effect data of the ambient light to be simulated.
[0045] Specifically, the aforementioned implementation only simulates the lighting effect at a single moment, that is, it simulates a static lighting effect. However, in practical applications, ambient lights have dynamic lighting requirements, and the overall lighting sequence has multiple lighting moments with different control parameters. Therefore, this embodiment obtains the overall simulation effect data of each lighting moment in the aforementioned manner, and then superimposes all the overall simulation effect data to form dynamic simulation effect data.
[0046] In an optional embodiment of this example, after the step of superimposing multiple target light distributions to obtain single-source simulation effect data of the ambient light to be simulated, the method further includes: matching the single-source simulation effect data with the corresponding actual light emission effect data; comparing the matching degree with a preset matching degree threshold; when the matching degree is lower than the matching degree threshold, adjusting the fitting parameters of the fitting function, and then returning to execute the step of fitting the initial light distribution through the preset fitting function.
[0047] Specifically, after obtaining the simulated light distribution effect based on the initially configured fitting function, this embodiment further verifies the simulated light distribution effect, that is, matches the simulated effect data with the actual light emission effect data, and determines whether the simulated effect meets the standard by the obtained matching degree. If not, it indicates that the effectiveness of the initially configured fitting function is poor. In this embodiment, the fitting parameters of the fitting function are optimized, and then steps 102 to 104 above are re-executed based on the optimized fitting function until the matching degree between the finally obtained simulated effect data and the actual light emission effect data is greater than the preset matching degree threshold.
[0048] Based on the technical solution of the above embodiments of this application, the initial light distribution of a single light source of the ambient light to be simulated on a preset receiving surface is obtained; the initial light distribution is fitted by a preset fitting function to obtain a reconstructed light distribution; the reconstructed light distribution is mapped to a preset color space to obtain multiple different target light distributions corresponding to a single light source; wherein, the multiple target light distributions have different brightness and / or color; the multiple target light distributions are superimposed to obtain the single-light source simulation effect data of the ambient light to be simulated. Through the implementation of the solution of this application, the light distribution of the light source is reconstructed and mapped to obtain a multi-spot effect, and then the multi-spot effect is superimposed to form a simulation effect. The overall implementation is simple and low-cost, and it can generate static and dynamic ambient light effects in real time, which has strong application value.
[0049] Figure 4 The method described in the second embodiment of this application is a refined method for simulating ambient lighting effects, which includes:
[0050] Step 401: For a single light source of the ambient light to be simulated, obtain the imaging spot of the emitted light on the receiving surface at a preset distance after passing through the light transmission medium, and obtain the initial light distribution of the single light source.
[0051] In this embodiment, the ambient light to be simulated has multiple independent light sources, and the ambient light to be simulated can be a side-emitting optical fiber.
[0052] Step 402: Fit the initial light distribution using a preset fitting function to obtain the reconstructed light distribution.
[0053] In this embodiment, the fitting function can be implemented using a bivariate function.
[0054] Step 403: Map the reconstructed light distribution to a preset color space to obtain multiple different target light distributions corresponding to a single light source.
[0055] In this embodiment, multiple target light distributions have different brightness and / or color.
[0056] Step 404: Superimpose the light distributions of multiple targets to obtain the single-source simulation effect data of the ambient light to be simulated.
[0057] In this embodiment, the reconstructed light distribution is mapped to the color space as a unit, which can obtain multiple light distributions with different brightness and color. Then, after synthesis, the simulation effect data of a single light source is obtained.
[0058] Step 405: Superimpose the single-light source simulation effect data obtained for all light sources to obtain the overall simulation effect data of the ambient light to be simulated.
[0059] Step 406: Obtain the overall simulation effect data corresponding to multiple lighting moments of the ambient light to be simulated according to the preset lighting sequence.
[0060] Step 407: Overlay all the overall simulation effect data to obtain the dynamic simulation effect data of the ambient light to be simulated.
[0061] Since the overall simulation effect data obtained in step 405 corresponds to a single emission moment, this embodiment further simulates emission effect data for multiple emission moments separately, and then synthesizes all the data to obtain the corresponding dynamic simulation effect data under the dynamic emission scene.
[0062] It should be understood that the sequence number of each step in this embodiment does not imply the order in which the steps are executed. The execution order of each step should be determined by its function and internal logic, and should not constitute a unique limitation on the implementation process of this application embodiment.
[0063] Figure 5 This application provides a third embodiment of an ambient lighting effect simulation device. This ambient lighting effect simulation device can be applied to the aforementioned ambient lighting effect simulation method. For example... Figure 5As shown, the ambient lighting effect simulation device mainly includes:
[0064] The acquisition module 501 is used to acquire the initial light distribution of a single light source of the ambient light to be simulated on a preset receiving surface;
[0065] The fitting module 502 is used to fit the initial light distribution using a preset fitting function to obtain the reconstructed light distribution;
[0066] The mapping module 503 is used to map the reconstructed light distribution to a preset color space to obtain multiple different target light distributions corresponding to a single light source; wherein the multiple target light distributions have different brightness and / or color.
[0067] The overlay module 504 is used to overlay multiple target light distributions to obtain single-source simulation effect data of the ambient light to be simulated.
[0068] In some embodiments of this example, the ambient light to be simulated has multiple light sources; correspondingly, the acquisition module is also used to: acquire the single light source simulation effect data corresponding to the multiple light sources of the ambient light to be simulated; the superposition module is also used to: superimpose all the single light source simulation effect data to obtain the overall simulation effect data of the ambient light to be simulated.
[0069] Furthermore, in some embodiments of this example, the acquisition module is also used to: acquire overall simulation effect data corresponding to multiple light-emitting moments of the ambient light to be simulated according to a preset light-emitting sequence; the superposition module is also used to: superimpose all the overall simulation effect data to obtain the dynamic simulation effect data of the ambient light to be simulated.
[0070] In some embodiments of this example, the ambient light to be simulated is a side-emitting ambient light; accordingly, the acquisition module is specifically used to: for a single light source of the side-emitting ambient light, acquire the imaging light spot on the receiving surface at a preset distance after the emitted light passes through the light transmission medium, and obtain the initial light distribution of the single light source.
[0071] Furthermore, in some embodiments of this example, the acquisition module is also used to: acquire the light source type and / or characteristic properties of the light transmission medium of the side-emitting ambient light; in addition, the ambient light effect simulation device also includes: a selection module, used to select a corresponding fitting function based on the light source type and / or characteristic properties of the light transmission medium.
[0072] In some implementations of this embodiment, the fitting function is a bivariate function.
[0073] Furthermore, in some embodiments of this example, the fitting function can be expressed as:
[0074]
[0075] Where (x,y) represents the light distribution coordinates, f(x,y) represents the intensity, A represents the intensity adjustment coefficient, (x0,y0) represents the light source coordinates, and σ x σ y These represent the adjustment coefficients in the x and y directions, respectively.
[0076] Furthermore, in some embodiments of this example, the ambient lighting effect simulation device further includes a comparison module and an adjustment module, wherein the comparison module is used to match the simulated effect data of a single light source with the corresponding actual light emission effect data; compare the matching degree with a preset matching degree threshold; and the matching module is used to adjust the fitting parameters of the fitting function when the matching degree is lower than the matching degree threshold, and then trigger the fitting module to re-execute its function.
[0077] It should be noted that the ambient lighting effect simulation methods in the first and second embodiments can both be implemented based on the ambient lighting effect simulation device provided in this embodiment. Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the ambient lighting effect simulation device described in this embodiment can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0078] According to the ambient lighting effect simulation device provided in this embodiment, the initial light distribution of a single light source of the ambient light to be simulated on a preset receiving surface is obtained; the initial light distribution is fitted by a preset fitting function to obtain a reconstructed light distribution; the reconstructed light distribution is mapped to a preset color space to obtain multiple different target light distributions corresponding to a single light source; wherein, the multiple target light distributions have different brightness and / or color; the multiple target light distributions are superimposed to obtain the single-light source simulation effect data of the ambient light to be simulated. Through the implementation of the solution of this application, the light distribution of the light source is reconstructed and mapped to obtain a multi-spot effect, and then the multi-spot effect is superimposed to form a simulation effect. The overall implementation is simple and low-cost, and it can generate static and dynamic ambient lighting effects in real time, which has strong application value.
[0079] Figure 6 An electronic device is provided in the fourth embodiment of this application. This electronic device can be used to implement the ambient lighting effect simulation method in the foregoing embodiments, and mainly includes:
[0080] The system includes a memory 601, a processor 602, and a computer program 603 stored on the memory 601 and executable on the processor 602. The memory 601 and the processor 602 are connected via communication. When the processor 602 executes the computer program 603, it implements the method described in Embodiment 1 or 2 above. The number of processors can be one or more.
[0081] The memory 601 can be a high-speed random access memory (RAM) or a non-volatile memory, such as a disk storage device. The memory 601 is used to store executable program code, and the processor 602 is coupled to the memory 601.
[0082] Furthermore, embodiments of this application also provide a computer-readable storage medium, which may be disposed in the aforementioned electronic device, and the computer-readable storage medium may be as described above. Figure 6 The memory in the illustrated embodiment.
[0083] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the ambient lighting effect simulation method described in the foregoing embodiments. Furthermore, the computer-readable storage medium can also be a USB flash drive, external hard drive, read-only memory (ROM), RAM, magnetic disk, or optical disk, or any other medium capable of storing program code.
[0084] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0085] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0086] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0087] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned readable storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0088] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0089] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0090] The above is a detailed description of the ambient lighting effect simulation method, apparatus, device, and readable storage medium provided in this application. For those skilled in the art, based on the ideas provided in the embodiments of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for simulating ambient lighting effects, characterized in that, include: The initial light distribution of a single light source of an ambient light to be simulated on a preset receiving surface is obtained. The ambient light to be simulated is a side-emitting ambient light. The process of obtaining the initial light distribution of a single light source of the ambient light to be simulated on the preset receiving surface includes obtaining the image spot of the emitted light on the receiving surface at a preset distance after the light passes through the light transmission medium for the single light source of the side-emitting ambient light, thereby obtaining the initial light distribution of the single light source. The initial light distribution is fitted using a preset fitting function to obtain a reconstructed light distribution. The fitting function is a bivariate function, expressed as follows: , Where (x,y) represents the light distribution coordinates, f(x,y) represents the intensity, A represents the intensity adjustment coefficient, (x0,y0) represents the light source coordinates, and σ x σ y These represent the adjustment coefficients in the x and y directions, respectively. The reconstructed light distribution is mapped to a preset color space to obtain multiple different target light distributions corresponding to the single light source; wherein the multiple target light distributions have different brightness and / or color; The target light distributions are superimposed to obtain the single-light source simulation effect data of the ambient light to be simulated.
2. The ambient lighting effect simulation method according to claim 1, characterized in that, The ambient light to be simulated is provided with multiple light sources. After the step of superimposing the multiple target light distributions to obtain the single-light source simulation effect of the ambient light to be simulated, the method further includes: Acquire the single-light source simulation effect data corresponding to the multiple light sources of the ambient light to be simulated; By superimposing all the single-light source simulation effect data, the overall simulation effect data of the ambient light to be simulated is obtained.
3. The ambient lighting effect simulation method according to claim 2, characterized in that, After the step of superimposing the single-light source simulation effect data corresponding to all light sources of the ambient light to be simulated to obtain the overall simulation effect data of the ambient light to be simulated, the method further includes: According to the preset light emission sequence, the overall simulation effect data corresponding to multiple light emission moments of the ambient light to be simulated are obtained respectively; By superimposing all the overall simulation effect data, the dynamic simulation effect data of the ambient light to be simulated is obtained.
4. The ambient lighting effect simulation method according to claim 1, characterized in that, Before the step of fitting the initial light distribution with a preset fitting function to obtain the reconstructed light distribution, the method further includes: Obtain the light source type and / or characteristic properties of the light transmission medium of the side-emitting ambient light; The appropriate fitting function is selected based on the type of light source and / or the characteristic properties of the light transmission medium.
5. The method for simulating ambient lighting effects according to any one of claims 1 to 4, characterized in that, After the step of superimposing multiple target light distributions to obtain the single-source simulation effect data of the ambient light to be simulated, the method further includes: The simulated single-light source effect data is matched with the corresponding actual light emission effect data; Compare the matching score with a preset matching score threshold; When the matching degree is lower than the matching degree threshold, the fitting parameters of the fitting function are adjusted, and then the process returns to the step of fitting the initial light distribution with the preset fitting function.
6. An ambient lighting effect simulation device, characterized in that, include: The acquisition module is used to acquire the initial light distribution of a single light source of the ambient light to be simulated on a preset receiving surface. The ambient light to be simulated is a side-emitting ambient light. The acquisition of the initial light distribution of a single light source of the ambient light to be simulated on the preset receiving surface includes, for the single light source of the side-emitting ambient light, acquiring the imaging spot of the emitted light after passing through the light transmission medium on the receiving surface at a preset distance, and obtaining the initial light distribution of the single light source. The fitting module is used to fit the initial light distribution to a preset fitting function to obtain a reconstructed light distribution. The fitting function is a bivariate function, which is expressed as follows: , Where (x,y) represents the light distribution coordinates, f(x,y) represents the intensity, A represents the intensity adjustment coefficient, (x0,y0) represents the light source coordinates, and σ x σ y These represent the adjustment coefficients in the x and y directions, respectively. A mapping module is used to map the reconstructed light distribution to a preset color space to obtain multiple different target light distributions corresponding to the single light source; wherein the multiple target light distributions have different brightness and / or color; The overlay module is used to overlay multiple target light distributions to obtain single-source simulation effect data of the ambient light to be simulated.
7. An electronic device, characterized in that, Includes memory and processor, of which: The processor is used to execute computer programs stored in the memory; When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.