CN115406528A - Ambient light detection method and electronic equipment - Google Patents
Ambient light detection method and electronic equipment Download PDFInfo
- Publication number
- CN115406528A CN115406528A CN202110594826.5A CN202110594826A CN115406528A CN 115406528 A CN115406528 A CN 115406528A CN 202110594826 A CN202110594826 A CN 202110594826A CN 115406528 A CN115406528 A CN 115406528A
- Authority
- CN
- China
- Prior art keywords
- ambient light
- value
- color temperature
- values
- sampling values
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title description 12
- 238000005070 sampling Methods 0.000 claims abstract description 231
- 230000003287 optical effect Effects 0.000 claims abstract description 96
- 238000000034 method Methods 0.000 claims abstract description 49
- 238000005286 illumination Methods 0.000 claims description 137
- 230000004927 fusion Effects 0.000 claims description 34
- 238000012549 training Methods 0.000 claims description 29
- 230000002159 abnormal effect Effects 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 7
- 238000004891 communication Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 5
- 230000005236 sound signal Effects 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011982 device technology Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000012886 linear function Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004020 luminiscence type Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000000638 stimulation Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J1/00—Photometry, e.g. photographic exposure meter
- G01J1/42—Photometry, e.g. photographic exposure meter using electric radiation detectors
- G01J1/4204—Photometry, e.g. photographic exposure meter using electric radiation detectors with determination of ambient light
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J1/00—Photometry, e.g. photographic exposure meter
- G01J1/42—Photometry, e.g. photographic exposure meter using electric radiation detectors
- G01J1/4228—Photometry, e.g. photographic exposure meter using electric radiation detectors arrangements with two or more detectors, e.g. for sensitivity compensation
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/46—Measurement of colour; Colour measuring devices, e.g. colorimeters
Landscapes
- Physics & Mathematics (AREA)
- Spectroscopy & Molecular Physics (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Sustainable Development (AREA)
- Photometry And Measurement Of Optical Pulse Characteristics (AREA)
Abstract
The disclosure relates to a method for detecting ambient light and an electronic device, which are used for improving the accuracy of detecting optical parameters of the ambient light. The method for detecting the ambient light is applied to electronic equipment, the electronic equipment comprises a display screen and at least two ambient light sensors, the at least two ambient light sensors are respectively positioned on different sides of the electronic equipment, one ambient light sensor of the at least two ambient light sensors and the display screen are positioned on the same side of the electronic equipment, and the method comprises the following steps: acquiring sampling values of optical parameters of the ambient light acquired by the at least two ambient light sensors respectively to obtain at least two sampling values; determining respective weights of the at least two sample values according to the at least two sample values; and fusing the at least two sampling values according to the respective weights of the at least two sampling values to obtain a first target value of the optical parameter of the ambient light. The technical scheme of the disclosure can improve the accuracy of detecting the optical parameters of the ambient light.
Description
Technical Field
The present disclosure relates to the field of terminal device technologies, and in particular, to a method for detecting ambient light and an electronic device.
Background
In the related art, electronic devices with a display function, such as smart phones, tablet computers, notebook computers, televisions, etc., usually have an automatic dimming function to avoid uncomfortable stimulation to the eyes of the user. The implementation of automatic dimming is generally as follows: the method comprises the steps that an ambient light sensor is arranged on one side, provided with a screen, of the electronic equipment and used for detecting optical parameters of the environment where the electronic equipment is located, and then the screen is dimmed according to the detected optical parameters and a set strategy.
However, since the angle of view of the ambient light sensor is limited, ambient light detection can be performed only on a part of the environment where the electronic device and the user are located, that is, optical parameters of the detected ambient light are inaccurate, and therefore, dimming of the screen is inaccurate, and the requirement for comfort of human eyes cannot be met.
Disclosure of Invention
In order to overcome the problems in the related art, embodiments of the present disclosure provide a method for detecting ambient light and an electronic device, so as to improve the accuracy of detecting optical parameters of the ambient light.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for detecting ambient light, which is applied to an electronic device, where the electronic device includes a display screen and at least two ambient light sensors, the at least two ambient light sensors are respectively located on different sides of the electronic device, and one of the at least two ambient light sensors is located on the same side of the electronic device as the display screen, the method includes:
acquiring sampling values of optical parameters of the ambient light respectively acquired by at least two ambient light sensors to obtain at least two sampling values;
determining respective weights of at least two sampling values according to the at least two sampling values;
and fusing the at least two sampling values according to the respective weights of the at least two sampling values to obtain a first target value of the optical parameter of the ambient light.
In one embodiment, the sampling value comprises a sampling value identifier, and the determining the respective weight of at least two sampling values according to at least two sampling values comprises:
determining the maximum value of at least two of the sampling values;
determining a target optical parameter value range to which the maximum value belongs from at least two preset optical parameter value ranges;
determining a corresponding target weight distribution strategy according to a target optical parameter value range and a first corresponding relation between the optical parameter value range and the weight distribution strategy, wherein each weight distribution strategy comprises a second corresponding relation between a sampling value identifier and a weight;
and determining the weight of each of at least two sampling values according to the sampling value identification of each of at least two sampling values and the target weight distribution strategy.
In one embodiment, the determining the respective weights of at least two of the sample values according to the at least two of the sample values comprises:
when it is determined that there is zero in at least two of the sample values, zeroing the weight of the zero sample value;
determining the ratio of the rest of the at least two sampling values except zero;
and determining the weight of the rest sampling values except zero in the at least two sampling values according to the ratio of the rest sampling values except zero in the at least two sampling values.
In one embodiment, the determining the respective weights of at least two of the sample values according to the at least two of the sample values comprises:
determining a ratio between at least two of said sample values;
and determining the respective weight of at least two sampling values according to the ratio.
In one embodiment, the determining the respective weights of at least two of the sample values according to the at least two of the sample values comprises:
inputting at least two sampling values into a trained data fusion model;
and the data fusion model outputs respective weights of at least two sampling values, wherein the data fusion model comprises a third corresponding relation between the sampling values and the weights.
In one embodiment, the data fusion model is trained by:
the electronic equipment is placed in different ambient light conditions, and the data fusion model is trained, wherein for each ambient light condition, sampling values of optical parameters of at least two ambient light sensors are calibrated through a illuminometer to obtain at least two calibration values;
determining target display brightness of a display screen meeting the requirement of human eye comfort level;
determining a second target value of the optical parameter of the ambient light according to the target display brightness and a fourth corresponding relation between the display brightness and the optical parameter of the ambient light;
determining respective weights of at least two of the calibration values according to the at least two calibration values and the second target value;
and associating the at least two calibration values with respective weights of the at least two calibration values to obtain the third corresponding relation.
In one embodiment, the optical parameter comprises an illuminance and/or a color temperature.
In one embodiment, the optical parameters include illumination and color temperature; the sampling values comprise an illumination sampling value and a color temperature sampling value; the first target value includes a first illuminance target value and a first color temperature target value;
the determining respective weights of at least two of the sample values according to at least two of the sample values comprises:
determining respective weights of at least two illumination sampling values according to the at least two illumination sampling values;
the fusing the at least two sampling values according to the respective weights of the at least two sampling values to obtain a first target value of the optical parameter of the ambient light, includes:
fusing the at least two illumination sampling values according to respective weights of the at least two illumination sampling values to obtain a first illumination target value of the ambient light;
and fusing the at least two color temperature sampling values according to the respective weights of the at least two illumination sampling values to obtain a first color temperature target value of the ambient light.
In one embodiment, the optical parameter comprises a color temperature; the sample values comprise color temperature sample values; the first target value comprises a first color temperature target value;
the determining the respective weights of the at least two sampling values according to the at least two sampling values comprises:
when an abnormal color temperature sampling value exists in at least two color temperature sampling values, the weight of the abnormal color temperature sampling value is set to zero, the abnormal color temperature sampling value is far smaller than the rest color temperature sampling values in the at least two color temperature sampling values, when the basically identical color temperature sampling values exist in the at least two color temperature sampling values, the respective weight of the basically identical color temperature sampling values is determined, and the respective weight of the basically identical color temperature sampling values is the same;
the fusing the at least two sampling values according to the respective weights of the at least two sampling values to obtain a first target value of the optical parameter of the ambient light, includes:
and fusing the at least two color temperature sampling values according to the respective weights of the at least two color temperature sampling values to obtain a first color temperature target value of the ambient light.
According to a second aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: display screen and two at least ambient light sensor, at least two ambient light sensor is located respectively the different sides of electronic equipment, one in two at least ambient light sensor with the display screen is located same one side of electronic equipment, electronic equipment still includes:
the acquisition module is configured to acquire sampling values of optical parameters of the ambient light acquired by the at least two ambient light sensors respectively to obtain at least two sampling values;
a determination module configured to determine a weight of each of at least two of the sample values based on the at least two of the sample values;
and the fusion module is configured to fuse the at least two sampling values according to the respective weights of the at least two sampling values to obtain a first target value of the optical parameter of the ambient light.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device comprising a processor and a memory; the memory for storing a computer program; the processor is used for executing the computer program stored on the memory to realize the method.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the above-mentioned method.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: because the electronic device comprises at least two ambient light sensors, and the at least two ambient light sensors are respectively located on different sides of the electronic device, the at least two ambient light sensors can detect the optical parameters of the ambient light from different angles, and more information of the optical parameters of the ambient light is obtained. Moreover, one of the at least two ambient light sensors and the display screen are located on the same side of the electronic device, so that the ambient light sensor is not easily shielded under most conditions, and the accuracy of detecting the optical parameters of the ambient light is improved. Further, in the method for detecting the ambient light, sampling values of optical parameters of the ambient light collected by at least two ambient light sensors are obtained first to obtain at least two sampling values, weights of the at least two sampling values are determined according to the at least two sampling values, and the at least two sampling values are fused according to the weights of the at least two sampling values to obtain a first target value of the optical parameters of the ambient light.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic structural diagram of an electronic device shown according to an exemplary embodiment.
FIG. 2 is a flow chart illustrating a method of detection of ambient light according to an exemplary embodiment.
Fig. 3 is a flow chart illustrating a method of detection of ambient light according to another exemplary embodiment.
Fig. 4 is a flowchart illustrating a method of detecting ambient light according to another exemplary embodiment.
Fig. 5 is a schematic structural diagram of an electronic device shown according to another exemplary embodiment.
Fig. 6 is a flowchart illustrating a method of detecting ambient light according to another exemplary embodiment.
Fig. 7 is a flowchart illustrating a method of detecting ambient light according to another exemplary embodiment.
Fig. 8 is a flowchart illustrating a method of detecting ambient light according to another exemplary embodiment.
FIG. 9 is a block diagram illustrating an electronic device in accordance with an example embodiment.
FIG. 10 is a block diagram of an electronic device shown in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In the related art, an electronic device with a display function is usually provided with only one ambient light sensor on the side where a display screen is provided, and since the field angle of the ambient light sensor is smaller than 120 ° in both the horizontal direction and the vertical direction, ambient light detection can be performed only on a part of the environment where the electronic device and a user are located, and optical parameters of ambient light in specific directions (located on the back and side surfaces of the electronic device) cannot be effectively and accurately detected. The transverse direction is a direction in which a short side of the electronic device is located, and the longitudinal direction is a direction in which a long side of the electronic device is located. Moreover, especially when the ambient light sensor is located in the narrow top slit of the electronic device, the field angle of the ambient light sensor may be smaller, which results in a less accurate detection of the optical parameters of the ambient light, and thus results in an inaccurate dimming of the screen, which may not meet the requirement of the comfort level of human eyes.
In order to solve the above technical problem, embodiments of the present disclosure provide a method for detecting ambient light and an electronic device, which can improve accuracy of detecting an optical parameter of the ambient light.
Fig. 1 is a schematic structural diagram of an electronic device shown in accordance with an exemplary embodiment, and fig. 2 is a flowchart of a detection method of ambient light shown in accordance with an exemplary embodiment, which is applied to the electronic device shown in fig. 1.
In this embodiment, as shown in fig. 1, the electronic device 1 includes a display screen 11, a first ambient light sensor 12 and a second ambient light sensor 13, where the first ambient light sensor 12 and the second ambient light sensor 13 are respectively located on different sides of the electronic device 1, for example, the first ambient light sensor 12 is located on a first side F1 of the electronic device 1, the second ambient light sensor 13 is located on a second side F2 of the electronic device 1, the first side F1 is opposite to the second side F2, and the display screen 11 is located on the first side F1 of the electronic device 1, that is, the first ambient light sensor 12 is located on the same side of the electronic device 1 as the display screen 11.
In the present embodiment, as shown in fig. 1, the first ambient light sensor 12 is located at a side of the display screen 11 facing the second side F2 of the electronic device, that is, the first ambient light sensor 12 is located below the display screen 11, and due to the influence of the display screen, the accuracy of the first ambient light sensor 12 for detecting ambient light is low. The accuracy of the detection of the ambient light by the first ambient light sensor 12 is smaller than the accuracy of the detection of the ambient light by the second ambient light sensor 13.
As shown in fig. 2, the method for detecting ambient light includes the following steps S201 to S203:
in step S201, sampling values of the optical parameters of the ambient light collected by the first ambient light sensor 12 and the second ambient light sensor 13 are obtained, so as to obtain two sampling values.
In the present embodiment, the optical parameters include illuminance and color temperature. The sampling values of the optical parameters of the ambient light comprise illuminance sampling values and color temperature sampling values. In this embodiment, the method for detecting the color temperature of the ambient light is similar to the method for detecting the illuminance of the ambient light, and in order to avoid content redundancy, the method for detecting the ambient light is mainly described below. Of course in other embodiments, the optical parameter may include one of illuminance and color temperature. For example, in another embodiment, the optical parameter may include illumination. In yet another embodiment, the optical parameter may comprise a color temperature.
In this embodiment, sampling values of the illuminance of the ambient light collected by the first ambient light sensor 12 and the second ambient light sensor 13 are obtained, so as to obtain a first illuminance sampling value and a second illuminance sampling value. The first illuminance sample value is a sample value of illuminance of the ambient light collected by the first ambient light sensor 12, and the second illuminance sample value is a sample value of illuminance of the ambient light collected by the second ambient light sensor 13.
In step S202, respective weights of two sample values are determined from the two sample values.
In the present embodiment, as shown in fig. 3, step S202 may include the following steps S2021 to S202
In step S2021, the maximum value of the first and second illumination sample values is determined.
In step S2022, a target illuminance value range to which the maximum value belongs is determined from the preset first illuminance value range, the preset second illuminance value range, the preset third illuminance value range, and the preset fourth illuminance value range.
In step S2023, a corresponding target weight distribution policy is determined according to the target illuminance value range and the first corresponding relationship between the illuminance value range and the weight distribution policy, where each weight distribution policy includes a second corresponding relationship between a sampling value identifier and a weight.
In step S2024, the respective weights of the first illumination sample value and the second illumination sample value are determined according to the sample value identifier and the target weight distribution policy of the first illumination sample value and the second illumination sample value.
In this embodiment, the first illumination sample value and the second illumination sample value may not be the same, and when they are different, the maximum value is selected from the first illumination sample value and the second illumination sample value.
In this embodiment, the preset optical parameter value range includes a preset illuminance value range and a preset color temperature value range.
In this embodiment, the maximum illuminance value range of the ambient light is 0 to 100000lux, and the maximum illuminance value range may be divided into a first illuminance value range, a second illuminance value range, a third illuminance value range, and a fourth illuminance value range in advance, where there is no intersection between the first illuminance value range, the second illuminance value range, the third illuminance value range, and the fourth illuminance value range, the first illuminance value range is 0 to 9lux, the second illuminance value range is 10 to 50lux, the third illuminance value range is 51 to 999lux, and the fourth illuminance value range is 100 to 100000lux. Therefore, a first illuminance value range, a second illuminance value range, a third illuminance value range, and a fourth illuminance value range are pre-stored in the electronic device.
Similarly, in the embodiment, the maximum color temperature range of the ambient light is 2000-8000K, and the maximum color temperature range may also be divided into a first color temperature range, a second color temperature range, a third color temperature range, and a fourth color temperature range in advance, but is not limited thereto. Since the method for detecting the color temperature of the ambient light is similar to the method for detecting the illuminance of the ambient light, further description is omitted here to avoid content redundancy.
In this embodiment, the target illuminance value range to which the maximum value belongs may be determined from a preset first illuminance value range, a preset second illuminance value range, a preset third illuminance value range, and a preset fourth illuminance value range. In one exemplary embodiment, the first illumination sample value is 2000lux and the second illumination sample value is 800lux, and a maximum value may be determined from 2000lux and 800lux, the maximum value being 2000lux. Then, the value range of the target illumination of 2000lux is determined from 0-9 lux, 10-50 lux, 51-999 lux and 1000-100000 lux, and the value range of the target illumination is 1000-100000 lux.
In this embodiment, a first corresponding relationship between the illuminance value range and the weight distribution policy is stored in the electronic device in advance. In the first corresponding relation, different illumination value ranges correspond to different weight distribution strategies, and in the different weight distribution strategies, the weight of the first illumination sampling value is different from that of the second illumination sampling value. Wherein each weight distribution strategy comprises a second corresponding relation between the sampling value identification and the weight. The sampling value comprises a sampling value identification, and the sampling value identification comprises an identity identification of the illumination sampling value, is used for uniquely identifying the illumination sampling value and can also be used for indicating the identity of an ambient light sensor for collecting the illumination sampling value. For example, the sample value of the first illumination sample value is denoted as S1 and the sample value of the second illumination sample value is denoted as S2. Of course, the sample value identification may also include an identification of the color temperature sample value.
In an exemplary embodiment, in the first corresponding relationship, the first illuminance value range corresponds to a first weight distribution strategy, the second illuminance value range corresponds to a second weight distribution strategy, the third illuminance value range corresponds to a third weight distribution strategy, and the fourth illuminance value range corresponds to a fourth weight distribution strategy. In a first weight distribution strategy, the weight of the first illumination sample value is 25% and the weight of the second illumination sample value is 75%. In the second weight distribution strategy, the weight of the first illumination sample value is 50%, and the weight of the second illumination sample value is 50%. In the fourth weight distribution strategy, the first illumination sample value is weighted by 80% and the second illumination sample value is weighted by 20%. In the third weight allocation strategy, the weight of the first illumination sample value may be a first exponential function, and the first exponential function is
W1=0.5+7.5*10 -8 *S 2.2 (1)
In equation (1), W1 is the weight of the first illuminance sample value, and S is the illuminance. When S is 50lux, W1 is 50%, and when S is 1000lux, W1 is 80%. The value range of S is 51-999 lux.
In the above exemplary embodiment, in the third weight distribution strategy, the weight of the second illumination sample value is a second exponential function, and the second exponential function is
W2=0.5-7.5*10 -8 *S 2.2 (2)
In equation (2), W2 is the weight of the second illuminance sample value, and S is the illuminance. When S is 50lux, W2 is 50%, and when S is 1000lux, W2 is 20%. The value range of S is 51-999 lux.
It should be noted that, the weight of the first illumination sample value and the weight of the second illumination sample value may also be linear functions, but are not limited thereto.
In this embodiment, the electronic device may determine the corresponding target weight distribution policy according to the target illuminance value range and the first corresponding relationship between the illuminance value range and the weight distribution policy. Continuing with the exemplary embodiment described above, the target weight assignment policy determined according to 1000 to 100000lux is the fourth weight assignment policy.
Continuing with the above exemplary embodiment, the electronic device may determine that the first illumination sample value is weighted 80% and the second illumination sample value is weighted 20% according to the sample value identification and the target weight assignment policy of each of the first illumination sample value and the second illumination sample value.
In this embodiment, when the maximum value of the first illuminance sample value and the second illuminance sample value belongs to the first illuminance value range, the illuminance in the first illuminance value range is relatively low, which indicates that the illuminance of the ambient light is relatively low, and under this ambient light condition, because the accuracy of the first ambient light sensor 12 is relatively low, the weight of the second illuminance sample value can be appropriately increased, so that the weight of the first illuminance sample value is 25%, and the weight of the second illuminance sample value is 75%.
In this embodiment, when the maximum value of the first illuminance sample value and the second illuminance sample value belongs to the second illuminance value range, the illuminance in the second illuminance value range is relatively low, which indicates that the illuminance of the ambient light is relatively low, and under this ambient light condition, because the accuracy of the first ambient light sensor 12 is relatively low, the weight of the second illuminance sample value can be appropriately increased, so that the weight of the first illuminance sample value is the same as the weight of the second illuminance sample value.
In this embodiment, when the maximum value of the first illuminance sample and the second illuminance sample belongs to the third illuminance value range, the illuminance is medium, which indicates that the illuminance of the ambient light is medium, and under this ambient light condition, the weight of the first illuminance sample may be determined by using the first exponential function, and the weight of the second illuminance sample may be determined by using the second exponential function. Alternatively, the weight of the second illuminance sample value may be calculated using the calculation formula W2= 1-W1.
In this embodiment, when the maximum value of the first illuminance sample value and the second illuminance sample value belongs to the fourth illuminance value range, the illuminance is relatively large, which indicates that the illuminance of the ambient light is relatively large, and under this ambient light condition, the first illuminance sample value detected by the first ambient light sensor 12 may be mainly referred to, and the second illuminance sample value detected by the second ambient light sensor 13 is taken as an auxiliary. Thus, the first illumination sample value is weighted 80% and the second illumination sample value is weighted 20%.
In step S203, the two sampling values are fused according to their respective weights to obtain a first target value of the optical parameter of the ambient light.
In this embodiment, the first target value includes a first illuminance target value and a first color temperature target value. The electronic device can fuse the first illumination sampling value and the second illumination sampling value according to respective weights of the first illumination sampling value and the second illumination sampling value to obtain a first illumination target value of the ambient light. The first illumination target value may be equal to a weighted sum of the first illumination sample value and the second illumination sample value, that is, the first illumination target value may be equal to a sum of a product of the first illumination sample value and the weight of the first illumination sample value and a product of the second illumination sample value and the weight of the second illumination sample value.
In this embodiment, the electronic device may fuse the first color temperature sampling value collected by the first ambient light sensor 12 and the second color temperature sampling value collected by the second ambient light sensor 13 according to the respective weights of the first illuminance sampling value and the second illuminance sampling value, so as to obtain the first color temperature target value of the ambient light.
In this embodiment, since the electronic device includes two ambient light sensors, and the two ambient light sensors are respectively located on different sides of the electronic device, the two ambient light sensors can detect the optical parameters of the ambient light from different angles, and obtain more information of the optical parameters of the ambient light. Moreover, one of the two ambient light sensors and the display screen are located on the same side of the electronic device, so that the ambient light sensor is not easily shielded under most conditions, and the accuracy of detecting the optical parameters of the ambient light is improved. Further, in the method for detecting the ambient light, sampling values of optical parameters of the ambient light collected by the two ambient light sensors are obtained first to obtain the two sampling values, weights of the two sampling values are determined according to the two sampling values, and the two sampling values are fused according to the weights of the two sampling values to obtain a first target value of the optical parameters of the ambient light.
In this embodiment, when the optical parameter only includes the illuminance, since the electronic device includes two ambient light sensors, and the two ambient light sensors are respectively located on different sides of the electronic device, the two ambient light sensors can detect the illuminance of the ambient light from different angles, and obtain more information on the illuminance of the ambient light. Moreover, one of the two ambient light sensors and the display screen are located on the same side of the electronic device, so that the ambient light sensor is not easily shielded under most conditions, and the accuracy of detecting the illuminance of ambient light is improved. Further, in the method for detecting the ambient light, sampling values of the illuminance of the ambient light collected by the two ambient light sensors are obtained first to obtain the two sampling values, weights of the two sampling values are determined according to the two sampling values, and the two sampling values are fused according to the weights of the two sampling values to obtain a first target value of the illuminance of the ambient light.
In this embodiment, when the optical parameter only includes the color temperature, since the electronic device includes two ambient light sensors, and the two ambient light sensors are respectively located on different sides of the electronic device, the two ambient light sensors can detect the color temperature of the ambient light from different angles, and obtain more information on the color temperature of the ambient light. Moreover, one of the two ambient light sensors and the display screen are located on the same side of the electronic device, so that the ambient light sensor is not easily shielded under most conditions, and the accuracy of detecting the color temperature of ambient light is improved. Further, in the method for detecting the ambient light, sampling values of color temperatures of the ambient light collected by the two ambient light sensors are obtained first to obtain the two sampling values, weights of the two sampling values are determined according to the two sampling values, and the two sampling values are fused according to the weights of the two sampling values to obtain a first target value of the color temperature of the ambient light.
Fig. 4 is a flow chart illustrating a method of detection of ambient light according to another exemplary embodiment. In addition to the embodiment shown in fig. 2, the step S202 includes the following steps S2025 to S2027:
in step S2025, when it is determined that there is zero in the first and second illumination sample values, the weight of the illumination sample value of zero is set to zero.
In step S2026, a ratio of the first illumination sample value to the rest of the second illumination sample values except zero is determined.
In step S2027, weights of the illumination sample values except zero in the first and second illumination sample values are determined according to ratios of the illumination sample values except zero in the first and second illumination sample values.
In an exemplary embodiment, the electronic device 1 faces away from the light source, the first illuminance sample of the first ambient light sensor 12 is 0lux, and the second illuminance sample of the second ambient light sensor 13 is 9lux. The electronic device sets a weight of the first illumination sample value to zero when determining that there is zero in the first illumination sample value and the second illumination sample value. Since only one illumination sample value, namely the second illumination sample value, exists in the first illumination sample value and the second illumination sample value except for zero, the ratio of the first illumination sample value to the second illumination sample value except for zero is 1. Since only one illumination sample value, i.e., the second illumination sample value, exists in the first illumination sample value and the second illumination sample value except for the first illumination sample value whose illumination sample value is zero, the weight of the second illumination sample value determined according to the ratio of the second illumination sample values is 100%.
In another exemplary embodiment, as shown in fig. 5, the electronic device 1 comprises a first ambient light sensor 12, a second ambient light sensor 13 and a third ambient light sensor 14. The first ambient light sensor 12, the second ambient light sensor 13 and the third ambient light sensor 14 are respectively located on different sides of the electronic device 1, for example, the first ambient light sensor 12 is located on a first side F1 of the electronic device 1, the second ambient light sensor 13 is located on a second side F2 of the electronic device 1, and the third ambient light sensor 14 is located on a third side F3 of the electronic device 1. The third side F3 of the electronic device 1 may be a top end of the electronic device, that is, the top end of the electronic device is an end of the electronic device far from the ground when the electronic device is held vertically.
In the exemplary embodiment shown in fig. 5, the first illuminance sample of first ambient light sensor 12 is 0lux, the second illuminance sample of second ambient light sensor 13 is 6lux, and the third illuminance sample of third ambient light sensor 14 is 4lux. And the electronic equipment sets the weight of the first illumination sampling value to zero when determining that the first illumination sampling value in the first illumination sampling value, the second illumination sampling value and the third illumination sampling value is zero. Then, the electronic device determines a ratio of the second illumination sample value to a third illumination sample value, wherein the ratio of the second illumination sample value to the third illumination sample value is 3. Then, the weight of the second illumination sample value and the weight of the third illumination sample value are determined according to the ratio of the second illumination sample value to the third illumination sample value, where the ratio of the weight of the second illumination sample value to the weight of the third illumination sample value is the ratio of the second illumination sample value to the third illumination sample value, that is, 3.
In this embodiment, the weighting of the illumination sample value of zero may be set to zero, providing a method for detecting ambient light for a specific ambient light condition.
Fig. 6 is a flow chart illustrating a method of detection of ambient light according to another exemplary embodiment. In addition to the embodiment shown in fig. 2, the step S202 includes the following steps S2028 to S2029:
in step S2028, a ratio between at least two illumination sample values is determined.
In step S2029, the respective weights of the at least two illuminance sample values are determined according to the ratio.
In the exemplary embodiment shown in fig. 5, the first illuminance sample for first ambient light sensor 12 is 1000lux, the second illuminance sample for second ambient light sensor 13 is 4000lux, and the third illuminance sample for third ambient light sensor 14 is 5000lux. The electronic device can determine a ratio of the first illumination sample value, the second illumination sample value, and the third illumination sample value, wherein the ratio of the first illumination sample value, the second illumination sample value, and the third illumination sample value is 5. Then, the electronic device determines the weights of the first illuminance sample value, the second illuminance sample value and the third illuminance sample value according to the ratio of the first illuminance sample value, the second illuminance sample value and the third illuminance sample value, where the ratio of the weight of the first illuminance sample value, the weight of the second illuminance sample value and the weight of the third illuminance sample value is 5.
In this embodiment, when there is an abnormal color temperature sample value in at least two color temperature sample values, the weight of the abnormal color temperature sample value is set to zero, and the abnormal color temperature sample value is much smaller than the rest of the at least two color temperature sample values. When the ratio of the abnormal color temperature sample value to the rest color temperature sample values is smaller than the preset ratio, it may be determined that the abnormal color temperature sample value is much smaller than the rest color temperature sample values in the at least two color temperature sample values, for example, the preset ratio may be 0.4, but is not limited thereto. When substantially equal color temperature sample values are present in at least two color temperature sample values, a respective weight of the substantially equal color temperature sample values is determined, wherein the respective weights of the substantially equal color temperature sample values are the same. At the same time, the weights of the color temperature sample values of the at least two color temperature sample values, except for substantially equal color temperature sample values, may be set to zero.
In the above exemplary embodiment, the first color temperature sample value of the first ambient light sensor 12 is 1000K, the second color temperature sample value of the second ambient light sensor 13 is 2800K, and the third color temperature sample value of the third ambient light sensor 14 is 3000K. The second color temperature sampling value is approximately equal to the third color temperature sampling value, the difference between the first color temperature sampling value and the second color temperature sampling value is larger than that between the second color temperature sampling value and the third color temperature sampling value, the ratio of the first color temperature sampling value to the second color temperature sampling value is 0.36, the ratio of the first color temperature sampling value to the third color temperature sampling value is 0.33, and the first color temperature sampling value and the third color temperature sampling value are both smaller than 0.4.
In the above-described exemplary embodiment, the second color temperature sample value and the third color temperature sample value are substantially equal, and it may be determined that the weight of the second color temperature sample value is the same as the weight of the third color temperature sample value. I.e. the weight of the second color temperature sample value and the weight of the third color temperature sample value are 50% respectively.
In the above exemplary embodiment, the first color temperature sampling value, the second color temperature sampling value, and the third color temperature sampling value may be fused according to respective weights of the first color temperature sampling value, the second color temperature sampling value, and the third color temperature sampling value, so as to obtain the first color temperature target value of the ambient light. The first color temperature target value is a weighted sum of the first color temperature sampling value, the second color temperature sampling value and the third color temperature sampling value, namely the sum of a product of the first color temperature sampling value and the weight of the first color temperature sampling value, a product of the second color temperature sampling value and the weight of the second color temperature sampling value and a product of the third color temperature sampling value and the weight of the third color temperature sampling value.
Fig. 7 is a flowchart illustrating a method of detecting ambient light according to another exemplary embodiment. On the basis of the embodiment shown in fig. 2, the above step S202 includes the following steps S20210 to S20211:
in step S20210, at least two sample values are input to the trained data fusion model.
In step S20211, the data fusion model outputs weights for each of the at least two sample values, wherein the data fusion model includes a third correspondence between the sample values and the weights.
In this embodiment, at least two sampling values collected by at least two ambient light sensors may be input into a trained data fusion model, where the data fusion model includes a third correspondence of sampling values and weights. And the data fusion model outputs the respective weight of the at least two sampling values according to the input at least two sampling values.
In the present embodiment, the optical parameters include illumination and color temperature. The sampling values comprise illumination sampling values and color temperature sampling values, and the respective weights of the at least two sampling values output by the data fusion model comprise the respective weights of the at least two illumination sampling values and the respective weights of the at least two color temperature sampling values.
In this embodiment, before step S20210, the electronic device 1 may be placed in different ambient light conditions, and the data fusion model is trained to obtain a trained data fusion model. As shown in fig. 8, the data fusion model is obtained by training through the following steps S801 to S806:
in step S801, for each ambient light condition, the sampling values of the optical parameters of at least two ambient light sensors are calibrated by the illuminometer, and at least two training sampling values and at least two calibration values are obtained.
In the exemplary embodiment shown in fig. 1, the electronic device 1 comprises a first ambient light sensor 12 and a second ambient light sensor 13. In each ambient light condition, the same illuminometer may be used to calibrate the sample values of the first ambient light sensor 12 and the second ambient light sensor 13, respectively. In this way, the calibration value collected by the illuminometer can be made closer to the sampled value of the optical parameter of the ambient light sensor. For example, the illuminometer is first placed near the first ambient light sensor 12, and the sampling value of the first ambient light sensor 12 and a first calibration value of the illuminometer are respectively read to obtain the sampling value and the first calibration value of the first ambient light sensor 12 during training, where the first calibration value is a value of illuminance of ambient light collected by the illuminometer. Then, the illuminometer is placed near the second ambient light sensor 13, and a sampling value of the second ambient light sensor 13 during training and a second calibration value of the illuminometer are respectively read to obtain a sampling value of the second ambient light sensor 13 during training and a second calibration value.
In the exemplary embodiment shown in fig. 1, for each ambient light condition, a sampled value of the first ambient light sensor 12 at the time of training, a sampled value of the second ambient light sensor 13 at the time of training, a first calibration value and a second calibration value are obtained.
Continuing with the exemplary embodiment described above, the first calibration includes a first illumination calibration and a first color temperature calibration, and the second calibration includes a second illumination calibration and a second color temperature calibration.
Continuing with the exemplary embodiment described above, the sampled values of the first ambient light sensor 12 during training include sampled values of the illuminance and sampled values of the color temperature of the first ambient light sensor 12 during training, and the sampled values of the second ambient light sensor 13 during training include sampled values of the illuminance and sampled values of the color temperature of the second ambient light sensor 13 during training.
In step S802, a target value of an optical parameter of the display screen satisfying a requirement for human eye comfort is determined.
In this embodiment, the optical parameters of the display screen include display brightness and screen color temperature. Display luminance the color temperature of a screen is the luminance of the screen light emission. The screen color temperature is the color temperature of the screen luminescence. The target values of the optical parameters of the display screen comprise a display brightness target value and a screen color temperature target value.
In the exemplary embodiment shown in fig. 1, the optimal display brightness requirement of the user may be obtained through subjective experiments, and when the display brightness of the display screen of the electronic device meets the optimal display brightness requirement of the user, the display brightness of the display screen is determined as the display brightness target value of the display screen.
Similarly, the optimal screen color temperature requirement of the user can be obtained through subjective experiments, and when the screen color temperature of the display screen of the electronic equipment meets the optimal screen color temperature requirement of the user, the screen color temperature of the display screen is determined as the target screen color temperature value of the display screen.
In step S803, a second target value of the optical parameter of the ambient light is determined according to the target value of the optical parameter and a fourth correspondence between the optical parameter of the display screen and the optical parameter of the ambient light.
In this embodiment, the fourth corresponding relationship includes a corresponding relationship between the display brightness of the display screen and the illuminance of the ambient light and a corresponding relationship between the screen color temperature of the display screen and the color temperature of the ambient light. The second target value of the optical parameter of the ambient light includes a second illuminance target value and a second color temperature target value.
In this embodiment, the second illuminance target value of the ambient light may be determined according to the display luminance target value of the display screen and the correspondence between the display luminance of the display screen and the illuminance of the ambient light, and the second color temperature target value of the ambient light may be determined according to the screen color temperature target value of the display screen and the correspondence between the screen color temperature of the display screen and the color temperature of the ambient light.
In step S804, a weight of each of the at least two calibration values is determined according to the at least two calibration values and the second target value.
Continuing with the exemplary embodiment described above, the weights of the first and second illumination calibrations may be determined according to the first and second illumination calibrations and the second illumination target value. The second illumination target value is a weighted sum of the first illumination calibration value and the second illumination calibration value.
Continuing with the exemplary embodiment described above, the weight of the first color temperature calibration and the weight of the second color temperature calibration may be determined according to the first color temperature calibration, the second color temperature calibration, and the second color temperature target value. The second color temperature target value is a weighted sum of the first color temperature calibration value and the second color temperature calibration value.
In step S805, the sampling values during at least two training are associated with respective weights of at least two calibration values, so as to obtain a third correspondence relationship.
In this embodiment, the third corresponding relationship includes a corresponding relationship between the illuminance sample value and the weight, and a corresponding relationship between the color temperature sample value and the weight.
Continuing with the above exemplary embodiment, the illuminance sample value of the first ambient light sensor 12 during training, the sample value of the second ambient light sensor 13 during training, the weight of the first illuminance calibration value, and the weight of the second illuminance calibration value are respectively associated to obtain the correspondence between the illuminance sample value and the weight. In the correspondence relationship between the illuminance sample value and the weight, the weight corresponding to the illuminance sample value of the first ambient light sensor 12 during training is the weight of the first illuminance calibration value, and the weight corresponding to the sample value of the second ambient light sensor 13 during training is the weight of the second illuminance calibration value.
Continuing with the above exemplary embodiment, the color temperature sample value of the first ambient light sensor 12 during training, the weight of the color temperature sample value of the second ambient light sensor 13 during training, and the weight of the first color temperature calibration value are associated respectively, so as to obtain the corresponding relationship between the color temperature sample value and the weight. In the correspondence relationship between the color temperature sampling value and the weight, the weight corresponding to the color temperature sampling value of the first ambient light sensor 12 during training is the weight of the first color temperature calibration value, and the weight corresponding to the color temperature sampling value of the second ambient light sensor 13 during training is the weight of the second color temperature calibration value.
In this embodiment, under the same ambient light condition, the angle of the electronic device may also be adjusted to train the data fusion model.
In this embodiment, since the data fusion model is obtained by training under a large amount of ambient light conditions, the respective weights of the output at least two sampling values are more accurate, and thus the optical parameters of the detected ambient light are more accurate.
In the embodiment of the disclosure, the electronic device may adjust the brightness of the display screen according to the detected illuminance of the ambient light and a preset relationship curve between the illuminance of the ambient light and the display brightness, so as to provide the user with the brightness of the display screen suitable for human eyes under the current ambient light condition. The electronic equipment can also adjust the color temperature of the display screen according to the detected color temperature of the ambient light and a preset relation curve between the color temperature of the ambient light and the display color temperature, so as to provide the color temperature of the display screen suitable for human eyes under the current ambient light condition for a user.
FIG. 9 is a block diagram of an electronic device shown in accordance with an example embodiment. In this embodiment, the electronic device includes: display screen and two at least ambient light sensor, at least two ambient light sensor is located respectively the different sides of electronic equipment, one in two at least ambient light sensor with the display screen is located same one side of electronic equipment, electronic equipment still includes:
an obtaining module 91 configured to obtain sampling values of an optical parameter of the ambient light collected by each of the at least two ambient light sensors, so as to obtain at least two sampling values;
a determining module 92 configured to determine a weight of each of at least two of the sample values based on the at least two of the sample values;
and a fusion module 93 configured to fuse the at least two sampling values according to their respective weights to obtain a first target value of the optical parameter of the ambient light.
In one embodiment, the determination module 92 includes:
a first determination submodule configured to determine a maximum value of at least two of the sample values;
a second determining submodule configured to determine a target optical parameter value range to which the maximum value belongs from at least two preset optical parameter value ranges;
the third determination submodule is configured to determine a corresponding target weight distribution strategy according to a target optical parameter value range and a first corresponding relation between the optical parameter value range and the weight distribution strategy, wherein each weight distribution strategy comprises a second corresponding relation between a sampling value identifier and a weight;
a fourth determination submodule configured to determine a weight of each of the at least two sample values according to a sample value identification of each of the at least two sample values and the target weight distribution policy.
In another embodiment, the determination module 92 includes:
a first setting submodule configured to zero the weight of a sample value of zero, upon determining that zero exists in at least two of the sample values;
a fifth determination submodule configured to determine a ratio of the remaining sample values of the at least two sample values other than zero;
and the sixth determination submodule is configured to determine the weights of the rest of the at least two sample values except zero according to the ratio of the rest of the at least two sample values except zero.
In another embodiment, the determination module 92 includes:
a seventh determination submodule configured to determine a ratio between at least two of the sample values;
an eighth determination submodule configured to determine a weight of each of at least two of the sample values according to the ratio.
In another embodiment, the determination module 92 includes:
an input sub-module configured to input at least two of the sample values into a trained data fusion model;
an output submodule configured to output respective weights of at least two of the sample values by the data fusion model, wherein the data fusion model includes a third correspondence of sample values to weights.
In another embodiment, the electronic device is placed in different ambient light conditions and the data fusion model is trained. The data fusion model is obtained through training of a training module, and the training module comprises:
the calibration sub-module is configured to calibrate sampling values of optical parameters of at least two ambient light sensors through an illuminometer according to each ambient light condition, and obtain at least two sampling values during training and at least two calibration values;
a ninth determining submodule configured to determine a target value of an optical parameter of the display screen that meets a requirement of human eye comfort;
a tenth determining submodule configured to determine a second target value of the optical parameter of the ambient light according to the target value of the optical parameter and a fourth corresponding relationship between the optical parameter of the display screen and the optical parameter of the ambient light;
an eleventh determination submodule configured to determine a weight of each of the at least two calibration values based on the at least two calibration values and the second target value;
and the association submodule is configured to associate the sampling values during at least two training times with respective weights of at least two of the calibration values to obtain the third corresponding relationship.
In another embodiment, the optical parameters include illumination and color temperature; the sampling values comprise an illumination sampling value and a color temperature sampling value; the first target value comprises a first illuminance target value and a first color temperature target value; the determination module 92 is further configured to determine a respective weight of at least two illumination sample values from the at least two illumination sample values. The fusion module 93 includes:
the first fusion submodule is configured to fuse the at least two illumination sampling values according to respective weights of the at least two illumination sampling values to obtain a first illumination target value of the ambient light;
and the second fusion submodule is configured to fuse the at least two color temperature sampling values according to respective weights of the at least two illumination sampling values to obtain a first color temperature target value of the ambient light.
In another embodiment, the optical parameter comprises a color temperature; the sample values comprise color temperature sample values; the first target value comprises a first color temperature target value. The determination module 92 is further configured to zero the weight of an abnormal color temperature sample value in the presence of the abnormal color temperature sample value in at least two color temperature sample values, the abnormal color temperature sample value being much smaller than the rest of the at least two color temperature sample values, and to determine the respective weights of substantially equal color temperature sample values in the presence of substantially equal color temperature sample values in the at least two color temperature sample values, wherein the respective weights of the substantially equal color temperature sample values are the same. The fusion module 93 is further configured to fuse the at least two color temperature sample values according to their respective weights, so as to obtain a first color temperature target value of the ambient light.
FIG. 10 is a block diagram of an electronic device shown in accordance with an example embodiment. For example, the device 1000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 10, device 1000 may include one or more of the following components: processing component 1002, memory 1004, power component 1006, multimedia component 1008, audio component 1010, input/output (I/O) interface 1012, sensor component 1014, and communications component 1016.
The processing component 1002 generally controls the overall operation of the device 1000, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 1002 may include one or more processors 1020 to execute instructions to perform all or a portion of the steps of the methods described above. Further, processing component 1002 may include one or more modules that facilitate interaction between processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate interaction between the multimedia component 1008 and the processing component 1002.
The memory 1004 is configured to store various types of data to support operation at the device 1000. Examples of such data include instructions for any application or method operating on device 1000, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1004 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The multimedia component 1008 includes a screen that provides an output interface between the device 1000 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 1000 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1010 is configured to output and/or input audio signals. For example, the audio component 1010 may include a Microphone (MIC) configured to receive external audio signals when the device 1000 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1004 or transmitted via the communication component 1016. In some embodiments, audio component 1010 also includes a speaker for outputting audio signals.
I/O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1014 includes one or more sensors for providing status assessment of various aspects of the device 1000. For example, sensor assembly 1014 may detect the open/closed status of device 1000, the relative positioning of components, such as a display and keypad of device 1000, the change in position of device 1000 or a component of device 1000, the presence or absence of user contact with device 1000, the orientation or acceleration/deceleration of device 1000, and the change in temperature of device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 1014 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
In an exemplary embodiment, the device 1000 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 1004 comprising instructions, executable by the processor 1020 of the device 1000 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The specific manner in which the processor performs the operations in the apparatus in the above-described embodiment has been described in detail in relation to the embodiment of the method, and will not be described in detail here.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (12)
1. A method for detecting ambient light, applied to an electronic device, wherein the electronic device includes a display screen and at least two ambient light sensors, at least two of the ambient light sensors are respectively located on different sides of the electronic device, and one of the at least two ambient light sensors is located on the same side of the electronic device as the display screen, the method comprising:
acquiring sampling values of optical parameters of the ambient light respectively acquired by at least two ambient light sensors to obtain at least two sampling values;
determining respective weights of at least two sampling values according to the at least two sampling values;
and fusing the at least two sampling values according to the respective weights of the at least two sampling values to obtain a first target value of the optical parameter of the ambient light.
2. The method of claim 1, wherein the sample value comprises a sample value identification, and wherein determining a respective weight for at least two of the sample values based on at least two of the sample values comprises:
determining the maximum value of at least two of the sampling values;
determining a target optical parameter value range to which the maximum value belongs from at least two preset optical parameter value ranges;
determining a corresponding target weight distribution strategy according to a target optical parameter value range and a first corresponding relation between the optical parameter value range and the weight distribution strategy, wherein each weight distribution strategy comprises a second corresponding relation between a sampling value identifier and a weight;
and determining the weight of each of at least two sampling values according to the sampling value identification of each of at least two sampling values and the target weight distribution strategy.
3. The method of claim 1, wherein determining respective weights for at least two of the sample values based on the at least two sample values comprises:
when it is determined that there is zero in at least two of the sample values, zeroing the weight of the zero sample value;
determining the ratio of the rest sampling values except zero in at least two sampling values;
and determining the weight of the rest sampling values except zero in the at least two sampling values according to the ratio of the rest sampling values except zero in the at least two sampling values.
4. The method of claim 1, wherein determining respective weights for at least two of the sample values based on the at least two sample values comprises:
determining a ratio between at least two of said sample values;
and determining the respective weight of at least two sampling values according to the ratio.
5. The method of claim 1, wherein determining respective weights for at least two of the sample values based on the at least two sample values comprises:
inputting at least two sampling values into a trained data fusion model;
and the data fusion model outputs respective weights of at least two sampling values, wherein the data fusion model comprises a third corresponding relation between the sampling values and the weights.
6. The method of claim 5, wherein the data fusion model is trained by:
placing the electronic equipment in different ambient light conditions, and training the data fusion model, wherein for each ambient light condition, sampling values of optical parameters of at least two ambient light sensors are calibrated through a illuminometer, so that at least two sampling values during training and at least two calibration values are obtained;
determining a target value of an optical parameter of the display screen meeting the requirement of human eye comfort level;
determining a second target value of the optical parameter of the ambient light according to the target value of the optical parameter and a fourth corresponding relation between the optical parameter of the display screen and the optical parameter of the ambient light;
determining respective weights of at least two of the calibration values according to the at least two calibration values and the second target value;
and associating the sampling values during at least two training with respective weights of at least two calibration values to obtain the third corresponding relation.
7. The method of claim 1, wherein the optical parameters include illumination and/or color temperature.
8. The method of claim 1, wherein the optical parameters include illumination and color temperature; the sampling values comprise an illumination sampling value and a color temperature sampling value; the first target value comprises a first illuminance target value and a first color temperature target value;
the determining respective weights of at least two of the sample values according to at least two of the sample values comprises:
determining respective weights of at least two illumination sampling values according to the at least two illumination sampling values;
the fusing the at least two sampling values according to the respective weights of the at least two sampling values to obtain a first target value of the optical parameter of the ambient light, includes:
fusing the at least two illumination sampling values according to respective weights of the at least two illumination sampling values to obtain a first illumination target value of the ambient light;
and fusing the at least two color temperature sampling values according to the respective weights of the at least two illumination sampling values to obtain a first color temperature target value of the ambient light.
9. The method of claim 1, wherein the optical parameter comprises a color temperature; the sample values comprise color temperature sample values; the first target value comprises a first color temperature target value;
the determining respective weights of at least two of the sample values according to at least two of the sample values comprises:
when an abnormal color temperature sampling value exists in at least two color temperature sampling values, the weight of the abnormal color temperature sampling value is set to zero, the abnormal color temperature sampling value is far smaller than the rest color temperature sampling values in the at least two color temperature sampling values, when the basically identical color temperature sampling values exist in the at least two color temperature sampling values, the respective weight of the basically identical color temperature sampling values is determined, and the respective weight of the basically identical color temperature sampling values is the same;
the fusing the at least two sampling values according to the respective weights of the at least two sampling values to obtain a first target value of the optical parameter of the ambient light, includes:
and fusing the at least two color temperature sampling values according to the respective weights of the at least two color temperature sampling values to obtain a first color temperature target value of the ambient light.
10. An electronic device, comprising: display screen and two at least ambient light sensor, at least two ambient light sensor is located respectively the different sides of electronic equipment, one in two at least ambient light sensor with the display screen is located same one side of electronic equipment, electronic equipment still includes:
the acquisition module is configured to acquire sampling values of optical parameters of the ambient light acquired by the at least two ambient light sensors respectively to obtain at least two sampling values;
a determination module configured to determine a weight of each of at least two of the sample values based on the at least two sample values;
and the fusion module is configured to fuse the at least two sampling values according to the respective weights of the at least two sampling values to obtain a first target value of the optical parameter of the ambient light.
11. An electronic device comprising a processor and a memory; the memory for storing a computer program; the processor, configured to execute the computer program stored on the memory, to implement the method of any one of claims 1-9.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method of any one of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110594826.5A CN115406528A (en) | 2021-05-28 | 2021-05-28 | Ambient light detection method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110594826.5A CN115406528A (en) | 2021-05-28 | 2021-05-28 | Ambient light detection method and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115406528A true CN115406528A (en) | 2022-11-29 |
Family
ID=84156197
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110594826.5A Pending CN115406528A (en) | 2021-05-28 | 2021-05-28 | Ambient light detection method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115406528A (en) |
-
2021
- 2021-05-28 CN CN202110594826.5A patent/CN115406528A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3306441A1 (en) | Temperature control method and apparatus | |
KR20160132465A (en) | Method and apparatus for setting brightness of screen | |
CN112449026B (en) | Ambient light compensation method, device, terminal and storage medium | |
CN107480785B (en) | Convolutional neural network training method and device | |
CN111200304B (en) | Temperature detection circuit, method and device of wireless charging coil and storage medium | |
CN108922479B (en) | Method and device for managing liquid crystal display module | |
CN107808626B (en) | Method and device for adjusting color temperature of display screen and computer readable storage medium | |
CN107677377B (en) | Method and device for determining color temperature | |
EP3629318B1 (en) | Method and apparatus for compensating operating parameter of display circuit | |
CN109788530B (en) | Device and method for adjusting radiation power and electronic equipment | |
CN112033527B (en) | Ambient brightness detection method, device, equipment and storage medium | |
CN106775246B (en) | Screen brightness adjusting method and device | |
CN111131596B (en) | Screen brightness adjusting method and device | |
CN112951162B (en) | Display screen and control method and device thereof | |
CN115406528A (en) | Ambient light detection method and electronic equipment | |
CN112017598A (en) | Backlight brightness adjusting method and device | |
CN111383568B (en) | Display control method and device, electronic equipment and computer readable storage medium | |
CN112037719B (en) | Screen brightness adjusting method and device | |
CN112086075B (en) | Screen display parameter adjusting method and device and storage medium | |
CN111385400A (en) | Backlight brightness adjusting method and device | |
CN115149593A (en) | Method, apparatus and storage medium for predicting remaining charging time | |
CN107239280B (en) | Method and device for determining notification importance and mobile terminal | |
CN114187874A (en) | Brightness adjusting method and device and storage medium | |
CN106293398B (en) | Method, device and terminal for recommending virtual reality resources | |
CN113138036B (en) | Temperature detection method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |