Camera-based light ray sensing method, system, electronic device, and storage medium
By utilizing the camera of a smart device to acquire ambient light source parameters, generating a fitting equation to predict the LUX value, and adjusting the screen brightness, the problem of increased costs associated with light sensing functions in smart devices is solved, achieving cost-effective light sensing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DONGGUAN HUABEL ELECTRONICS TECH
- Filing Date
- 2022-12-30
- Publication Date
- 2026-06-26
Smart Images

Figure CN116026454B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically, to a camera-based light sensing method, system, electronic device, and storage medium. Background Technology
[0002] With the continuous development of technology, most existing smart devices have built-in light sensing capabilities. This means that in bright environments, the light sensor automatically increases the screen brightness, and in dimly lit environments, it automatically decreases the screen brightness. However, this method requires pre-installing a light sensor in the smart device, which increases costs.
[0003] Therefore, how to achieve light sensing functionality in smart devices while saving costs is a problem that this application urgently needs to solve. Summary of the Invention
[0004] In view of this, the present invention provides a camera-based light sensing method, system, electronic device, and storage medium, with the aim of realizing the light sensing function of smart devices while saving costs.
[0005] The first aspect of this invention discloses a camera-based light sensing method, the method comprising:
[0006] The ambient light parameters in the current environment are obtained using a camera in a smart device; wherein, the ambient light parameters include the current ambient brightness and the current ambient color temperature.
[0007] Obtain the standard ambient brightness of the current environment, and determine the target ambient brightness of the current environment based on the standard brightness and the current ambient brightness;
[0008] The target fitting equation coefficients for matching the current ambient color temperature are determined from multiple fitting equation coefficients, and a target fitting equation is generated based on the target fitting equation coefficients and the initial fitting equation; wherein, the multiple fitting equation coefficients are obtained by fitting sample environmental data and the initial fitting equation;
[0009] The LUX value in the current environment is predicted based on the target fitting equation and the target current ambient brightness, and the screen luminance of the smart device is adjusted based on the LUX value in the current environment.
[0010] Optionally, obtaining the standard ambient brightness of the current environment and determining the target ambient brightness of the current environment based on the standard brightness and the current ambient brightness includes:
[0011] Obtain the standard ambient brightness of the current environment, and determine the target BV acquisition method that matches the standard ambient brightness from various preset BV acquisition methods;
[0012] Based on the target BV acquisition method, standard ambient brightness, and the current ambient brightness, the target current ambient brightness is determined.
[0013] Optionally, each of the BV acquisition methods includes a first BV acquisition method and a second BV acquisition method, and determining the target BV acquisition method that matches the standard ambient brightness from the preset BV acquisition methods includes:
[0014] Obtain the standard ambient light level for the current environment;
[0015] Determine whether the standard ambient brightness is greater than or equal to zero;
[0016] If the standard ambient brightness is greater than zero, the pre-set first BV acquisition method will be determined as the target BV acquisition method that matches the standard ambient brightness;
[0017] If the standard ambient brightness is not greater than zero, the pre-set second BV acquisition method is determined as the target BV acquisition method that matches the standard ambient brightness.
[0018] Optionally, the fitting process using sample environmental data and an initial fitting equation yields multiple fitting equation coefficients, including:
[0019] Acquire sample environment data; wherein, the sample environment data includes ambient color temperature samples, ambient brightness samples, target ambient brightness samples, and LUX value samples corresponding to each level of light source brightness; wherein, the target ambient brightness sample is calculated based on the ambient brightness samples and standard ambient brightness samples;
[0020] For each level of light source brightness, the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample are input into Matlab so that Matlab can use the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample to fit the equation and obtain the fitting equation coefficients corresponding to the ambient color temperature sample under the corresponding light source brightness.
[0021] A second aspect of the present invention discloses a camera-based light sensing system, the system comprising:
[0022] An ambient light source parameter acquisition unit is used to acquire ambient light source parameters in the current environment based on the camera in the smart device; wherein, the ambient light source parameters include the current ambient brightness and the current ambient color temperature.
[0023] The target current ambient brightness determination unit is used to acquire the standard ambient brightness of the current environment, and determine the target current ambient brightness of the current environment based on the standard brightness and the current ambient brightness.
[0024] The fitting prediction unit is used to determine the target fitting equation coefficients for matching the current environmental color temperature from multiple fitting equation coefficients, and to generate a target fitting equation based on the target fitting equation coefficients and the initial fitting equation; wherein, the multiple fitting equation coefficients are obtained by the fitting unit using sample environmental data and the initial fitting equation;
[0025] An adjustment unit is used to predict the LUX in the current environment based on the target fitting equation and the target current ambient brightness, and to adjust the screen luminance of the smart device based on the LUX value in the current environment.
[0026] Optionally, the target current ambient brightness determination unit includes:
[0027] The target BV acquisition method determination unit is used to acquire the standard ambient brightness of the current environment and determine the target BV acquisition method that matches the standard ambient brightness from a variety of preset BV acquisition methods;
[0028] The target current ambient brightness determination subunit is used to determine the target current ambient brightness based on the target BV acquisition method, standard ambient brightness, and the current ambient brightness.
[0029] Optionally, the target BV acquisition method determination unit includes:
[0030] A standard ambient brightness acquisition unit is used to acquire the standard ambient brightness of the current environment;
[0031] The judgment unit is used to determine whether the standard ambient brightness is greater than or equal to zero;
[0032] The first target BV acquisition method determination unit is used to determine the preset first BV acquisition method as the target BV acquisition method that matches the standard ambient brightness if the standard ambient brightness is greater than zero.
[0033] The second target BV acquisition method determination unit is used to determine the pre-set second BV acquisition method as the target BV acquisition method that matches the standard ambient brightness if the standard ambient brightness is not greater than zero.
[0034] Optionally, the fitting unit includes:
[0035] A sample environment data acquisition unit is used to acquire sample environment data; wherein, the sample environment data includes an ambient color temperature sample, an ambient brightness sample, a target ambient brightness sample, and a LUX value sample corresponding to each level of light source brightness; wherein, the target ambient brightness sample is calculated based on the ambient brightness sample and the standard ambient brightness sample;
[0036] The fitting subunit is used to input the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample into Matlab for each level of light source brightness, so that Matlab can use the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample to fit and obtain the fitting equation coefficients corresponding to the ambient color temperature sample under the corresponding light source brightness.
[0037] A third aspect of the present invention discloses an electronic device, comprising: a processor and a memory, the processor and the memory being connected via a communication bus; wherein, the processor is configured to call and execute a program stored in the memory; the memory is configured to store the program, the program being configured to implement the camera-based light sensing method disclosed in the first aspect of the present invention.
[0038] The fourth aspect of the present invention discloses a computer-readable storage medium storing computer-executable instructions for performing the camera-based light sensing method disclosed in the first aspect of the present invention.
[0039] This invention provides a camera-based light sensing method, system, electronic device, and storage medium. The method involves acquiring ambient light source parameters in the current environment using a camera in a smart device. These parameters include the current ambient brightness and current ambient color temperature. The method then acquires a standard ambient brightness and determines a target ambient brightness based on the standard and current ambient brightness. Next, it determines target fitting equation coefficients for matching the current ambient color temperature from multiple fitting equation coefficients and generates a target fitting equation based on these coefficients and an initial fitting equation. The multiple fitting equation coefficients are obtained by fitting sample environmental data and the initial fitting equation. Finally, it predicts the LUX (Light Usage Excess) in the current environment based on the target fitting equation and the target ambient brightness, and adjusts the screen brightness of the smart device according to the LUX value. This invention allows for the pre-fitting of multiple fitting parameters obtained from sample environmental data and the initial fitting equation. It enables direct prediction of the LUX in the current environment based on the ambient light source parameters and corresponding fitting parameters acquired by the camera in the smart device. This allows for adjustment of the screen brightness of the smart device based on the LUX value in the current environment, eliminating the need to install a light sensor in the smart device and thus reducing costs. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0041] Figure 1 A schematic flowchart of a camera-based light sensing method provided in an embodiment of the present invention;
[0042] Figure 2 An example diagram of sample environmental data provided in an embodiment of the present invention;
[0043] Figure 3 A fitting graph provided in an embodiment of the present invention;
[0044] Figure 4 A schematic diagram of a camera-based light sensing system provided in an embodiment of the present invention;
[0045] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0048] It should be noted that the concepts of "first" and "second" mentioned in this invention are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0049] It should be noted that the terms "a" and "a plurality of" used in this invention disclosure are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0050] See Figure 1 The diagram illustrates a flowchart of a camera-based light sensing method according to an embodiment of the present invention. The camera-based light sensing method specifically includes the following steps:
[0051] S101: Obtain ambient light parameters in the current environment based on the camera in the smart device; wherein, the ambient light parameters include the current ambient brightness and the current ambient color temperature.
[0052] In this embodiment, a target object in the current environment can be photographed using a camera in a smart device. The ambient light parameters of the current environment are then determined based on the ambient light parameters of the photographed target object. These ambient light parameters are stored in a log file corresponding to the camera, allowing a script command to be invoked to retrieve the ambient light parameters from the log file. The ambient light parameters include the current ambient brightness (BV1) and the current ambient color temperature (CCT).
[0053] It should be noted that smart devices can include mobile phones, AR, VR, in-vehicle terminals, robots, and so on.
[0054] Specifically, the brightness of the ambient light source parameters of the target object can be converted to obtain the current ambient brightness of the current environment. The method of converting the current ambient brightness of the target object's ambient light source parameters to obtain the current ambient brightness of the current environment is shown in formula (1).
[0055] BV1 = log2(B / 0.3K) (1)
[0056] Where BV1 is the current ambient brightness, and B is the brightness of the target object, which is the brightness level of the current environment.
[0057] It should be noted that the script command can be 3A log; specifically, calling the script command 3A log retrieves the current ambient color temperature (CCT) from the log file as Hal3ARaw:[getCurrResult]lcc AWBCCT value:3779, and the current ambient brightness as AeAlgo:[getAERealBV]m_i4BV:-6,Real:-6,-660,RealStable:-7Frac:12,BVT:47, / 5555,CWV:28 / 4807,m_u4Index*EVBase:11300,i4DeltaBV:12060. Here, the current ambient brightness is i4DeltaBV:12060, and the standard ambient brightness is m_i4BV:-6.
[0058] S102: Obtain the standard ambient brightness of the current environment, and determine the target ambient brightness of the current environment based on the standard brightness and the current ambient brightness.
[0059] In the specific execution step S102, after obtaining the current ambient brightness and current ambient color temperature in the current environment, the standard ambient brightness m_i4BV of the current environment can be further obtained so as to determine the target BV acquisition method that matches the standard ambient brightness from the various BV acquisition methods that are preset, and determine the target current ambient brightness BV2 of the current environment based on the target BV acquisition method, the standard ambient brightness and the current ambient brightness.
[0060] It should be noted that the standard ambient brightness m_i4BV of the current environment is the BV value of the current environment that can be directly obtained from the MTK platform.
[0061] Optionally, multiple BV acquisition methods are preset. These methods include a first BV acquisition method and a second BV acquisition method. The process of determining the target BV acquisition method matching the standard ambient brightness from these preset methods can be as follows: acquire the standard ambient brightness of the current environment; determine if the standard ambient brightness is greater than or equal to zero; if the standard ambient brightness is greater than zero, determine the preset first BV acquisition method as the target BV acquisition method matching the standard ambient brightness; if the standard ambient brightness is not greater than zero, determine the preset second BV acquisition method as the target BV acquisition method matching the standard ambient brightness.
[0062] For example, if (m_i4BV>=0)
[0063] real_bv=(m_i4BV+1)*100-(i4DeltaBV%100) / / (i4DeltaBV-i4DeltaBV / 100*100)
[0064] else
[0065] real_bv=(m_i4BV)*100-(i4DeltaBV%100)
[0066] It should be noted that (m_i4BV+1)*100-(i4DeltaBV%100) is the first method of obtaining BV, and (m_i4BV)*100-(i4DeltaBV%100) is the second method of obtaining BV. Here, (i4DeltaBV) represents the current ambient brightness BV1.
[0067] S103: Determine the target fitting equation coefficients for the current ambient color temperature matching from multiple fitting equation coefficients, and generate the target fitting equation based on the target fitting equation coefficients and the initial fitting equation.
[0068] Among them, the coefficients of multiple fitting equations are obtained by fitting the sample environment data and the initial fitting equation.
[0069] In this embodiment, the front camera of the smart device can be aimed at the light source in advance, and the smart device can be kept in a screen-off state. Then, an illuminance meter is placed next to the smart device, and the actual LUX value displayed by the illuminance meter is used as the standard. By adjusting the brightness or distance of the light source, the LUX values of the smart device and the illuminance meter decrease in increments of 50 LUX. At each level of light source brightness, corresponding ambient color temperature samples, ambient brightness samples, and LUX value samples are collected respectively.
[0070] Obtain the corresponding standard ambient brightness sample, and determine the BV acquisition method that matches the standard ambient brightness sample from the various pre-set BV acquisition methods; determine the corresponding target ambient brightness sample based on the BV acquisition method that matches the standard ambient brightness sample, the standard ambient brightness sample, and the ambient brightness sample.
[0071] For each level of light source brightness, the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample are input into Matlab so that Matlab can use the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample to fit the equation and obtain the fitting equation coefficients corresponding to the ambient color temperature sample under the corresponding level of light source brightness.
[0072] In practical applications, after obtaining the corresponding fitting equation coefficients, the coefficients are tested to check the accuracy of the predicted LUX values. Specifically: the front-facing camera of the smart device can be pointed at the light source beforehand, and the device's screen can be kept on. An illuminance meter is placed next to the device, and the actual LUX value displayed on the illuminance meter is used as the reference. By adjusting the brightness or distance of the light source, the LUX values of both the smart device and the illuminance meter decrease in increments of 50 LUX, determining the current LUX measured by the illuminance meter at each level of light source brightness; and this is done by calling the script command 3A. The log obtains the ambient luminance BV1 and ambient color temperature CCT corresponding to each light source brightness level. Based on the obtained ambient luminance and the corresponding standard ambient luminance, 10 sets of target ambient temperatures are determined, namely BV2_1, BV2_2, BV2_3, BV2_4, BV2_5, BV2_6, BV2_7, BV2_8, BV2_9, and BV2_10. The average target ambient luminance BV2_average is calculated using the determined 10 sets of target ambient luminance. Finally, the fitting equation coefficients for ambient color temperature matching are determined from multiple fitting equation coefficients. Based on the fitting equation coefficients for ambient color temperature matching and the initial fitting equation, the corresponding fitting equation and the average target ambient luminance are used to predict the LUX of light source A at the corresponding light source brightness level. Among them, the LUX of light source A corresponding to each light source brightness level, the current LUX measured by the illuminance meter, the ambient color temperature CCT, the ambient luminance BV1, the 10 sets of target ambient temperatures, and the average target ambient luminance constitute the corresponding sample environmental data, such as... Figure 2 As shown.
[0073] from Figure 2 As can be seen from the data, for each level of light source brightness, the corresponding fitting equation generated based on the fitting equation coefficients of the ambient color temperature matching of the light source brightness at that level and the initial fitting equation, as well as the LUX of the light box A light source predicted by the average target ambient brightness, are almost equal to the current LUX measured by the illuminance meter at that level of light source brightness. Therefore, it can be seen that the LUX predicted by using the obtained fitting equation coefficients is highly accurate, and thus it can be considered that the obtained fitting equation coefficients can be applied in practice.
[0074] In practical applications, the original data curves can be pre-plotted based on the LUX corresponding to each brightness level and the corresponding average target environment. Furthermore, the fitting curves generated using the fitting equation coefficients matching the ambient color temperature and the initial fitting equation can be plotted to obtain the corresponding fitting graphs, such as... Figure 3 As shown.
[0075] In the specific execution step S103, the target fitting equation coefficient that matches the current ambient color temperature can be determined from the multiple pre-fitted fitting equation coefficients. Finally, the determined target fitting equation system is substituted into the pre-set initial fitting equation to obtain the target fitting equation.
[0076] S104: Predict the LUX in the current environment based on the target fitting equation and the target's current ambient brightness, and adjust the screen luminance of the smart device according to the LUX value in the current environment.
[0077] In the specific execution step S104, after obtaining the target fitting equation, the LUX in the current environment can be predicted based on the target fitting equation and the target's current ambient brightness. The screen brightness of the smart device can then be adjusted based on the LUX value in the current environment, thereby enabling the use of the smart device's camera to replace the light sensor for physical light sensing, thus reducing costs.
[0078] This invention provides a camera-based light sensing method. It acquires ambient light source parameters in the current environment using a camera in a smart device. These parameters include the current ambient brightness and current ambient color temperature. The method acquires a standard ambient brightness and determines a target ambient brightness based on the standard and current ambient brightness. It then determines target fitting equation coefficients for matching the current ambient color temperature from multiple fitting equation coefficients and generates a target fitting equation based on these coefficients and an initial fitting equation. The multiple fitting equation coefficients are obtained by fitting sample environmental data and the initial fitting equation. Finally, it predicts the LUX (Light Usage Excess) in the current environment based on the target fitting equation and the target ambient brightness, and adjusts the screen brightness of the smart device according to the LUX value. This invention allows for the pre-assessment of multiple fitting parameters obtained from sample environmental data and the initial fitting equation. It directly predicts the LUX based on the ambient light source parameters and corresponding fitting parameters acquired by the camera in the smart device, enabling the adjustment of the screen brightness according to the LUX value. This eliminates the need to install a light sensor in the smart device, thus reducing costs.
[0079] Based on the camera-based light sensing method disclosed in the embodiments of the present invention, the embodiments of the present invention also disclose a camera-based light sensing system, such as... Figure 4 As shown, this camera-based light sensing includes:
[0080] The ambient light source parameter acquisition unit 41 is used to acquire ambient light source parameters in the current environment based on the camera in the smart device; wherein, the ambient light source parameters include the current ambient brightness and the current ambient color temperature.
[0081] The target current ambient brightness determination unit 42 is used to obtain the standard ambient brightness of the current environment, and determine the target current ambient brightness based on the standard brightness and the current ambient brightness.
[0082] The fitting prediction unit 43 is used to determine the target fitting equation coefficients for matching the current ambient color temperature from multiple fitting equation coefficients, and to generate a target fitting equation based on the target fitting equation coefficients and the initial fitting equation; wherein, the multiple fitting equation coefficients are obtained by the fitting unit using sample environmental data and the initial fitting equation for fitting.
[0083] The adjustment unit 44 is used to predict the LUX in the current environment based on the target fitting equation and the target current ambient brightness, and adjust the screen brightness of the smart device according to the LUX value in the current environment.
[0084] This invention provides a camera-based light sensing system that uses a camera in a smart device to acquire ambient light source parameters in the current environment. These parameters include the current ambient brightness and current ambient color temperature. The system acquires a standard ambient brightness and determines a target ambient brightness based on the standard and current ambient brightness. It then determines target fitting equation coefficients for matching the current ambient color temperature from multiple fitting equation coefficients and generates a target fitting equation based on the target fitting equation coefficients and an initial fitting equation. These multiple fitting equation coefficients are obtained by fitting sample environmental data and the initial fitting equation. Finally, it predicts the LUX (Light Usage Excess) in the current environment based on the target fitting equation and the target ambient brightness, and adjusts the screen brightness of the smart device according to the LUX value in the current environment. This invention's technical solution allows for the pre-assessment of multiple fitting parameters obtained from sample environmental data and the initial fitting equation. It directly predicts the LUX in the current environment based on the ambient light source parameters acquired by the camera in the smart device and the corresponding fitting parameters, enabling the adjustment of the smart device's screen brightness based on the LUX value in the current environment. This eliminates the need to install a light sensor in the smart device, thereby reducing costs.
[0085] Optionally, the target current ambient brightness determination unit includes:
[0086] The target BV acquisition method determination unit is used to acquire the standard ambient brightness of the current environment and determine the target BV acquisition method that matches the standard ambient brightness from a variety of preset BV acquisition methods;
[0087] The target current ambient brightness determination subunit is used to determine the target current ambient brightness based on the target BV acquisition method, standard ambient brightness, and current ambient brightness.
[0088] Optionally, the target BV acquisition method determination unit includes:
[0089] A standard ambient brightness acquisition unit is used to acquire the standard ambient brightness of the current environment;
[0090] The judgment unit is used to determine whether the standard ambient brightness is greater than or equal to zero.
[0091] The first target BV acquisition method determination unit is used to determine the pre-set first BV acquisition method as the target BV acquisition method that matches the standard ambient brightness if the standard ambient brightness is greater than zero.
[0092] The second target BV acquisition method determination unit is used to determine the pre-set second BV acquisition method as the target BV acquisition method that matches the standard ambient brightness if the standard ambient brightness is not greater than zero.
[0093] Optional, fitting units include:
[0094] The sample environment data acquisition unit is used to acquire sample environment data; the sample environment data includes ambient color temperature samples, ambient brightness samples, target ambient brightness samples, and LUX value samples corresponding to each level of light source brightness; the target ambient brightness sample is calculated based on the ambient brightness samples and standard ambient brightness samples.
[0095] The fitting subunit is used to input the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample into Matlab for each level of light source brightness. Matlab then uses the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample to perform fitting and obtain the fitting equation coefficients corresponding to the ambient color temperature sample under the corresponding light source brightness.
[0096] This application provides an electronic device, such as... Figure 5 As shown, the electronic device includes a processor 501 and a memory 502. The memory 502 is used to store program code and data for camera-based light sensing, and the processor 501 is used to call the program instructions in the memory to execute the steps shown in the camera-based light sensing method in the above embodiments.
[0097] This application provides a storage medium that includes a stored program, wherein, when the program is running, it controls the device where the storage medium is located to execute the camera-based light sensing method shown in the above embodiments.
[0098] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0099] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0100] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0101] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A camera-based light sensing method, characterized in that, The method includes: The ambient light parameters in the current environment are obtained using a camera in a smart device; wherein, the ambient light parameters include the current ambient brightness and the current ambient color temperature. Obtain the standard ambient brightness of the current environment, and determine the target ambient brightness of the current environment based on the standard ambient brightness and the current ambient brightness; The target fitting equation coefficients for matching the current ambient color temperature are determined from multiple fitting equation coefficients, and a target fitting equation is generated based on the target fitting equation coefficients and the initial fitting equation; wherein, the multiple fitting equation coefficients are obtained by fitting sample environmental data and the initial fitting equation; The LUX value in the current environment is predicted based on the target fitting equation and the target current ambient brightness, and the screen luminance of the smart device is adjusted based on the LUX value in the current environment.
2. The method according to claim 1, characterized in that, The step of obtaining the standard ambient brightness of the current environment and determining the target ambient brightness of the current environment based on the standard ambient brightness and the current ambient brightness includes: Obtain the standard ambient brightness of the current environment, and determine the target BV acquisition method that matches the standard ambient brightness from various preset BV acquisition methods; Based on the target BV acquisition method, standard ambient brightness, and the current ambient brightness, the target current ambient brightness is determined.
3. The method according to claim 2, characterized in that, Each of the aforementioned BV acquisition methods includes a first BV acquisition method and a second BV acquisition method. The step of determining a target BV acquisition method that matches the standard ambient brightness from the pre-set BV acquisition methods includes: Obtain the standard ambient light level for the current environment; Determine whether the standard ambient brightness is greater than or equal to zero; If the standard ambient brightness is greater than zero, the pre-set first BV acquisition method will be determined as the target BV acquisition method that matches the standard ambient brightness; If the standard ambient brightness is not greater than zero, the pre-set second BV acquisition method is determined as the target BV acquisition method that matches the standard ambient brightness.
4. The method according to claim 1, characterized in that, The process involves fitting the sample environment data and the initial fitting equation to obtain multiple fitting equation coefficients, including: Acquire sample environment data; wherein, the sample environment data includes ambient color temperature samples, ambient brightness samples, target ambient brightness samples, and LUX value samples corresponding to each level of light source brightness; wherein, the target ambient brightness sample is calculated based on the ambient brightness samples and standard ambient brightness samples; For each level of light source brightness, the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample are input into Matlab so that Matlab can use the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample to fit the equation and obtain the fitting equation coefficients corresponding to the ambient color temperature sample under the corresponding light source brightness.
5. A camera-based light sensing system, characterized in that, The system includes: An ambient light source parameter acquisition unit is used to acquire ambient light source parameters in the current environment based on the camera in the smart device; wherein, the ambient light source parameters include the current ambient brightness and the current ambient color temperature. The target current ambient brightness determination unit is used to acquire the standard ambient brightness of the current environment, and determine the target current ambient brightness of the current environment based on the standard ambient brightness and the current ambient brightness. The fitting prediction unit is used to determine the target fitting equation coefficients for matching the current environmental color temperature from multiple fitting equation coefficients, and to generate a target fitting equation based on the target fitting equation coefficients and the initial fitting equation; wherein, the multiple fitting equation coefficients are obtained by the fitting unit using sample environmental data and the initial fitting equation; An adjustment unit is used to predict the LUX in the current environment based on the target fitting equation and the target current ambient brightness, and to adjust the screen luminance of the smart device based on the LUX value in the current environment.
6. The system according to claim 5, characterized in that, The target current ambient brightness determination unit includes: The target BV acquisition method determination unit is used to acquire the standard ambient brightness of the current environment and determine the target BV acquisition method that matches the standard ambient brightness from a variety of preset BV acquisition methods; The target current ambient brightness determination subunit is used to determine the target current ambient brightness based on the target BV acquisition method, standard ambient brightness, and the current ambient brightness.
7. The system according to claim 6, characterized in that, The target BV acquisition method determination unit includes: A standard ambient brightness acquisition unit is used to acquire the standard ambient brightness of the current environment; The judgment unit is used to determine whether the standard ambient brightness is greater than or equal to zero; The first target BV acquisition method determination unit is used to determine the preset first BV acquisition method as the target BV acquisition method that matches the standard ambient brightness if the standard ambient brightness is greater than zero. The second target BV acquisition method determination unit is used to determine the pre-set second BV acquisition method as the target BV acquisition method that matches the standard ambient brightness if the standard ambient brightness is not greater than zero.
8. The system according to claim 5, characterized in that, The fitting unit includes: A sample environment data acquisition unit is used to acquire sample environment data; wherein, the sample environment data includes an ambient color temperature sample, an ambient brightness sample, a target ambient brightness sample, and a LUX value sample corresponding to each level of light source brightness; wherein, the target ambient brightness sample is calculated based on the ambient brightness sample and the standard ambient brightness sample; The fitting subunit is used to input the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample into Matlab for each level of light source brightness, so that Matlab can use the ambient color temperature sample, the target ambient brightness sample, and the LUX value sample to fit and obtain the fitting equation coefficients corresponding to the ambient color temperature sample under the corresponding light source brightness.
9. An electronic device, characterized in that, include: A processor and a memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program for implementing the camera-based light sensing method as described in any one of claims 1-4.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for performing the camera-based light sensing method as described in any one of claims 1-4.