WO2022042085A1 - 设备检测方法、装置、存储介质及电子设备 - Google Patents

设备检测方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2022042085A1
WO2022042085A1 PCT/CN2021/105731 CN2021105731W WO2022042085A1 WO 2022042085 A1 WO2022042085 A1 WO 2022042085A1 CN 2021105731 W CN2021105731 W CN 2021105731W WO 2022042085 A1 WO2022042085 A1 WO 2022042085A1
Authority
WO
WIPO (PCT)
Prior art keywords
light
light intensity
ambient light
ambient
screen
Prior art date
Application number
PCT/CN2021/105731
Other languages
English (en)
French (fr)
Inventor
张海平
葛励成
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022042085A1 publication Critical patent/WO2022042085A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • G01J1/42Photometry, e.g. photographic exposure meter using electric radiation detectors
    • G01J1/4204Photometry, e.g. photographic exposure meter using electric radiation detectors with determination of ambient light
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • G01J1/42Photometry, e.g. photographic exposure meter using electric radiation detectors
    • G01J1/4228Photometry, e.g. photographic exposure meter using electric radiation detectors arrangements with two or more detectors, e.g. for sensitivity compensation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J5/00Radiation pyrometry, e.g. infrared or optical thermometry
    • G01J5/60Radiation pyrometry, e.g. infrared or optical thermometry using determination of colour temperature

Definitions

  • the present application belongs to the technical field of electronic devices, and in particular, relates to a device detection method, device, storage medium and electronic device.
  • the ambient light sensor can sense the light conditions of the surrounding environment, including information such as the intensity and chromaticity of the light.
  • information such as the intensity and chromaticity of the light.
  • Embodiments of the present application provide a method, an apparatus, a storage medium, and an electronic device.
  • an embodiment of the present application provides an ambient light detection method, which is applied to an electronic device.
  • the electronic device includes at least a first ambient light sensor and a second ambient light sensor, the first ambient light sensor and the first ambient light sensor.
  • Two ambient light sensors are covered by the display screen, and each ambient light sensor can detect the intensity of the red light band, the green light band, and the blue light band in the environment.
  • the method includes: acquiring the first ambient light sensor in the current environment The detected first red light intensity, first green light intensity, and first blue light intensity; obtain the second red light intensity, second green light intensity, second blue light intensity detected by the second ambient light sensor in the current environment Blue light intensity; obtain the screen light coefficient and ambient light coefficient corresponding to each of the red light band, green light band, and blue light band, and the screen light coefficient is the first when the screen is lit in advance and there is no external ambient light.
  • the ratio of the light intensity of the corresponding wavelength band detected by the ambient light sensor and the second ambient light sensor, and the ambient light coefficient is the first ambient light sensor and the second ambient light when there is external ambient light and the screen is off in advance.
  • the light intensity ratio of the corresponding wavelength band detected by the light sensor obtain the light intensity from the ambient light in the current environment.
  • Red light intensity component according to the first green light intensity, the second green light intensity, the screen light coefficient and the ambient light coefficient corresponding to the green light band, obtain the green light intensity component from the ambient light in the current environment;
  • the first blue light intensity, the second blue light intensity, the screen light coefficient and the ambient light coefficient corresponding to the blue light band are obtained, and the blue light intensity component from the ambient light in the current environment is obtained; according to the red light intensity component, green light intensity component, The blue light intensity component, obtains the ambient light intensity value and/or the color temperature value corresponding to the current environment.
  • an embodiment of the present application provides an ambient light detection apparatus, which is applied to an electronic device.
  • the electronic device includes at least a first ambient light sensor and a second ambient light sensor, the first ambient light sensor and the first ambient light sensor. Two ambient light sensors are covered by the display screen, and each ambient light sensor can detect the intensity of the red light band, green light band, and blue light band in the environment.
  • the device includes: an acquisition module for acquiring the current environment.
  • the first red light intensity, the first green light intensity, and the first blue light intensity detected by the first ambient light sensor obtain the second red light intensity, the second green light intensity and the second green light intensity detected by the second ambient light sensor in the current environment light intensity, second blue light intensity; obtain the screen light coefficient and ambient light coefficient corresponding to each of the red light band, green light band, and blue light band, where the screen light coefficient is pre-lit on the screen and there is no external ambient light
  • the ambient light coefficient is the first ambient light sensor and the screen when there is ambient light and the screen is off.
  • the light intensity ratio of the corresponding wavelength band detected by the second ambient light sensor is configured to, according to the first red light intensity, the second red light intensity, the screen light coefficient and the ambient light coefficient corresponding to the red light wavelength band, Obtain the red light intensity component from the ambient light in the current environment; obtain the light source from the environment in the current environment according to the first green light intensity, the second green light intensity, the screen light coefficient and the ambient light coefficient corresponding to the green light band.
  • the green light intensity component of ambient light according to the first blue light intensity, the second blue light intensity, the screen light coefficient and the ambient light coefficient corresponding to the blue light band, obtain the blue light intensity component from the ambient light in the current environment; according to the The red light intensity component, the green light intensity component, and the blue light intensity component are obtained, and the ambient light intensity value and/or the color temperature value corresponding to the current environment are obtained.
  • embodiments of the present application provide a storage medium on which a computer program is stored, and when the computer program is executed on a computer, causes the computer to execute the process of the ambient light detection method provided by the embodiments of the present application .
  • embodiments of the present application further provide an electronic device, including: a display screen, a first ambient light sensor, a second ambient light sensor, and a processor; the first ambient light sensor and the second ambient light sensor Covered by the display screen, both the first ambient light sensor and the second ambient light sensor can detect the intensities of the red light band, green light band, and blue light band in the environment; the first ambient light sensor uses In: obtaining the first red light intensity, the first green light intensity, and the first blue light intensity under the current environment; the second ambient light sensor is used for: obtaining the second red light intensity, the second green light intensity under the current environment light intensity, second blue light intensity; the processor is used to: obtain the screen light coefficient and the ambient light coefficient corresponding to each of the red light band, green light band, and blue light band, and the screen light coefficient is pre-positioned at the screen point The ratio of the light intensity of the corresponding wavelength band detected by the first ambient light sensor and the second ambient light sensor when the ambient light is bright and there is no ambient light, and the ambient light
  • the green light intensity component from ambient light; according to the first blue light intensity, the second blue light intensity, the screen light coefficient and the ambient light coefficient corresponding to the blue light band, obtain the blue light intensity component from the ambient light in the current environment; according to the The red light intensity component, the green light intensity component, and the blue light intensity component are obtained, and the ambient light intensity value and/or the color temperature value corresponding to the current environment are obtained.
  • FIG. 1 is a schematic diagram of a first arrangement of an ambient light sensor in the related art.
  • FIG. 2 is a schematic diagram of a second arrangement of an ambient light sensor in the related art.
  • FIG. 3 is a schematic diagram of a third arrangement of an ambient light sensor in the related art.
  • FIG. 4 is a schematic flowchart of an ambient light detection method provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the arrangement of a first ambient light sensor and a second ambient light sensor provided by an embodiment of the present application.
  • FIG. 6 is another schematic flowchart of an ambient light detection method provided by an embodiment of the present application.
  • FIG. 7 to 8 are schematic diagrams of scenarios of the ambient light detection method provided by the embodiments of the present application.
  • FIG. 9 is a schematic structural diagram of an ambient light detection device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 11 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the ambient light sensor can sense the light conditions of the surrounding environment, including information such as the intensity and chromaticity of the light.
  • the ambient light sensor is placed in a smart terminal such as a mobile phone, and various intelligent response functions can be realized by detecting the changes in the chromaticity and intensity of the surrounding ambient light.
  • the brightness of the display screen can be automatically adjusted to save power reasonably and at the same time, it can also protect the user's eyesight.
  • the color of ambient light it can help achieve better shooting effects.
  • intelligent invocation of certain applications can be implemented without unlocking the screen.
  • ambient light sensors can be placed on the edge of the electronic device screen, as shown in Figure 1. In this way, when it receives information from ambient light, it can not be disturbed by the screen light.
  • the ambient light sensor can also be arranged on the side of the electronic device, as shown in FIG. 2 .
  • the frame of the electronic device is mostly made of metal materials, it is generally necessary to carry out a hole design to place the ambient light sensor.
  • the size of the ambient light sensor can be reduced as much as possible for the sake of appearance, so as to reduce the black border around the screen or the opening on the side of the electronic device, this ultimately makes the appearance of the electronic device less than perfect.
  • the structure of arranging the ambient light sensor below the screen can be as shown in FIG. 3 .
  • the film layers through which ambient light enters the sensor from top to bottom are the cover layer 11 , the touch layer 12 , the polarizer layer 13 , the 1/4 ⁇ glass layer 14 , the OLED display layer 15 , and finally reach the ambient light sensor 16 .
  • Each of the cover layer, touch layer, polarizer layer, 1/4 ⁇ glass layer, and OLED display layer contains 1-20 layers of complex structures, such as various organic layers, inorganic layers and OCA adhesive layers Wait. Therefore, after the ambient light is absorbed and reflected by multiple layers, the light intensity that actually reaches the ambient light sensor is greatly reduced.
  • the transmittance of the cover layer is 98%
  • the transmittance of the touch layer is 95%
  • the transmittance of the polarizer layer is 45%
  • the transmittance of the 1/4 ⁇ glass layer is 95%
  • the OLED display The layer transmittance is 20%, and the light intensity that actually reaches the ambient light sensor after passing through these layers is less than 8% of the ambient light.
  • part of the light emitted by the display screen is emitted downward through the substrate of the OLED display layer and reaches the ambient light sensor, and another part is reflected when emitted upward and reaches the ambient light sensor.
  • the ambient light intensity detected by the ambient light sensor disposed under the screen is actually composed of two parts, one part comes from the screen emitting light, and the other part comes from the ambient light.
  • the light emitted by the screen not only forms the background of light intensity, but also forms the background of light chromaticity, so that when the ambient light is weak or the screen light is strong or a certain color of the ambient light is weak, the ambient light sensor actually The detected values will have a lot of background noise, that is, the accuracy of ambient light detection is low.
  • the executive body of the embodiment of the present application may be an electronic device such as a smart phone or a tablet computer.
  • FIG. 4 is a schematic flowchart of an ambient light detection method provided by an embodiment of the present application.
  • the ambient light detection method may be applied to an electronic device, and the electronic device may include at least a first ambient light sensor and a second ambient light sensor, and the first ambient light sensor and the second ambient light sensor are covered by a display screen, as shown in the figure As shown in Fig. 5, both the first ambient light sensor 17 and the second ambient light sensor 18 can detect the intensity of the red light band, the green light band and the blue light band in the environment.
  • the ambient light sensor can sense the light conditions of the surrounding environment, including information such as the intensity and chromaticity of the light.
  • various intelligent response functions can be realized by detecting changes in the chromaticity and intensity of ambient light.
  • the electronic device can adjust the brightness of the display screen according to the ambient light intensity value detected by the ambient light sensor.
  • the electronic device can brighten the brightness of the display screen.
  • the electronic device can dim the brightness of the display screen, thereby protecting the user's eyesight.
  • the value detected by the ambient light sensor is easily affected by the self-luminescence of the screen, that is, the accuracy of the value detected by the ambient light sensor is low.
  • the electronic device may first obtain the red light intensity (for example, recorded as the first red light intensity) and the green light intensity (for example, recorded as the first green light intensity) detected by the first ambient light sensor in the current environment intensity) and blue light intensity (for example, denoted as the first blue light intensity).
  • the electronic device may first obtain the red light intensity (for example, denoted as the second red light intensity), the green light intensity (for example, denoted as the second green light intensity) and the blue light intensity (for example, denoted as the second green light intensity) detected by the second ambient light sensor in the current environment. recorded as the second blue light intensity).
  • the red light intensity detected by the ambient light sensor is the intensity value of the red light (Red) channel detected by the ambient light sensor.
  • the green light intensity detected by the ambient light sensor is the intensity value of the green light (Green) channel detected by the ambient light sensor.
  • the blue light intensity detected by the ambient light sensor is the intensity value of the blue light (Blue) channel detected by the ambient light sensor.
  • the intensity of red light detected by the ambient light sensor includes the sum of the intensity of red light in the ambient light and the intensity of red light generated by the screen emitting light.
  • the green light intensity detected by the ambient light sensor includes the sum of the green light intensity in the ambient light and the green light intensity generated by the screen lighting.
  • the blue light intensity detected by the ambient light sensor includes the sum of the blue light intensity in the ambient light and the blue light intensity produced by the screen's light emission.
  • the electronic device can also obtain the screen light coefficient and the ambient light coefficient corresponding to each of the red light band, the green light band, and the blue light band.
  • the screen light coefficient is the light intensity ratio of the corresponding wavelength band detected by the first ambient light sensor and the second ambient light sensor when the electronic device is pre-lit on the screen and there is no external ambient light.
  • the ambient light coefficient is the light intensity ratio of the corresponding wavelength band detected by the first ambient light sensor and the second ambient light sensor when the electronic device is pre-existing with external ambient light and the screen is off.
  • the screen light coefficient and the ambient light coefficient corresponding to the red light band acquired by the electronic device may be recorded as the first screen light coefficient and the first ambient light coefficient, respectively.
  • the first screen light coefficient is the light intensity ratio of the red light band detected by the first ambient light sensor and the second ambient light sensor when the electronic device is pre-lit on the screen and there is no external ambient light.
  • the first ambient light coefficient is the ratio of the light intensity of the red light band detected by the first ambient light sensor and the second ambient light sensor when the electronic device is pre-existing with ambient light and the screen is off.
  • the screen light coefficient and the ambient light coefficient corresponding to the green light band obtained by the electronic device may be recorded as the second screen light coefficient and the second ambient light coefficient, respectively.
  • the second screen light coefficient is the light intensity ratio of the green light band detected by the first ambient light sensor and the second ambient light sensor when the electronic device is pre-lit on the screen and there is no external ambient light.
  • the second ambient light coefficient is the ratio of the light intensity of the green light band detected by the first ambient light sensor and the second ambient light sensor when the electronic device is pre-existing with ambient light and the screen is off.
  • the screen light coefficient and the ambient light coefficient corresponding to the blue light band obtained by the electronic device may be recorded as the third screen light coefficient and the third ambient light coefficient, respectively.
  • the third screen light coefficient is the light intensity ratio of the blue light band detected by the first ambient light sensor and the second ambient light sensor when the electronic device is pre-lit on the screen and there is no external ambient light.
  • the third ambient light coefficient is the light intensity ratio of the blue light band detected by the first ambient light sensor and the second ambient light sensor when the electronic device is pre-existing with ambient light and the screen is off.
  • the electronic device can calculate the red light intensity component from ambient light in the current environment according to the first red light intensity, the second red light intensity, the first screen light coefficient corresponding to the red light band, and the first ambient light coefficient.
  • the red light intensity component from ambient light in the current environment calculated in the process of 104 refers to the part of the red light intensity that is only affected by pure ambient light after removing the influence of screen light emission.
  • the electronic device can calculate the green light intensity component from ambient light in the current environment according to the first green light intensity, the second green light intensity, the second screen light coefficient corresponding to the green light band, and the second ambient light coefficient.
  • the green light intensity component from ambient light in the current environment calculated in the process of 105 refers to the part of the green light intensity that is only affected by pure ambient light after removing the influence of screen lighting.
  • the electronic device After acquiring the first blue light intensity detected by the first ambient light sensor, the second blue light intensity detected by the second ambient light sensor, and the third screen light coefficient and the third ambient light coefficient corresponding to the blue light band, the electronic device
  • the blue light intensity component from ambient light in the current environment may be calculated according to the first blue light intensity, the second blue light intensity, the third screen light coefficient corresponding to the blue light band, and the third ambient light coefficient.
  • the blue light intensity component from ambient light in the current environment calculated in the process of 106 refers to the blue light intensity that is only affected by pure ambient light after removing the influence of screen light emission.
  • the electronic device can calculate the ambient light intensity value corresponding to the current environment and/or according to the red light intensity component, green light intensity component, and blue light intensity component. color temperature value. That is, the electronic device can calculate the ambient light intensity value and/or the color temperature value according to the red light intensity, green light intensity, and blue light intensity that are only affected by pure ambient light, and the final calculated ambient light intensity value and/or color temperature value excludes the The influence of screen lighting on the ambient light intensity value and/or color temperature value can truly reflect the ambient light intensity and color temperature, thereby improving the accuracy of ambient light detection.
  • the electronic device may be configured with at least a first ambient light sensor and a second ambient light sensor, and both the first ambient light sensor and the second ambient light sensor can detect red light in the environment. Band, Green Band, Blue Band Intensity. Based on this, the electronic device can obtain the first red light intensity, the first green light intensity, and the first blue light intensity detected by the first ambient light sensor in the current environment, and the second red light intensity detected by the second ambient light sensor, Second green light intensity, second blue light intensity. In addition, the electronic device can obtain the screen light coefficient and the ambient light coefficient corresponding to each of the red light band, the green light band, and the blue light band.
  • the electronic device can obtain the red light intensity component from the ambient light in the current environment according to the first red light intensity, the second red light intensity, the screen light coefficient corresponding to the red light band, and the ambient light coefficient; according to the first green light intensity , the second green light intensity, the screen light coefficient and the ambient light coefficient corresponding to the green light band, to obtain the green light intensity component from the ambient light in the current environment; and the screen corresponding to the first blue light intensity, the second blue light intensity, and the blue light band Light coefficient and ambient light coefficient to obtain the blue light intensity component from ambient light in the current environment.
  • the electronic device may acquire the ambient light intensity value and/or the color temperature value corresponding to the current environment according to the red light intensity component, the green light intensity component, and the blue light intensity component. Since the electronic device can calculate the ambient light intensity value and/or color temperature value based on the red light intensity, green light intensity, and blue light intensity only affected by pure ambient light, the final calculated ambient light intensity value and/or color temperature value excludes the The influence of screen lighting can truly reflect the intensity and color temperature of ambient light, thereby improving the accuracy of ambient light detection.
  • FIG. 6 is another schematic flowchart of the ambient light detection method provided by the embodiment of the present application.
  • the ambient light detection method may be applied to an electronic device, the electronic device may include at least a first ambient light sensor and a second ambient light sensor, the first ambient light sensor and the second ambient light sensor are covered by a display screen, and each ambient light
  • the sensors can detect the red light band, green light band, blue light band, visible light band and the light intensity of all bands in the environment.
  • the ratio of the light intensity of the corresponding wavelength band detected by the first ambient light sensor and the second ambient light sensor when the ambient light is present, and the ambient light coefficient is the first ambient light sensor and the second ambient light sensor when there is ambient light and the screen is off in advance.
  • the detected light intensity ratio of the corresponding band is the ratio of the corresponding band.
  • 201 and 202 may include:
  • the electronic device may first obtain the light source type of the current environment.
  • common light sources include CWF (Cool White Fluorescent, American cool white shop light source), U30 (Warm White Fluorescent, American warm white shop light source), TL84 (European, Japanese, Chinese shop light source), D65 (Artificial Daylight, international standard) Artificial daylight), A (American kitchen window spotlight), Hz light.
  • CWF Cool White Fluorescent, American cool white shop light source
  • U30 Warm White Fluorescent, American warm white shop light source
  • TL84 European, Japanese, Chinese shop light source
  • D65 Artificial Daylight, international standard
  • Artificial daylight Artificial daylight
  • A American kitchen window spotlight
  • the 3 light sources of CWF, U30 and TL84 can be divided into the first light source type, the D65 light source is divided into the second light source type, the A light source is divided into the third light source type, and the Hz light source is divided into the fourth light source type.
  • the electronic device can identify the light source type of the current environment through the ratio of W/C, where W is the light intensity of the full wavelength band of ambient light, and C is the light intensity of the visible light band in the ambient light. Since the ambient light sensor in the embodiment of the present application can detect the light intensity of the red light band, the green light band, the blue light band, the visible light band and the full wavelength band in the environment, the electronic device can first obtain the light intensity of the full wavelength band in the environment where it is located. The intensity W and the light intensity C in the visible light band are used to identify the light source type of the current environment by calculating the ratio of W/C.
  • the ratio of W/C when the ratio of W/C is in the value range of [0-0.7), it can be identified that the environment is the first light source type, ie CWF, U30 or TL84.
  • the W/C ratio is in the numerical range of [0.7, 1.1)
  • the second light source type namely D65
  • the ratio of W/C is in the numerical range of [1.1-1.4)
  • the environment is the third light source type, that is, A.
  • the ratio of W/C is greater than 1.4, it can be identified that the environment is the fourth light source type, namely Hz.
  • the electronic device can obtain the screen light coefficient and ambient light coefficient corresponding to the red light band, the screen light coefficient and ambient light coefficient corresponding to the green light band, and the screen corresponding to the blue light band.
  • Light factor and ambient light factor corresponds to the ambient light coefficient of each wavelength band corresponds to the light source type. That is, under different light source types, each wavelength band corresponds to different ambient light coefficients.
  • the screen light coefficient may be the light intensity ratio of the corresponding wavelength band detected by the first ambient light sensor and the second ambient light sensor when the electronic device is pre-lit on the screen and there is no external ambient light.
  • the ambient light coefficient may be the ratio of the light intensity of the corresponding wavelength band detected by the first ambient light sensor and the second ambient light sensor when the electronic device is pre-existing with ambient light and the screen is off.
  • the screen light coefficient corresponding to each wavelength band and the ambient light coefficient under each light source type can be measured in advance in the following manner:
  • the red light band you can first adjust the brightness of the R pixel of the display screen to 255 in an environment without external ambient light, and adjust the brightness of the G pixel and B pixel of the display screen to 0 (that is, not Light up G, B pixels), that is, the color (R, G, B) displayed on the display corresponds to (255, 0, 0).
  • you can input a certain brightness to the display screen such as 155.
  • the brightness input to the display screen can also be other values, as long as the sensitivity requirements are not too weak.
  • the screen light coefficient corresponding to the red light band may also be the average of multiple sets of values detected by the first ambient light sensor and multiple sets of values detected by the second ambient light sensor. The ratio of the means of the values.
  • the electronic device can separately collect the values of the red light band detected by the first ambient light sensor and the second ambient light sensor at this time.
  • the value of the red light band detected by the first ambient light sensor is c1
  • the second ambient light sensor detects
  • the value of the obtained red light band is d1. It can be understood that c1 is actually the detected light intensity of the red light entering the sensor from the ambient light, and d1 is actually the detected light intensity of the red light entering the sensor.
  • the ambient light coefficient corresponding to the red light band may also be the average of multiple sets of values detected by the first ambient light sensor and multiple sets of values detected by the second ambient light sensor. The ratio of the means of the values.
  • the green light band you can first adjust the brightness of the G pixel of the display screen to 255 in an environment without external ambient light, and adjust the brightness of the R pixel and B pixel of the display screen to 0 (that is, do not light up R, B pixels), that is, the color (R, G, B) displayed by the display corresponds to (0, 255, 0). At the same time, you can input a certain brightness to the display screen, such as 155. Of course, the brightness input to the display screen can also be other values, as long as the sensitivity requirements are not too weak.
  • the screen light coefficient corresponding to the green light band may also be the average of multiple sets of values detected by the first ambient light sensor and multiple sets of values detected by the second ambient light sensor. The ratio of the means of the values.
  • the electronic device can separately collect the values of the green light band detected by the first ambient light sensor and the second ambient light sensor at this time.
  • the value of the green light band detected by the first ambient light sensor is c2
  • the second ambient light sensor detects
  • the value of the obtained green light band is d2. It can be understood that c2 is actually the detected light intensity of the green light entering the sensor, and d2 is actually the detected green light intensity of the ambient light entering the sensor.
  • the ambient light coefficient corresponding to the green light band may also be the average of multiple sets of values detected by the first ambient light sensor and multiple sets of values detected by the second ambient light sensor. The ratio of the means of the values.
  • the brightness input to the display screen can also be other values, as long as the sensitivity requirements are not too weak.
  • the screen light coefficient corresponding to the blue light band can also be the average of multiple sets of values detected by the first ambient light sensor and multiple sets of values detected by the second ambient light sensor. ratio of the mean.
  • the electronic device can separately collect the values of the blue light band detected by the first ambient light sensor and the second ambient light sensor.
  • the value of the blue light band detected by the first ambient light sensor is c3
  • the value detected by the second ambient light sensor is c3.
  • the value of the blue light band is d3. It can be understood that c3 is actually the detected light intensity of blue light entering the sensor from ambient light, and d3 is actually the detected light intensity of blue light entering the sensor from ambient light.
  • the ambient light coefficient corresponding to the blue light band may also be the average of multiple sets of values detected by the first ambient light sensor and multiple sets of values detected by the second ambient light sensor. ratio of the mean.
  • the electronic device may collect the values detected by the first ambient light sensor and the second ambient light sensor, for example, the value detected by the first ambient light sensor is a4, and the value detected by the second ambient light sensor is b4.
  • a4 is actually the detected light intensity of visible light emitted by the display screen
  • b4 is actually the detected light intensity of visible light emitted by the display screen.
  • the screen light coefficient m4 a4/b4 corresponding to the visible light band.
  • the screen light coefficient corresponding to the visible light band may also be the average of multiple sets of values detected by the first ambient light sensor and multiple sets of values detected by the second ambient light sensor. ratio of the mean.
  • the electronic device can separately collect the values of the visible light band detected by the first ambient light sensor and the second ambient light sensor.
  • the value of the visible light band detected by the first ambient light sensor is c4
  • the value detected by the second ambient light sensor is c4.
  • the value in the visible light band is d4. It can be understood that c4 is actually the detected ambient light intensity of the visible light entering the sensor, and d4 is actually the detected visible light intensity of the ambient light entering the sensor.
  • the ambient light coefficient corresponding to the visible light band may also be the average of multiple sets of values detected by the first ambient light sensor and multiple sets of values detected by the second ambient light sensor. ratio of the mean.
  • the screen light coefficient m1 corresponding to the red light band and the ambient light coefficient n1 of the red light band under the CWF light source can be measured, the screen light coefficient m2 corresponding to the green light band and the ambient light of the green light band under the CWF light source
  • the coefficient n2 the screen light coefficient m3 corresponding to the blue light band and the ambient light coefficient n3 of the blue light band under the CWF light source
  • the electronic device can separately measure the ambient light coefficients of the red light band, the green light band, the blue light band, and the visible light band under other light sources in advance. It should be noted that under different light source types, the ambient light coefficients corresponding to the red light band, the green light band, the blue light band and the visible light band are different.
  • the screen light coefficient corresponding to each wavelength band can also be measured in advance in the following manner:
  • a white screen can be used to measure the screen light coefficients in the red, green, blue and visible light bands at the same time. Because the color (R, G, B) displayed on the white screen corresponds to (255, 255, 255), it includes three colors of R, G, and B.
  • the screen After setting the screen as a white screen, obtain the values of the red light band, green light band, blue light band and visible light band detected by the first ambient light sensor, respectively, and obtain the red light band detected by the second ambient light sensor. , Green Band, Blue Band, and Visible Band values.
  • the screen light coefficient corresponding to the red light band may be the ratio of the value of the red light band detected by the first ambient light sensor to the value of the red light band detected by the second ambient light sensor.
  • the screen light coefficient corresponding to the green light band may be the ratio of the value of the green light band detected by the first ambient light sensor to the value of the green light band detected by the second ambient light sensor.
  • the screen light coefficient corresponding to the blue light band may be the ratio of the value of the blue light band detected by the first ambient light sensor to the value of the blue light band detected by the second ambient light sensor.
  • the screen light coefficient corresponding to the visible light band may be the ratio of the value of the visible light band detected by the first ambient light sensor to the value of the visible light band detected by the second ambient light sensor.
  • the screen light coefficient of the red light band under the CWF light source is the ratio of the value of the red light band detected by the first ambient light sensor to the value of the red light band detected by the second ambient light sensor.
  • the screen light coefficient of the green light band under the CWF light source is the ratio of the value of the green light band detected by the first ambient light sensor to the value of the green light band detected by the second ambient light sensor.
  • the screen light coefficient of the blue light band under the CWF light source is the ratio of the value of the blue light band detected by the first ambient light sensor to the value of the blue light band detected by the second ambient light sensor.
  • the screen light coefficient of the visible light band under the CWF light source is the ratio of the value of the visible light band detected by the first ambient light sensor to the value of the visible light band detected by the second ambient light sensor.
  • the electronic device may also acquire the first red light intensity, the first green light intensity, and the first blue light intensity detected by the first ambient light sensor in the current environment, and the second red light intensity detected by the second ambient light sensor , the second green light intensity, the second blue light intensity.
  • the red light intensity detected by the ambient light sensor is the intensity value of the red light (Red) channel detected by the ambient light sensor.
  • the green light intensity detected by the ambient light sensor is the intensity value of the green light (Green) channel detected by the ambient light sensor.
  • the blue light intensity detected by the ambient light sensor is the intensity value of the blue light (Blue) channel detected by the ambient light sensor.
  • the intensity of red light detected by the ambient light sensor includes the sum of the intensity of red light in the ambient light and the intensity of red light generated by the screen emitting light.
  • the green light intensity detected by the ambient light sensor includes the sum of the green light intensity in the ambient light and the green light intensity generated by the screen lighting.
  • the blue light intensity detected by the ambient light sensor includes the sum of the blue light intensity in the ambient light and the blue light intensity produced by the screen's light emission.
  • R3 (m1 ⁇ R1-R2)/(m1-n1) from ambient light in the current environment, where R1 is the first red light intensity, R2 is the second red light intensity, and m1 is the The screen light coefficient corresponding to the red light band, and n1 is the ambient light coefficient corresponding to the red light band.
  • the light intensity y1 of the red light band from the ambient light corresponding to the first ambient light sensor may be determined as the red light intensity component R3 from the ambient light in the current environment.
  • G3 (m2 ⁇ G1-G2)/(m2-n2) from ambient light in the current environment, where G1 is the first green light intensity, G2 is the second green light intensity, and m2 is the The screen light coefficient corresponding to the green light band, and n2 is the ambient light coefficient corresponding to the green light band.
  • the light intensity y2 of the green light band from the ambient light corresponding to the first ambient light sensor may be determined as the green light intensity component G3 from the ambient light in the current environment.
  • the light intensity y3 of the blue light band from the ambient light corresponding to the first ambient light sensor may be determined as the blue light intensity component B3 from the ambient light in the current environment.
  • the electronic device can calculate the ambient light intensity value and/or the current environment corresponding to the red light intensity component, green light intensity component, and blue light intensity component according to the color temperature value. That is, the electronic device may calculate the ambient light intensity value and/or the color temperature value from the red light intensity, green light intensity, and blue light intensity that are only affected by pure ambient light. Since the final calculated ambient light intensity value and/or color temperature value excludes the influence of screen lighting on the ambient light intensity value and/or color temperature value, it can truly reflect the ambient light intensity and color temperature, thereby improving the accuracy of ambient light detection .
  • the electronic device may determine the ambient light intensity value and/or the color temperature value corresponding to the first ambient light sensor that is only affected by ambient light as the ambient light intensity value and/or the color temperature value that is only affected by ambient light in the current environment color temperature value.
  • the electronic device obtains the green light intensity component from the ambient light in the current environment according to the first green light intensity, the second green light intensity, the screen light coefficient and the ambient light coefficient corresponding to the green light band, which may include:
  • the green light intensity component of ambient light G4 n2 ⁇ (m2 ⁇ G1-G2)/(m2-n2), where G1 is the first green light intensity, G2 is the second green light intensity, and m2 is the corresponding green light band Screen light coefficient, n2 is the ambient light coefficient corresponding to the green light band.
  • the electronic device may calculate the ambient light intensity value and/or the color temperature value corresponding to the current environment according to the red light intensity component R4, the green light intensity component G4, and the blue light intensity component B4.
  • the electronic device may also determine the ambient light intensity value and/or color temperature value corresponding to the second ambient light sensor that is only affected by ambient light as the ambient light intensity value and/or color temperature value that is only affected by ambient light in the current environment. .
  • the embodiment of the present application can obtain the ambient light intensity value and/or color temperature value corresponding to the current environment according to the red light intensity component, the green light intensity component, and the blue light intensity component by the following formula, for example, red light
  • the intensity components are recorded as R', the green light intensity component G', and the blue light intensity component B'
  • the electronic device can first calculate the six values of P, U, V, h, k, and T according to the following formula:
  • V (-0.68202)(R')+(0.77073)(G')+(0.56332)(B');
  • the electronic device may determine the calculated value of U as the ambient light intensity value corresponding to the current environment, and the calculated value of T as the color temperature value corresponding to the current environment.
  • R', G', B' can be R3, G3, B3, respectively.
  • R', G', and B' may be R4, G4, and B4, respectively.
  • the ambient light intensity value and/or the color temperature value corresponding to the current environment may also be calculated according to the The red light intensity component, the green light intensity component, the blue light intensity component and the visible light intensity component of the light are used to calculate the ambient light intensity value and/or the color temperature value corresponding to the current environment.
  • the electronic device may acquire the first visible light intensity detected by the first ambient light sensor and the second visible light intensity detected by the second ambient light sensor in the current environment. After that, the electronic device can obtain the screen light coefficient and the ambient light coefficient corresponding to the visible light band. After that, the electronic device can calculate the visible light intensity component from ambient light in the current environment according to the first visible light intensity, the second visible light intensity, the screen light coefficient corresponding to the visible light band, and the ambient light coefficient. Finally, the electronic device may calculate an ambient light intensity value and/or a color temperature value corresponding to the current environment according to the red light intensity component, the green light intensity component, the blue light intensity component, and the visible light intensity component.
  • calculating the visible light intensity component from the ambient light in the current environment may include:
  • the embodiment of the present application can obtain the ambient light intensity value corresponding to the current environment according to the red light intensity component, the green light intensity component, the blue light intensity component and the visible light intensity component by the following formula, for example, the red light intensity The component is recorded as R', the green light intensity component is recorded as G', the blue light intensity component is recorded as B', and the visible light intensity component is recorded as C', then the electronic device can calculate the ambient light intensity value L corresponding to the current environment by the following formula:
  • L 64 ⁇ D_factor ⁇ (clear_raw ⁇ c_coef+red_raw ⁇ r_coef+green_raw ⁇ g_coef+blue_raw ⁇ b_coef)/(atime ⁇ again).
  • atime is the integration time, again is the gain, clear_raw is C', red_raw is R', green_raw is G', and blue_raw is B'.
  • Other parameters are set in the .h library or passed in from the json file.
  • other formulas can also be used to calculate the ambient light intensity value and/or color temperature value corresponding to the current environment according to the red light intensity component, the green light intensity component, and the blue light intensity component, or use other formulas to calculate the red light intensity value and/or the color temperature value.
  • the intensity component, the green light intensity component, the blue light intensity component, and the visible light intensity component calculate the ambient light intensity value and/or the color temperature value corresponding to the current environment.
  • FIGS. 7 to 8 are schematic diagrams of scenarios of the ambient light detection method provided by the embodiments of the present application.
  • the electronic device in this embodiment of the present application may be a full-screen electronic device, and the electronic device may include a first ambient light sensor 17 and a second ambient light sensor 18 .
  • the first ambient light sensor 17 and the second ambient light sensor 18 are covered by the display screen of the electronic device. Both the first ambient light sensor 17 and the second ambient light sensor 18 can detect the light intensity of the red light band, the green light band, the blue light band, the visible light band and the full wavelength band in the environment.
  • a user uses an electronic device to watch a video in the current environment.
  • the electronic device can first identify the light source type of the current environment. For example, the electronic device recognizes that the light source type of the current environment belongs to the preset first light source type. Afterwards, the electronic device can obtain the screen light coefficients corresponding to each of the red light band, the green light band, and the blue light band, and the ambient light coefficient of each wavelength band under the current first light source type.
  • the screen light coefficient corresponding to the red light band is m1, and the ambient light coefficient of the red light band under the first light source type is n1.
  • the screen light coefficient corresponding to the green light band is m2, and the ambient light coefficient of the green light band under the first light source type is n2.
  • the screen light coefficient corresponding to the blue light band is m3, and the ambient light coefficient of the blue light band under the first light source type is n3.
  • the electronic device may also acquire the first red light intensity R1, the first green light intensity G1, the first blue light intensity B1 detected by the first ambient light sensor in the current environment, and the second light intensity detected by the second ambient light sensor.
  • the electronic device can obtain the ambient light intensity value Q corresponding to the current environment according to the red light intensity component R3, the green light intensity component G3, and the blue light intensity component B3.
  • the electronic device detects that the electronic device is currently in a strong light environment according to the calculated ambient light intensity value Q, so the electronic device can dim the brightness of the display screen, as shown in Figure 8, to save power and protect the user's eyesight.
  • FIG. 9 is a schematic structural diagram of an ambient light detection device provided by an embodiment of the present application.
  • the ambient light detection device can be applied to electronic equipment, the electronic equipment includes at least a first ambient light sensor and a second ambient light sensor, the first ambient light sensor and the second ambient light sensor are covered by a display screen, and each ambient light sensor is covered by a display screen.
  • the light sensor can detect the intensity of the red light band, green light band and blue light band in the environment.
  • the ambient light detection device 300 may include: an acquisition module 301 and a calculation module 302 .
  • the acquiring module 301 is configured to acquire the first red light intensity, the first green light intensity, and the first blue light intensity detected by the first ambient light sensor in the current environment; acquire the second ambient light sensor in the current environment The detected second red light intensity, second green light intensity, and second blue light intensity; obtain the screen light coefficient and ambient light coefficient corresponding to each of the red light band, green light band, and blue light band, and the screen light
  • the coefficient is the ratio of the light intensity of the corresponding wavelength band detected by the first ambient light sensor and the second ambient light sensor when the screen is lit in advance and there is no ambient light
  • the ambient light coefficient is the ambient light and the light intensity ratio of the corresponding wavelength band detected by the first ambient light sensor and the second ambient light sensor when the screen is off;
  • the calculation module 302 is configured to obtain the red light intensity component from the ambient light in the current environment according to the first red light intensity, the second red light intensity, the screen light coefficient and the ambient light coefficient corresponding to the red light band; The first green light intensity, the second green light intensity, the screen light coefficient and the ambient light coefficient corresponding to the green light band are obtained, and the green light intensity component from the ambient light in the current environment is obtained; according to the first blue light intensity, The second blue light intensity, the screen light coefficient and the ambient light coefficient corresponding to the blue light band are obtained, and the blue light intensity component from the ambient light in the current environment is obtained; according to the red light intensity component, the green light intensity component, and the blue light intensity component, all The ambient light intensity value and/or color temperature value corresponding to the current environment.
  • the computing module 302 may be used to:
  • the computing module 302 may also be used to:
  • light intensity m1 is the screen light coefficient corresponding to the red light band
  • n1 is the ambient light coefficient corresponding to the red light band;
  • light intensity, m2 is the screen light coefficient corresponding to the green light band, n2 is the ambient light coefficient corresponding to the green light band;
  • the screen light coefficient is a ratio of the average light intensity values of the corresponding wavelength bands detected by the first ambient light sensor and the second ambient light sensor when the screen is lit in advance and there is no ambient light.
  • the ambient light coefficient is the ratio of the average value of the light intensity of the corresponding wavelength band detected by the first ambient light sensor and the second ambient light sensor when there is external ambient light in advance and the screen is off.
  • the obtaining module 301 may also be used to: identify the light source type of the current environment; obtain the screen light coefficient and ambient light corresponding to each wavelength band in the red light band, the green light band, and the blue light band coefficient, the ambient light coefficient corresponds to the light source type.
  • the obtaining module 301 can also be used to:
  • the computing module 302 may be configured to: obtain the visible light intensity component from the ambient light in the current environment according to the first visible light intensity, the second visible light intensity, the screen light coefficient corresponding to the visible light band, and the ambient light coefficient; According to the red light intensity component, the green light intensity component, the blue light intensity component and the visible light intensity component, the ambient light intensity value and/or the color temperature value corresponding to the current environment is acquired.
  • the computing module 302 may be used to:
  • An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed on a computer, causes the computer to execute the process in the ambient light detection method provided by this embodiment .
  • An embodiment of the present application further provides an electronic device, including a display screen, a first ambient light sensor, a second ambient light sensor, and a processor, wherein the first ambient light sensor and the second ambient light sensor are supported by the display screen Covering, both the first ambient light sensor and the second ambient light sensor can detect the intensity of the red light band, green light band, and blue light band in the environment; the processor is used to execute the ambient light provided by this embodiment. Process in the detection method.
  • the above-mentioned electronic device may be a mobile terminal such as a tablet computer or a smart phone.
  • FIG. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device 400 may include a first ambient light sensor 401, a second ambient light sensor 402, a processor 403, a memory 404, a display screen 405 and other components.
  • a first ambient light sensor 401 may include a first ambient light sensor 401, a second ambient light sensor 402, a processor 403, a memory 404, a display screen 405 and other components.
  • Those skilled in the art can understand that the structure of the electronic device shown in FIG. 10 does not constitute a limitation on the electronic device, and may include more or less components than the one shown, or combine some components, or arrange different components.
  • the first ambient light sensor 401 and the second ambient light sensor 402 can detect the intensity of the red light band, the green light band, and the blue light band in the environment.
  • the first ambient light sensor 401 and the second ambient light sensor 402 can detect information such as light intensity and color temperature of the surrounding environment.
  • the first ambient light sensor 401 and the second ambient light sensor 402 may be covered by the display screen 405 .
  • the processor 403 is the control center of the electronic device, uses various interfaces and lines to connect various parts of the entire electronic device, and executes the electronic device by running or executing the application program stored in the memory 402 and calling the data stored in the memory 402.
  • the various functions and processing data of the device are used to monitor the electronic equipment as a whole.
  • Memory 404 may be used to store applications and data.
  • the application program stored in the memory 402 contains executable code.
  • Applications can be composed of various functional modules.
  • the processor 403 executes various functional applications and data processing by executing the application programs stored in the memory 402 .
  • the first ambient light sensor 401 may be used to: acquire the first red light intensity, the first green light intensity, and the first blue light intensity in the current environment.
  • the second ambient light sensor 402 may be used for: acquiring the second red light intensity, the second green light intensity, and the second blue light intensity in the current environment.
  • the processor 403 in the electronic device loads the executable code corresponding to the process of one or more application programs into the memory 404 according to the following instructions, and the processor 403 runs the application program stored in the memory 404, Thereby performing: acquiring the screen light coefficient and the ambient light coefficient corresponding to each of the red light band, green light band, and blue light band, where the screen light coefficient is the first when the screen is lit in advance and there is no external ambient light.
  • the ratio of the light intensity of the corresponding wavelength band detected by the ambient light sensor and the second ambient light sensor, and the ambient light coefficient is the first ambient light sensor and the second ambient light when there is external ambient light and the screen is off in advance.
  • the light intensity ratio of the corresponding wavelength band detected by the light sensor obtain the light intensity from the ambient light in the current environment.
  • Red light intensity component according to the first green light intensity, the second green light intensity, the screen light coefficient and the ambient light coefficient corresponding to the green light band, obtain the green light intensity component from the ambient light in the current environment;
  • the first blue light intensity, the second blue light intensity, the screen light coefficient and the ambient light coefficient corresponding to the blue light band are obtained, and the blue light intensity component from the ambient light in the current environment is obtained; according to the red light intensity component, green light intensity component, The blue light intensity component, obtains the ambient light intensity value and/or the color temperature value corresponding to the current environment.
  • the electronic device 400 may include a first ambient light sensor 401 , a second ambient light sensor 402 , a processor 403 , a memory 404 , a display screen 405 , a battery 406 and other components.
  • the first ambient light sensor 401 and the second ambient light sensor 402 can detect the intensity of the red light band, the green light band, and the blue light band in the environment.
  • the first ambient light sensor 401 and the second ambient light sensor 402 can detect information such as light intensity and color temperature of the surrounding environment.
  • the first ambient light sensor 401 and the second ambient light sensor 402 are covered by the display screen 405 .
  • the processor 403 is the control center of the electronic device, uses various interfaces and lines to connect various parts of the entire electronic device, and executes the electronic device by running or executing the application program stored in the memory 402 and calling the data stored in the memory 402.
  • the various functions and processing data of the device are used to monitor the electronic equipment as a whole.
  • Memory 404 may be used to store applications and data.
  • the application program stored in the memory 402 contains executable code.
  • Applications can be composed of various functional modules.
  • the processor 403 executes various functional applications and data processing by executing the application programs stored in the memory 402 .
  • the battery 406 can be used to provide power support for the various components and modules of the electronic device, thereby ensuring the normal operation of the various components and modules.
  • the first ambient light sensor 401 may be used to: acquire the first red light intensity, the first green light intensity, and the first blue light intensity in the current environment.
  • the second ambient light sensor 402 may be used for: acquiring the second red light intensity, the second green light intensity, and the second blue light intensity in the current environment.
  • the processor 403 in the electronic device loads the executable code corresponding to the process of one or more application programs into the memory 404 according to the following instructions, and the processor 403 executes the executable code stored in the memory
  • the application program in 404 thereby executing: acquiring the screen light coefficient and the ambient light coefficient corresponding to each of the red light band, green light band, and blue light band, where the screen light coefficient is pre-lit on the screen and there is no external environment
  • the light intensity component according to the first blue light intensity, the second blue light intensity, the screen light coefficient and the ambient light coefficient corresponding to the blue light band, obtain the blue light intensity component from the ambient light in the current environment; according to the red light intensity component , a green light intensity component, and a blue light intensity component, to obtain an ambient light intensity value and/or a color temperature value corresponding to the current environment.
  • the processor 403 executes to obtain the red light from the ambient light in the current environment according to the first red light intensity, the second red light intensity, the screen light coefficient and the ambient light coefficient corresponding to the red light band.
  • the processor 403 executes, according to the first red light intensity, the second red light intensity, the screen light coefficient and the ambient light coefficient corresponding to the red light band, to obtain the information from the ambient light in the current environment.
  • the screen light coefficient is a ratio of the average light intensity values of the corresponding wavelength bands detected by the first ambient light sensor and the second ambient light sensor when the screen is lit in advance and there is no ambient light.
  • the ambient light coefficient is the ratio of the average value of the light intensity of the corresponding wavelength band detected by the first ambient light sensor and the second ambient light sensor when there is external ambient light in advance and the screen is off.
  • the processor 403 may further perform: identifying the light source type of the current environment;
  • the processor 403 executes the obtaining of the screen light coefficient and the ambient light coefficient corresponding to each of the red light band, green light band, and blue light band, it can execute:
  • the screen light coefficient and the ambient light coefficient corresponding to each wavelength band of , and the ambient light coefficient corresponds to the light source type.
  • the first ambient light sensor 401 may be used to: acquire the first visible light intensity in the current environment.
  • the second ambient light sensor 402 may be used for: acquiring the second visible light intensity in the current environment.
  • the processor 403 may further perform: obtaining the screen light coefficient and the ambient light coefficient corresponding to the visible light band; obtaining the screen light coefficient and the ambient light coefficient corresponding to the first visible light intensity, the second visible light intensity, and the visible light band.
  • the visible light intensity component from ambient light in the current environment; according to the red light intensity component, the green light intensity component, the blue light intensity component and the visible light intensity component, obtain the ambient light intensity value and/or color temperature corresponding to the current environment value.
  • the ambient light detection device provided in the embodiment of the present application and the ambient light detection method in the above embodiments belong to the same concept, and any one of the ambient light detection method provided in the ambient light detection method can be run on the ambient light detection device
  • the specific implementation process is described in the embodiment of the ambient light detection method, which will not be repeated here.
  • the ambient light detection method described in the embodiments of the present application can be controlled by a computer program.
  • the computer program may be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and the execution process may include, for example, the implementation of the ambient light detection method example process.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), and the like.
  • each functional module may be integrated in one processing chip, or each module may exist physically alone, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk or an optical disk, etc. .

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Sustainable Development (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Liquid Crystal Display Device Control (AREA)
  • Photometry And Measurement Of Optical Pulse Characteristics (AREA)

Abstract

一种环境光检测方法,其中,通过获取来自环境光的红光强度分量、绿光强度分量以及蓝光强度分量,并根据获取得到的红光强度分量、绿光强度分量以及蓝光强度分量,计算当前环境对应的环境光强度值和/或色温值。

Description

设备检测方法、装置、存储介质及电子设备
本申请要求于2020年08月28日提交专利局、申请号为202010887622.6、申请名称为“设备检测方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于电子设备技术领域,尤其涉及一种设备检测方法、装置、存储介质及电子设备。
背景技术
环境光传感器可以感知周围环境的光线情况,包括光线的强度和色度等信息。将环境光传感器置于手机等智能电子设备中,可以通过检测周围环境光线色度和强度的变化,实现各种智能响应功能。
发明内容
本申请实施例提供一种的方法、装置、存储介质及电子设备。
第一方面,本申请实施例提供一种环境光检测方法,应用于电子设备,所述电子设备至少包括第一环境光传感器和第二环境光传感器,所述第一环境光传感器和所述第二环境光传感器被显示屏覆盖,每一环境光传感器均能检测出环境中的红光波段、绿光波段、蓝光波段的强度,所述方法包括:获取当前环境下所述第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度;获取所述当前环境下所述第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度;获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值,所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值;根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量;根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量;根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
第二方面,本申请实施例提供一种环境光检测装置,应用于电子设备,所述电子设备至少包括第一环境光传感器和第二环境光传感器,所述第一环境光传感器和所述第二环境光传感器被显示屏覆盖,每一环境光传感器均能检测出环境中的红光波段、绿光波段、蓝光波段的强度,所述装置包括:获取模块,用于获取当前环境下所述第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度;获取所述当前环境下所述第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度;获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值,所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值;计算模块,用于根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量;根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量;根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
第三方面,本申请实施例提供一种存储介质,其上存储有计算机程序,当所述计算机程序在计算机上执行时,使得所述计算机执行本申请实施例提供的环境光检测方法中的流程。
第四方面,本申请实施例还提供一种电子设备,包括:显示屏、第一环境光传感器、第二环境光传感器以及处理器;所述第一环境光传感器和所述第二环境光传感器被所述显示屏覆盖,所述第一环境光传感器和所述第二环境光传感器均能检测出环境中的红光波段、绿光波段、蓝光波段的强度;所述第一环境光传感器用于:获取当前环境下的第一红光强度、第一绿光强度、第一蓝光强度;所述第二环境光传感器用于:获取所述当前环境下的第二红光强度、第二绿光强度、第二蓝光强度;所述处理器用于:获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值,所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值;根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量;根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度 分量;根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
附图说明
下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其有益效果显而易见。
图1是相关技术中环境光传感器的第一种设置示意图。
图2是相关技术中环境光传感器的第二种设置示意图。
图3是相关技术中环境光传感器的第三种设置示意图。
图4是本申请实施例提供的环境光检测方法的流程示意图。
图5是本申请实施例提供的第一环境光传感器和第二环境光传感器的设置示意图。
图6是本申请实施例提供的环境光检测方法的另一流程示意图。
图7至图8是本申请实施例提供的环境光检测方法的场景示意图。
图9是本申请实施例提供的环境光检测装置的结构示意图。
图10是本申请实施例提供的电子设备的结构示意图。
图11是本申请实施例提供的电子设备的另一结构示意图。
具体实施方式
请参照图示,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。
下面先对相关技术进行介绍。
环境光传感器可以感知周围环境的光线情况,包括光线的强度和色度等信息。将环境光传感器置于手机等智能终端中,可以通过检测周围环境光线色度和强度的变化,实现各种智能响应功能。比如在不同的环境下,自动调节显示屏亮度,合理省电同时也可以起到保护用户视力的效果。又比如,在不同的光线条件下,通过感知环境光线的颜色,可以帮助实现更好的拍摄效果。又比如,在一定的条件下,可以在屏幕不解锁的条件下实现某些应用的智能调用。
在非全面屏时代,环境光传感器可以设置在电子设备屏幕的边缘,如图1所示。这样其接受环境光的信息时就能够不受屏幕发光的干扰。或者,环境光传感器也可以设置在电子设备的侧边,如图2所示。但考虑到电子设备的边框多使用金属材料,一般需要进行开孔设计以放置环境光传感器。虽然为了美观,可以将环境光传感器尺寸尽量减小,从而减小屏幕周围的黑边或者电子设备侧边的开孔,但是这终究使电子设备外形不够完美。
在进入全面屏时代后,随着全面屏、瀑布屏甚至环绕屏的流行,屏幕在电子设备表面的占比越来越大,将环境光传感器置于屏幕下方将大大增强电子设备在外形上的竞争力。
将环境光传感器设置在屏幕下方的结构可以如图3所示。环境光进入传感器经过的膜层从上至下为盖板层11,触控层12,偏光片层13,1/4λ玻片层14,OLED显示层15,最后到达环境光传感器16上。其中盖板层、触控层、偏光片层、1/4λ玻片层、OLED显示层中的每一层又包含1—20层的复杂结构,如各种有机层、无机层和OCA胶层等。因此,环境光经过多层的吸收和反射后,真正到达环境光传感器处的光强被大大降低。比如盖板层的透过率为98%,触控层的透过率为95%,偏光片层的透过率为45%,1/4λ玻片层的透过率为95%,OLED显示层透过率为20%,经过这些层后真正到达环境光传感器上的光强度不足环境光的8%。另一方面,显示屏发出的光一部分通过OLED显示层的基底向下发射,到达环境光传感器,另有一部分在向上发射时还会形成反射,到达环境光传感器。
可见,相关技术中,设置在屏下的环境光传感器接收到的光中实际上有很大一部分来自屏幕发出的光。即,相关技术中,设置在屏下的环境光传感器所检测到的环境光强度其实是由两部分组成的,一部分来自屏幕发光,另一部分来自环境光。屏幕发出的光不仅形成了光强度上的背景,同时也形成了光色度上的背景,使得在环境光较弱或屏幕光较强或环境光某一颜色较弱时,实际上环境光传感器检测到的数值会出现很大的背景噪音,即环境光检测的准确度较低。
可以理解的是,本申请实施例的执行主体可以是诸如智能手机或平板电脑等的电子设备。
请参阅图4,图4是本申请实施例提供的环境光检测方法的流程示意图。该环境光检测方法可以应用于电子设备中,该电子设备可以至少包括第一环境光传感器和第二环境光传感器,该第一环境光传感器和该第二环境光传感器被显示屏覆盖,如图5所示,第一环境光传感器17和第二环境光传感器18 均能检测出环境中的红光波段、绿光波段、蓝光波段的强度。
本实施例提供的环境光检测方法的流程可以包括:
101、获取当前环境下第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度。
102、获取当前环境下第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度。
环境光传感器可以感知周围环境的光线情况,包括光线的强度和色度等信息。将环境光传感器置于手机等智能电子设备中,可以通过检测周围环境光线色度和强度的变化,实现各种智能响应功能。比如,电子设备可以根据环境光传感器检测到的环境光强度值来调整显示屏的亮度。当根据环境光传感器检测到的环境光强度值确定出电子设备处于强光环境下时,电子设备可以调亮显示屏的亮度。当根据环境光传感器检测到的环境光强度值确定出电子设备处于弱环境下时,电子设备可以调暗显示屏的亮度,从而保护用户视力。然而,相关技术中,环境光传感器检测到的数值容易受到屏幕自发光的影响,即环境光传感器检测到的数值的准确度较低。
在本申请实施例中,比如,电子设备可以先获取当前环境下第一环境光传感器检测到的红光强度(例如记为第一红光强度)、绿光强度(例如记为第一绿光强度)和蓝光强度(例如记为第一蓝光强度)。并且,电子设备可以先获取当前环境下第二环境光传感器检测到的红光强度(例如记为第二红光强度)、绿光强度(例如记为第二绿光强度)和蓝光强度(例如记为第二蓝光强度)。
需要说明的是,本申请实施例中,环境光传感器检测到的红光强度即为该环境光传感器检测到的红光(Red)通道的强度值。环境光传感器检测到的绿光强度即为该环境光传感器检测到的绿光(Green)通道的强度值。环境光传感器检测到的蓝光强度即为该环境光传感器检测到的蓝光(Blue)通道的强度值。
并且,在屏幕点亮的情况下,环境光传感器检测到的红光强度包括环境光中的红光强度与屏幕发光产生的红光强度之和。环境光传感器检测到的绿光强度包括环境光中的绿光强度与屏幕发光产生的绿光强度之和。环境光传感器检测到的蓝光强度包括环境光中的蓝光强度与屏幕发光产生的蓝光强度之和。
103、获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,该屏幕光系数为预先处于屏幕点亮且无外界环境光时第一环境光传感器和第二环境光传感器检测到的对应波段的光强比值,该环境光系数为预先处于有外界环境光且屏幕熄灭时第一环境光传感器和第二环境光传感器检测到的对应波段的光强比值。
比如,电子设备还可以获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数。其中,该屏幕光系数为电子设备预先处于屏幕点亮且无外界环境光时第一环境光传感器和第二环境光传感器各自检测到的对应波段的光强比值。该环境光系数为电子设备预先处于有外界环境光且屏幕熄灭时第一环境光传感器和第二环境光传感器各自检测到的对应波段的光强比值。
例如,电子设备获取到的红光波段对应的屏幕光系数和环境光系数可以分别记为第一屏幕光系数和第一环境光系数。其中,该第一屏幕光系数为电子设备预先处于屏幕点亮且无外界环境光时第一环境光传感器和第二环境光传感器各自检测到的红光波段的光强比值。该第一环境光系数为电子设备预先处于有外界环境光且屏幕熄灭时第一环境光传感器和第二环境光传感器各自检测到的红光波段的光强比值。
电子设备获取到的绿光波段对应的屏幕光系数和环境光系数可以分别记为第二屏幕光系数和第二环境光系数。其中,该第二屏幕光系数为电子设备预先处于屏幕点亮且无外界环境光时第一环境光传感器和第二环境光传感器各自检测到的绿光波段的光强比值。该第二环境光系数为电子设备预先处于有外界环境光且屏幕熄灭时第一环境光传感器和第二环境光传感器各自检测到的绿光波段的光强比值。
电子设备获取到的蓝光波段对应的屏幕光系数和环境光系数可以分别记为第三屏幕光系数和第三环境光系数。其中,该第三屏幕光系数为电子设备预先处于屏幕点亮且无外界环境光时第一环境光传感器和第二环境光传感器各自检测到的蓝光波段的光强比值。该第三环境光系数为电子设备预先处于有外界环境光且屏幕熄灭时第一环境光传感器和第二环境光传感器各自检测到的蓝光波段的光强比值。
104、根据第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取当前环境下来自环境光的红光强度分量。
比如,在获取到第一环境光传感器检测到的第一红光强度、第二环境光传感器检测到的第二红光强度以及红光波段对应的第一屏幕光系数和第一环境光系数后,电子设备可以根据第一红光强度、第二红光强度、红光波段对应的第一屏幕光系数和第一环境光系数,计算当前环境下来自环境光的红光强度分量。
需要说明的是,104的流程中计算得到的当前环境下来自环境光的红光强度分量即是指去除屏幕发光的影响后,仅受纯环境光影响的那部分红光强度。
105、根据第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取当前环 境下来自环境光的绿光强度分量。
比如,在获取到第一环境光传感器检测到的第一绿光强度、第二环境光传感器检测到的第二绿光强度以及绿光波段对应的第二屏幕光系数和第二环境光系数后,电子设备可以根据第一绿光强度、第二绿光强度、绿光波段对应的第二屏幕光系数和第二环境光系数,计算当前环境下来自环境光的绿光强度分量。
需要说明的是,105的流程中计算得到的当前环境下来自环境光的绿光强度分量即是指去除屏幕发光的影响后,仅受纯环境光影响的那部分绿光强度。
106、根据第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取当前环境下来自环境光的蓝光强度分量。
比如,在获取到第一环境光传感器检测到的第一蓝光强度、第二环境光传感器检测到的第二蓝光强度以及蓝光波段对应的第三屏幕光系数和第三环境光系数后,电子设备可以根据第一蓝光强度、第二蓝光强度、蓝光波段对应的第三屏幕光系数和第三环境光系数,计算当前环境下来自环境光的蓝光强度分量。
需要说明的是,106的流程中计算得到的当前环境下来自环境光的蓝光强度分量即是指去除屏幕发光的影响后,仅受纯环境光影响的那部分蓝光强度。
107、根据红光强度分量、绿光强度分量、蓝光强度分量,获取当前环境对应的环境光强度值和/或色温值。
比如,在计算得到红光强度分量、绿光强度分量、蓝光强度分量后,电子设备可以根据该红光强度分量、绿光强度分量、蓝光强度分量计算当前环境对应的环境光强度值和/或色温值。即,电子设备可以根据仅受纯环境光影响的红光强度、绿光强度、蓝光强度来计算环境光强度值和/或色温值,最终计算得到的环境光强度值和/或色温值排除了屏幕发光对环境光强度值和/或色温值的影响,能够真实反映环境光的强度和色温,从而提高了环境光检测的准确度。
可以理解的是,本申请实施例中,电子设备至少可以配置有第一环境光传感器和第二环境光传感器,该第一环境光传感器和第二环境光传感器均能检测出环境中的红光波段、绿光波段、蓝光波段的强度。基于此,电子设备可以获取当前环境下第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度,以及第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度。并且,电子设备可以获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数。之后,电子设备可以根据第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取当前环境下来自环境光的红光强度分量;根据第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取当前环境下来自环境光的绿光强度分量;以及根据第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取当前环境下来自环境光的蓝光强度分量。之后,电子设备可以根据红光强度分量、绿光强度分量、蓝光强度分量,获取当前环境对应的环境光强度值和/或色温值。由于电子设备可以根据仅受纯环境光影响的红光强度、绿光强度、蓝光强度来计算环境光强度值和/或色温值,因此最终计算得到的环境光强度值和/或色温值排除了屏幕发光的影响,能够真实反映环境光的强度和色温,从而提高了环境光检测的准确度。
请参阅图6,图6为本申请实施例提供的环境光检测方法的另一流程示意图。该环境光检测方法可以应用于电子设备中,该电子设备可以至少包括第一环境光传感器和第二环境光传感器,第一环境光传感器和第二环境光传感器被显示屏覆盖,每一环境光传感器均能检测出环境中的红光波段、绿光波段、蓝光波段、可见光波段以及全波段的光强度。
本申请实施例提供的环境光检测方法的流程可以包括:
201、识别当前环境的光源类型。
202、获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,该环境光系数与光源类型对应,该屏幕光系数为预先处于屏幕点亮且无外界环境光时第一环境光传感器和第二环境光传感器检测到的对应波段的光强比值,该环境光系数为预先处于有外界环境光且屏幕熄灭时第一环境光传感器和第二环境光传感器检测到的对应波段的光强比值。
比如,201、202可以包括:
电子设备可以先获取当前环境的光源类型。
例如,常见的光源包括CWF(Cool White Fluorescent,美国冷白商店光源)、U30(Warm White Fluorescent,美国暖白商店光源)、TL84(欧洲、日本、中国商店光源)、D65(Artificial Daylight,国际标准人工日光)、A(美式厨窗射灯)、Hz光。
本申请实施例中可以将CWF、U30、TL84这3种光源划分为第一光源类型,D65光源划分为第二 光源类型,A光源划分为第三光源类型,Hz光源划分为第四光源类型。
在一种实施方式中,电子设备可以通过W/C的比值来识别当前环境的光源类型,其中W为环境光的全波段的光强度,C为环境光中的可见光波段的光强度。由于本申请实施例中的环境光传感器可以检测出环境中的红光波段、绿光波段、蓝光波段、可见光波段以及全波段的光强度,因此电子设备可以先获取所处环境的全波段的光强度W和可见光波段的光强度C,再通过计算W/C的比值来识别当前环境的光源类型。
在一些实施方式中,当W/C的比值位于[0-0.7)的数值区间时,可以识别出所处环境为第一光源类型,即CWF、U30或TL84。当W/C的比值位于[0.7,1.1)的数值区间时,可以识别出所处环境为第二光源类型,即D65。当W/C的比值位于[1.1-1.4)的数值区间时,可以识别出所处环境为第三光源类型,即A。当W/C的比值大于1.4时,可以识别出所处环境为第四光源类型,即Hz。
比如,在识别出当前环境的光源类型后,电子设备可以获取红光波段所对应的屏幕光系数和环境光系数,绿光波段所对应的屏幕光系数和环境光系数,蓝光波段所对应的屏幕光系数和环境光系数。其中,各波段的环境光系数与光源类型对应。即,不同的光源类型下,各波段对应于不同的环境光系数。屏幕光系数可以为电子设备预先处于屏幕点亮且无外界环境光时第一环境光传感器和第二环境光传感器检测到的对应波段的光强比值。环境光系数可以为电子设备预先处于有外界环境光且屏幕熄灭时第一环境光传感器和第二环境光传感器检测到的对应波段的光强比值。
本申请实施例可以通过如下方式来预先测得各波段对应的屏幕光系数和在各光源类型下的环境光系数:
例如,对于红光波段而言,可以先在无外界环境光的环境下,将显示屏的R像素的亮度调整为255,将显示屏的G像素、B像素的亮度均调整为0(即不点亮G、B像素),即显示屏显示的颜色(R,G,B)对应于(255,0,0)。同时可以给显示屏输入一定的亮度,例如为155。当然给显示屏输入的亮度也可以为其它值,只要达到感度要求不会太弱即可。之后,电子设备可以分别采集第一环境光传感器和第二环境光传感器检测到的数值,例如第一环境光传感器检测到的数值为a1,第二环境光传感器检测到的数值为b1。可以理解的是,a1实际上是检测到的显示屏发出的红光的光强,b1实际上是检测到的显示屏发出红光的光强。那么,红光波段对应的屏幕光系数m1=a1/b1。
在另一种实施方式中,在上述同样测试环境下,红光波段对应的屏幕光系数也可以是第一环境光传感器检测到的多组数值的均值与第二环境光传感器检测到的多组数值的均值之比。
之后,可以把显示屏关掉即显示屏进入熄屏状态,并打开外界光源,例如此时为CWF光源,亮度为1000Lux。电子设备可以分别采集第一环境光传感器和第二环境光传感器此时检测到的红光波段的数值,例如第一环境光传感器检测到的红光波段的数值为c1,第二环境光传感器检测到的红光波段的数值为d1。可以理解的是,c1实际上是检测到的环境光进入传感器的红光的光强,d1实际上是检测到的环境光进入传感器的红光的光强。那么,CWF光源下红光波段对应的环境光系数n1=c1/d1。
在另一种实施方式中,在上述同样测试环境下,红光波段对应的环境光系数也可以是第一环境光传感器检测到的多组数值的均值与第二环境光传感器检测到的多组数值的均值之比。
对于绿光波段而言,可以先在无外界环境光的环境下,将显示屏的G像素的亮度调整为255,将显示屏的R像素、B像素的亮度均调整为0(即不点亮R、B像素),即显示屏显示的颜色(R,G,B)对应于(0,255,0)。同时可以给显示屏输入一定的亮度,例如为155。当然给显示屏输入的亮度也可以为其它值,只要达到感度要求不会太弱即可。之后,电子设备可以分别采集第一环境光传感器和第二环境光传感器检测到的数值,例如第一环境光传感器检测到的数值为a2,第二环境光传感器检测到的数值为b2。可以理解的是,a2实际上是检测到的显示屏发出的绿光的光强,b2实际上是检测到的显示屏发出绿光的光强。那么,绿光波段对应的屏幕光系数m2=a2/b2。
在另一种实施方式中,在上述同样测试环境下,绿光波段对应的屏幕光系数也可以是第一环境光传感器检测到的多组数值的均值与第二环境光传感器检测到的多组数值的均值之比。
之后,可以把显示屏关掉即显示屏进入熄屏状态,并打开外界光源,例如此时为CWF光源,亮度为1000Lux。电子设备可以分别采集第一环境光传感器和第二环境光传感器此时检测到的绿光波段的数值,例如第一环境光传感器检测到的绿光波段的数值为c2,第二环境光传感器检测到的绿光波段的数值为d2。可以理解的是,c2实际上是检测到的环境光进入传感器的绿光的光强,d2实际上是检测到的环境光进入传感器的绿光的光强。那么,CWF光源下绿光波段对应的环境光系数n2=c2/d2。
在另一种实施方式中,在上述同样测试环境下,绿光波段对应的环境光系数也可以是第一环境光传感器检测到的多组数值的均值与第二环境光传感器检测到的多组数值的均值之比。
对于蓝光波段而言,可以先在无外界环境光的环境下,将显示屏的B像素的亮度调整为255,将显 示屏的R像素、G像素的亮度均调整为0(即不点亮R、G像素),即显示屏显示的颜色(R,G,B)对应于(0,0,255)。同时可以给显示屏输入一定的亮度,例如为155。当然给显示屏输入的亮度也可以为其它值,只要达到感度要求不会太弱即可。之后,电子设备可以分别采集第一环境光传感器和第二环境光传感器检测到的数值,例如第一环境光传感器检测到的数值为a3,第二环境光传感器检测到的数值为b3。可以理解的是,a3实际上是检测到的显示屏发出的蓝光的光强,b3实际上是检测到的显示屏发出蓝光的光强。那么,蓝光波段对应的屏幕光系数m3=a3/b3。
在另一种实施方式中,在上述同样测试环境下,蓝光波段对应的屏幕光系数也可以是第一环境光传感器检测到的多组数值的均值与第二环境光传感器检测到的多组数值的均值之比。
之后,可以把显示屏关掉即显示屏进入熄屏状态,并打开外界光源,例如此时为CWF光源,亮度为1000Lux。电子设备可以分别采集第一环境光传感器和第二环境光传感器此时检测到的蓝光波段的数值,例如第一环境光传感器检测到的蓝光波段的数值为c3,第二环境光传感器检测到的蓝光波段的数值为d3。可以理解的是,c3实际上是检测到的环境光进入传感器的蓝光的光强,d3实际上是检测到的环境光进入传感器的蓝光的光强。那么,CWF光源下蓝光波段对应的环境光系数n3=c3/d3。
在另一种实施方式中,在上述同样测试环境下,蓝光波段对应的环境光系数也可以是第一环境光传感器检测到的多组数值的均值与第二环境光传感器检测到的多组数值的均值之比。
对于可见光波段而言,可以先在无外界环境光的环境下,将显示屏的R、G、B像素的亮度均调整为255,即显示屏显示的颜色(R,G,B)对应于(255,255,255)。同时可以给显示屏输入一定的亮度,例如为155。当然给显示屏输入的亮度也可以为其它值,只要达到感度要求不会太弱即可。之后,电子设备可以分别采集第一环境光传感器和第二环境光传感器检测到的数值,例如第一环境光传感器检测到的数值为a4,第二环境光传感器检测到的数值为b4。可以理解的是,a4实际上是检测到的显示屏发出的可见光的光强,b4实际上是检测到的显示屏发出可见光的光强。那么,可见光波段对应的屏幕光系数m4=a4/b4。
在另一种实施方式中,在上述同样测试环境下,可见光波段对应的屏幕光系数也可以是第一环境光传感器检测到的多组数值的均值与第二环境光传感器检测到的多组数值的均值之比。
之后,可以把显示屏关掉即显示屏进入熄屏状态,并打开外界光源,例如此时为CWF光源,亮度为1000Lux。电子设备可以分别采集第一环境光传感器和第二环境光传感器此时检测到的可见光波段的数值,例如第一环境光传感器检测到的可见光波段的数值为c4,第二环境光传感器检测到的可见光波段的数值为d4。可以理解的是,c4实际上是检测到的环境光进入传感器的可见光的光强,d4实际上是检测到的环境光进入传感器的可见光的光强。那么,CWF光源下可见光波段对应的环境光系数n4=c4/d4。
在另一种实施方式中,在上述同样测试环境下,可见光波段对应的环境光系数也可以是第一环境光传感器检测到的多组数值的均值与第二环境光传感器检测到的多组数值的均值之比。
通过上述方式即可测得红光波段对应的屏幕光系数m1和红光波段在CWF光源下的环境光系数n1,绿光波段对应的屏幕光系数m2和绿光波段在CWF光源下的环境光系数n2,蓝光波段对应的屏幕光系数m3和蓝光波段在CWF光源下的环境光系数n3,以及可见光波段对应的屏幕光系数m4和可见光波段在CWF光源下的环境光系数n4。
同理,电子设备可以预先分别测得红光波段、绿光波段、蓝光波段、可见光波段在其它光源下的环境光系数。需要说明的是,不同光源类型下,红光波段、绿光波段、蓝光波段和可见光波段所对应的环境光系数是不同的。
在另一种实施方式中,还可以通过如下方式来预先测得各波段对应的屏幕光系数:
比如,可以用白色屏幕同时测得红光波段、绿光波段、蓝光波段和可见光波段的屏幕光系数。因为白色屏幕显示的颜色(R,G,B)对应于(255,255,255),包含了R、G、B三种色光。在把屏幕设定为白色屏幕后,分别获取第一环境光传感器检测到的红光波段、绿光波段、蓝光波段和可见光波段的值,并分别获取第二环境光传感器检测到的红光波段、绿光波段、蓝光波段和可见光波段的值。那么,红光波段对应的屏幕光系数可以为第一环境光传感器检测到的红光波段的值与第二环境光传感器检测到的红光波段的值之比。绿光波段对应的屏幕光系数可以为第一环境光传感器检测到的绿光波段的值与第二环境光传感器检测到的绿光波段的值之比。蓝光波段对应的屏幕光系数可以为第一环境光传感器检测到的蓝光波段的值与第二环境光传感器检测到的蓝光波段的值之比。可见光波段对应的屏幕光系数可以为第一环境光传感器检测到的可见光波段的值与第二环境光传感器检测到的可见光波段的值之比。
之后,可以把显示屏关闭即显示屏进入熄屏状态,并打开外界光源,例如为CWF光源,亮度例如为1000Lux,电子设备可以分别采集第一环境光传感器此时检测到的红光波段的数值、绿光波段的数值、 蓝光波段的数值、可见光波段的数值,并采集第二环境光传感器此时检测到的红光波段的数值、绿光波段的数值、蓝光波段的数值、可见光波段的数值。那么,CWF光源下红光波段的屏幕光系数为第一环境光传感器检测到的红光波段的数值与第二环境光传感器检测到的红光波段的数值之比。CWF光源下绿光波段的屏幕光系数为第一环境光传感器检测到的绿光波段的数值与第二环境光传感器检测到的绿光波段的数值之比。CWF光源下蓝光波段的屏幕光系数为第一环境光传感器检测到的蓝光波段的数值与第二环境光传感器检测到的蓝光波段的数值之比。CWF光源下可见光波段的屏幕光系数为第一环境光传感器检测到的可见光波段的数值与第二环境光传感器检测到的可见光波段的数值之比。
203、获取当前环境下第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度。
204、获取当前环境下第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度。
比如,电子设备还可以获取当前环境下的第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度,以及第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度。
需要说明的是,本申请实施例中,环境光传感器检测到的红光强度即为该环境光传感器检测到的红光(Red)通道的强度值。环境光传感器检测到的绿光强度即为该环境光传感器检测到的绿光(Green)通道的强度值。环境光传感器检测到的蓝光强度即为该环境光传感器检测到的蓝光(Blue)通道的强度值。
并且,在屏幕点亮的情况下,环境光传感器检测到的红光强度包括环境光中的红光强度与屏幕发光产生的红光强度之和。环境光传感器检测到的绿光强度包括环境光中的绿光强度与屏幕发光产生的绿光强度之和。环境光传感器检测到的蓝光强度包括环境光中的蓝光强度与屏幕发光产生的蓝光强度之和。
205、计算当前环境下来自环境光的红光强度分量R3=(m1×R1-R2)/(m1-n1),其中,R1为第一红光强度,R2为第二红光强度,m1为红光波段对应的屏幕光系数,n1为红光波段对应的环境光系数。
比如,在获取到当前环境下的第一红光强度R1,第二红光强度R2,红光波段对应的屏幕光系数m1以及当前光源类型下的环境光系数n1后,电子设备可以计算当前环境下仅来自环境光的红光强度分量R3,其中R3=(m1×R1-R2)/(m1-n1)。
需要说明的是,假设当前环境下第一环境光传感器检测到的环境光强度值R1中来自屏幕发光的光强为x1,来自环境光的光强为y1。那么,x1+y1=R1。基于屏幕光系数m1和环境光系数n1可知,第二环境光传感器检测到的环境光强度值R2中来自屏幕发光的光强为m1×x1,来自环境光的光强为n1×y1。那么,m1×x1+n1×y1=R2。可以理解的是,x1+y1=R1和m1×x1+n1×y1=R2可以构成二元一次方程组,解这个二元一次方程组,可以得到y1=(m1×R1-R2)/(m1-n1)。
在本申请实施例中,可以将第一环境光传感器对应的来自环境光的红光波段的光强y1确定为当前环境下来自环境光的红光强度分量R3。
在另一种实施方式中,也可以将第二环境光传感器对应的来自环境光的红光波段的光强n1×y1确定为当前环境下来自环境光的红光强度分量,其中,R4=n1×y1=n1×(m1×R1-R2)/(m1-n1),其中,R1为第一红光强度,R2为第二红光强度,m1为红光波段对应的屏幕光系数,n1为红光波段对应的环境光系数。
206、计算当前环境下来自环境光的绿光强度分量G3=(m2×G1-G2)/(m2-n2),其中,G1为第一绿光强度,G2为第二绿光强度,m2为绿光波段对应的屏幕光系数,n2为绿光波段对应的环境光系数。
比如,在获取到当前环境下的第一绿光强度G1,第二绿光强度G2,绿光波段对应的屏幕光系数m2以及当前光源类型下的环境光系数n2后,电子设备可以计算当前环境下仅来自环境光的绿光强度分量G3,其中G3=(m2×G1-G2)/(m2-n2)。
需要说明的是,假设当前环境下第一环境光传感器检测到的环境光强度值G1中来自屏幕发光的光强为x2,来自环境光的光强为y2。那么,x2+y2=G1。基于屏幕光系数m2和环境光系数n2可知,第二环境光传感器检测到的环境光强度值G2中来自屏幕发光的光强为m2×x2,来自环境光的光强为n2×y2。那么,m1×x2+n1×y2=R2。可以理解的是,x2+y2=G1和m2×x2+n2×y2=G2可以构成二元一次方程组,解这个二元一次方程组,可以得到y2=(m2×G1-G2)/(m2-n2)。
在本申请实施例中,可以将第一环境光传感器对应的来自环境光的绿光波段的光强y2确定为当前环境下来自环境光的绿光强度分量G3。
在另一种实施方式中,也可以将第二环境光传感器对应的来自环境光的绿光波段的光强n2×y2确定为当前环境下来自环境光的绿光强度分量,G4=n2×y2=n2×(m2×G1-G2)/(m2-n2),其中,G1为第一绿光强度,G2为第二绿光强度,m2为绿光波段对应的屏幕光系数,n2为绿光波段对应的环境 光系数。
207、计算当前环境下来自环境光的蓝光强度分量B3=(m3×B1-B2)/(m3-n3),其中,B1为第一蓝光强度,B2为第二蓝光强度,m3为蓝光波段对应的屏幕光系数,n3为蓝光波段对应的环境光系数。
比如,在获取到当前环境下的第一蓝光强度B1,第二蓝光强度B2,蓝光波段对应的屏幕光系数m3,蓝光波段在当前光源类型下的对应的环境光系数n3后,电子设备可以计算当前环境下仅来自环境光的蓝光强度分量B3,其中,B3=(m3×B1-B2)/(m3-n3)。
需要说明的是,假设当前环境下第一环境光传感器检测到的环境光强度值B1中来自屏幕发光的光强为x3,来自环境光的光强为y3。那么,x3+y3=B1。基于屏幕光系数m3和环境光系数n3可知,第二环境光传感器检测到的环境光强度值B2中来自屏幕发光的光强为m3×x3,来自环境光的光强为n3×y3。那么,m3×x3+n3×y3=B2。可以理解的是,x3+y3=B1和m3×x3+n3×y3=B2可以构成二元一次方程组,解这个二元一次方程组,可以得到y3=(m3×B1-B2)/(m3-n3)。
在本申请实施例中,可以将第一环境光传感器对应的来自环境光的蓝光波段的光强y3确定为当前环境下来自环境光的蓝光强度分量B3。
在另一种实施方式中,也可以将第二环境光传感器对应的来自环境光的蓝光波段的光强n3×y3确定为当前环境下来自环境光的蓝光强度分量,其中,B4=n3×y3=n3×(m3×B1-B2)/(m3-n3),其中,B1为第一蓝光强度,B2为第二蓝光强度,m3为蓝光波段对应的屏幕光系数,n3为蓝光波段对应的环境光系数。
208、根据红光强度分量、绿光强度分量、蓝光强度分量,获取当前环境对应的环境光强度值和/或色温值。
比如,在计算得到红光强度分量、绿光强度分量、蓝光强度分量后,电子设备可以根据该红光强度分量、绿光强度分量、蓝光强度分量计算当前环境对应的环境光强度值和/或色温值。即,电子设备可以根据仅受纯环境光影响的红光强度、绿光强度、蓝光强度来计算环境光强度值和/或色温值。由于最终计算得到的环境光强度值和/或色温值排除了屏幕发光对环境光强度值和/或色温值的影响,能够真实反映环境光的强度和色温,从而提高了环境光检测的准确度。
即,本实施例中电子设备可以将第一环境光传感器对应的仅受环境光影响的环境光强度值和/或色温值确定为当前环境下仅受环境光影响的环境光强度值和/或色温值。
在另一种实施方式中,电子设备根据第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取当前环境下来自环境光的红光强度分量的流程,可以包括:当前环境下来自环境光的红光强度分量R4=n1×(m1×R1-R2)/(m1-n1),其中,R1为第一红光强度,R2为第二红光强度,m1为红光波段对应的屏幕光系数,n1为红光波段对应的环境光系数。
电子设备根据第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取当前环境下来自环境光的绿光强度分量的流程,可以包括:当前环境下来自环境光的绿光强度分量G4=n2×(m2×G1-G2)/(m2-n2),其中,G1为第一绿光强度,G2为第二绿光强度,m2为绿光波段对应的屏幕光系数,n2为绿光波段对应的环境光系数。
电子设备根据第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取当前环境下来自环境光的蓝光强度分量的流程,可以包括:当前环境下来自环境光的蓝光强度分量B4=n3×(m3×B1-B2)/(m3-n3),其中,B1为第一蓝光强度,B2为第二蓝光强度,m3为蓝光波段对应的屏幕光系数,n3为蓝光波段对应的环境光系数。
之后,电子设备可以根据红光强度分量R4、绿光强度分量G4、蓝光强度分量B4计算当前环境对应的环境光强度值和/或色温值。
也即,电子设备也可以将第二环境光传感器对应的仅受环境光影响的环境光强度值和/或色温值确定为当前环境下仅受环境光影响的环境光强度值和/或色温值。
在一种实施方式中,本申请实施例可以通过如下公式来实现根据红光强度分量、绿光强度分量、蓝光强度分量,获取当前环境对应的环境光强度值和/或色温值,例如红光强度分量记为R’、绿光强度分量G’、蓝光强度分量B’,那么电子设备可以先根据如下公式计算P、U、V、h、k、T这六个数值:
P=(-0.14282)(R’)+(1.54924)(G’)+(-0.95641)(B’);
U=(-0.32466)(R’)+(1.57837)(G’)+(-0.73191)(B’);
V=(-0.68202)(R’)+(0.77073)(G’)+(0.56332)(B’);
h=P/(P+U+V);
k=U/(P+U+V);
T=449n 3+3525n 2+6823.3n+5520.33,其中n=(h-0.3320)/(0.1858-k)。
其中,电子设备可以将计算得到的U的数值确定为当前环境对应的环境光强度值,将计算得到的T的数值确定为当前环境对应的色温值。
在上述公式中,R’、G’、B’可以分别为R3、G3、B3。或者,R’、G’、B’可以分别为R4、G4、B4。
在又一种实施方式中,除了根据来自环境光的红光强度分量、绿光强度分量、蓝光强度分量来计算当前环境对应的环境光强度值和/或色温值之外,还可以根据来自环境光的红光强度分量、绿光强度分量、蓝光强度分量以及可见光强度分量来计算当前环境对应的环境光强度值和/或色温值。
比如,电子设备可以获取当前环境下第一环境光传感器检测到的第一可见光强度,以及第二环境光传感器检测到的第二可见光强度。之后,电子设备可以获取可见光波段所对应的屏幕光系数和环境光系数。之后,电子设备可以根据上述第一可见光强度、第二可见光强度、可见光波段对应的屏幕光系数和环境光系数来计算当前环境下来自环境光的可见光强度分量。最后,电子设备可以根据红光强度分量、绿光强度分量、蓝光强度分量以及所述可见光强度分量,计算当前环境对应的环境光强度值和/或色温值。
其中,根据第一可见光强度、第二可见光强度、可见光波段对应的屏幕光系数和环境光系数,计算当前环境下来自环境光的可见光强度分量,可以包括:
所述当前环境下来自环境光的可见光强度分量C3=(m4×C1-C2)/(m4-n4),其中,C1为所述第一可见光强度,C2为所述第二可见光强度,m4为所述可见光波段对应的屏幕光系数,n4为所述可见光波段对应的环境光系数;
或者,所述当前环境下来自环境光的可见光强度分量C4=n4×(m4×C1-C2)/(m4-n4),其中,C1为所述第一可见光强度,C2为所述第二可见光强度,m4为所述可见光波段对应的屏幕光系数,n4为所述可见光波段对应的环境光系数。
在一种实施方式中,本申请实施例可以通过如下公式来实现根据红光强度分量、绿光强度分量、蓝光强度分量以及可见光强度分量,获取当前环境对应的环境光强度值,例如红光强度分量记为R’、绿光强度分量记为G’、蓝光强度分量记为B’、可见光强度分量记为C’,那么电子设备可以通过如下公式来计算当前环境对应的环境光强度值L:
L=64×D_factor×(clear_raw×c_coef+red_raw×r_coef+green_raw×g_coef+blue_raw×b_coef)/(atime×again)。其中,atime是积分时间,again是增益,clear_raw是C’,red_raw是R’,green_raw是G’,blue_raw是B’。其它参数在.h库中设置或者从json文件传进来。其中.h库中定义的参数参考如下:D_Factor=15.9,C_Coef=1.66,R_Coef=-1.02,G_Coef=2.36,B_Coef=-3.15。从json文件传进来的参数参考如下:D_Factor=58.0,C_Coef=2.11,R_Coef=-1.35,G_Coef=2.06,B_Coef=-3.25。
当然,在其它实施方式中,也可以通过其它公式来根据红光强度分量、绿光强度分量、蓝光强度分量计算当前环境对应的环境光强度值和/或色温值,或者通过其它公式来红光强度分量、绿光强度分量、蓝光强度分量以及可见光强度分量计算当前环境对应的环境光强度值和/或色温值。这些公式属于现有技术,本实施例对此不做赘述。即,在获取到红光强度分量、绿光强度分量、蓝光强度分量以及可见光强度分量后,电子设备可以通过现有技术中的各种公式来计算当前环境对应的环境光强度值和/或色温值。
请参阅图7至图8,图7至图8为本申请实施例提供的环境光检测方法的场景示意图。
如图7所示,本申请实施例中电子设备可以为全面屏电子设备,该电子设备可以包括第一环境光传感器17和第二环境光传感器18。该第一环境光传感器17和第二环境光传感器18被电子设备的显示屏覆盖。该第一环境光传感器17和第二环境光传感器18均能检测出环境中的红光波段、绿光波段、蓝光波段、可见光波段以及全波段的光强度。
比如,用户在当前环境下使用电子设备观看视频。电子设备可以先识别当前环境的光源类型。例如,电子设备识别到当前环境的光源类型属于预设的第一光源类型。之后,电子设备可以获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数,以及各波段在当前的第一光源类型下的环境光系数。
例如,红光波段对应的屏幕光系数为m1,红光波段在第一光源类型下的环境光系数为n1。绿光波段对应的屏幕光系数为m2,绿光波段在第一光源类型下的环境光系数为n2。蓝光波段对应的屏幕光系数为m3,蓝光波段在第一光源类型下的环境光系数为n3。
之后,电子设备还可以获取当前环境下的第一环境光传感器检测到的第一红光强度R1、第一绿光强度G1、第一蓝光强度B1,以及第二环境光传感器检测到的第二红光强度R2、第二绿光强度G2、第二蓝光强度B2。
之后,电子设备可以计算当前环境下来自环境光的红光强度分量R3=(m1×R1-R2)/(m1-n1), 以及当前环境下来自环境光的绿光强度分量G3=(m2×G1-G2)/(m2-n2),以及计算当前环境下来自环境光的蓝光强度分量B3=(m3×B1-B2)/(m3-n3)。
之后,电子设备可以根据红光强度分量R3、绿光强度分量G3、蓝光强度分量B3,获取当前环境对应的环境光强度值Q。
例如,电子设备根据计算得到的环境光强度值Q检测到电子设备当前处于强光环境,因此电子设备可以调暗显示屏的亮度,如图8所示,以节省电量并保护用户视力。
请参阅图9,图9为本申请实施例提供的环境光检测装置的结构示意图。该环境光检测装置可以应用于电子设备,所述电子设备至少包括第一环境光传感器和第二环境光传感器,所述第一环境光传感器和第二环境光传感器被显示屏覆盖,每一环境光传感器均能检测出环境中的红光波段、绿光波段、蓝光波段的强度。
环境光检测装置300可以包括:获取模块301,计算模块302。
获取模块301,用于获取当前环境下所述第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度;获取所述当前环境下所述第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度;获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值,所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值;
计算模块302,用于根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量;根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量;根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
在一种实施方式中,所述计算模块302可以用于:
所述当前环境下来自环境光的红光强度分量R3=(m1×R1-R2)/(m1-n1),其中,R1为所述第一红光强度,R2为所述第二红光强度,m1为所述红光波段对应的屏幕光系数,n1为所述红光波段对应的环境光系数;
所述当前环境下来自环境光的绿光强度分量G3=(m2×G1-G2)/(m2-n2),其中,G1为所述第一绿光强度,G2为所述第二绿光强度,m2为所述绿光波段对应的屏幕光系数,n2为所述绿光波段对应的环境光系数;
所述当前环境下来自环境光的蓝光强度分量B3=(m3×B1-B2)/(m3-n3),其中,B1为所述第一蓝光强度,B2为所述第二蓝光强度,m3为所述蓝光波段对应的屏幕光系数,n3为所述蓝光波段对应的环境光系数。
在一种实施方式中,所述计算模块302还可以用于:
所述当前环境下来自环境光的红光强度分量R4=n1×(m1×R1-R2)/(m1-n1),其中,R1为所述第一红光强度,R2为所述第二红光强度,m1为所述红光波段对应的屏幕光系数,n1为所述红光波段对应的环境光系数;
所述当前环境下来自环境光的绿光强度分量G4=n2×(m2×G1-G2)/(m2-n2),其中,G1为所述第一绿光强度,G2为所述第二绿光强度,m2为所述绿光波段对应的屏幕光系数,n2为所述绿光波段对应的环境光系数;
所述当前环境下来自环境光的蓝光强度分量B4=n3×(m3×B1-B2)/(m3-n3),其中,B1为所述第一蓝光强度,B2为所述第二蓝光强度,m3为所述蓝光波段对应的屏幕光系数,n3为所述蓝光波段对应的环境光系数。
在一种实施方式中,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强均值的比值;所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强均值的比值。
在一种实施方式中,所述获取模块301还可以用于:识别所述当前环境的光源类型;获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述环境光系数与所述光源类型对应。
在一种实施方式中,所述获取模块301还可以用于:
获取所述当前环境下所述第一环境光传感器检测到的第一可见光强度,以及所述第二环境光传感器 检测到的第二可见光强度;获取可见光波段所对应的屏幕光系数和环境光系数;
那么,所述计算模块302可以用于:根据所述第一可见光强度、第二可见光强度、可见光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的可见光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量以及所述可见光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
在一种实施方式中,所述计算模块302可以用于:
所述当前环境下来自环境光的可见光强度分量C3=(m4×C1-C2)/(m4-n4),其中,C1为所述第一可见光强度,C2为所述第二可见光强度,m4为所述可见光波段对应的屏幕光系数,n4为所述可见光波段对应的环境光系数;
或者,所述当前环境下来自环境光的可见光强度分量C4=n4×(m4×C1-C2)/(m4-n4),其中,C1为所述第一可见光强度,C2为所述第二可见光强度,m4为所述可见光波段对应的屏幕光系数,n4为所述可见光波段对应的环境光系数。
本申请实施例提供一种计算机可读的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上执行时,使得所述计算机执行如本实施例提供的环境光检测方法中的流程。
本申请实施例还提供一种电子设备,包括显示屏,第一环境光传感器,第二环境光传感器,处理器,所述第一环境光传感器和所述第二环境光传感器被所述显示屏覆盖,所述第一环境光传感器和所述第二环境光传感器均能检测出环境中的红光波段、绿光波段、蓝光波段的强度;所述处理器用于执行本实施例提供的环境光检测方法中的流程。
例如,上述电子设备可以是诸如平板电脑或者智能手机等移动终端。请参阅图10,图10为本申请实施例提供的电子设备的结构示意图。
该电子设备400可以包括第一环境光传感器401、第二环境光传感器402、处理器403、存储器404、显示屏405等部件。本领域技术人员可以理解,图10中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
第一环境光传感器401和第二环境光传感器402可以检测出环境中的红光波段、绿光波段、蓝光波段的强度。第一环境光传感器401和第二环境光传感器402可以检测出周围环境的光强和色温等信息。第一环境光传感器401和第二环境光传感器402可以被显示屏405覆盖。
处理器403是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器402内的应用程序,以及调用存储在存储器402内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。
存储器404可用于存储应用程序和数据。存储器402存储的应用程序中包含有可执行代码。应用程序可以组成各种功能模块。处理器403通过运行存储在存储器402的应用程序,从而执行各种功能应用以及数据处理。
在本申请实施例中,所述第一环境光传感器401可以用于:获取当前环境下的第一红光强度、第一绿光强度、第一蓝光强度。
所述第二环境光传感器402可以用于:获取所述当前环境下的第二红光强度、第二绿光强度、第二蓝光强度。
电子设备中的处理器403会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行代码加载到存储器404中,并由处理器403来运行存储在存储器404中的应用程序,从而执行:获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值,所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值;根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量;根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量;根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
请参阅图11,电子设备400可以包括第一环境光传感器401、第二环境光传感器402、处理器403、存储器404、显示屏405、电池406等部件。
第一环境光传感器401和第二环境光传感器402可以检测出环境中的红光波段、绿光波段、蓝光波段的强度。第一环境光传感器401和第二环境光传感器402可以检测出周围环境的光强和色温等信息。 第一环境光传感器401和第二环境光传感器402被显示屏405覆盖。
处理器403是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器402内的应用程序,以及调用存储在存储器402内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。
存储器404可用于存储应用程序和数据。存储器402存储的应用程序中包含有可执行代码。应用程序可以组成各种功能模块。处理器403通过运行存储在存储器402的应用程序,从而执行各种功能应用以及数据处理。
电池406可以用于为电子设备的各个部件和模块提供电力支持,从而保证各部件和模块的正常运行。
在本申请实施例中,所述第一环境光传感器401可以用于:获取当前环境下的第一红光强度、第一绿光强度、第一蓝光强度。
所述第二环境光传感器402可以用于:获取所述当前环境下的第二红光强度、第二绿光强度、第二蓝光强度。
在本实施例中,电子设备中的处理器403会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行代码加载到存储器404中,并由处理器403来运行存储在存储器404中的应用程序,从而执行:获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值,所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值;根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量;根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量;根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
在一种实施方式中,处理器403执行根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量时,可以执行:所述当前环境下来自环境光的红光强度分量R3=(m1×R1-R2)/(m1-n1),其中,R1为所述第一红光强度,R2为所述第二红光强度,m1为所述红光波段对应的屏幕光系数,n1为所述红光波段对应的环境光系数。
处理器403执行根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量时,可以执行:所述当前环境下来自环境光的绿光强度分量G3=(m2×G1-G2)/(m2-n2),其中,G1为所述第一绿光强度,G2为所述第二绿光强度,m2为所述绿光波段对应的屏幕光系数,n2为所述绿光波段对应的环境光系数。
处理器403执行根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量时,可以执行:所述当前环境下来自环境光的蓝光强度分量B3=(m3×B1-B2)/(m3-n3),其中,B1为所述第一蓝光强度,B2为所述第二蓝光强度,m3为所述蓝光波段对应的屏幕光系数,n3为所述蓝光波段对应的环境光系数。
在另一种实施方式中,处理器403执行根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量时,可以执行:所述当前环境下来自环境光的红光强度分量R4=n1×(m1×R1-R2)/(m1-n1),其中,R1为所述第一红光强度,R2为所述第二红光强度,m1为所述红光波段对应的屏幕光系数,n1为所述红光波段对应的环境光系数。
处理器403执行根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量时,可以执行:所述当前环境下来自环境光的绿光强度分量G4=n2×(m2×G1-G2)/(m2-n2),其中,G1为所述第一绿光强度,G2为所述第二绿光强度,m2为所述绿光波段对应的屏幕光系数,n2为所述绿光波段对应的环境光系数。
处理器403执行根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量时,可以执行:所述当前环境下来自环境光的蓝光强度分量B4=n3×(m3×B1-B2)/(m3-n3),其中,B1为所述第一蓝光强度,B2为所述第二蓝光强度,m3为所述蓝光波段对应的屏幕光系数,n3为所述蓝光波段对应的环境光系数。
在一种实施方式中,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强均值的比值;所述环境光系数为预先处于有外界环境 光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强均值的比值。
在一种实施方式中,处理器403还可以执行:识别所述当前环境的光源类型;
那么,处理器403执行所述获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数时,可以执行:获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述环境光系数与所述光源类型对应。
在一种实施方式中,所述第一环境光传感器401可以用于:获取所述当前环境下的第一可见光强度。所述第二环境光传感器402可以用于:获取所述当前环境下的第二可见光强度。
所述处理器403还可以执行:获取可见光波段所对应的屏幕光系数和环境光系数;根据所述第一可见光强度、第二可见光强度、可见光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的可见光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量以及所述可见光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
在一种实施方式中,处理器403执行根据所述第一可见光强度、第二可见光强度、可见光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的可见光强度分量时,可以执行:所述当前环境下来自环境光的可见光强度分量C3=(m4×C1-C2)/(m4-n4),其中,C1为所述第一可见光强度,C2为所述第二可见光强度,m4为所述可见光波段对应的屏幕光系数,n4为所述可见光波段对应的环境光系数;或者,所述当前环境下来自环境光的可见光强度分量C4=n4×(m4×C1-C2)/(m4-n4),其中,C1为所述第一可见光强度,C2为所述第二可见光强度,m4为所述可见光波段对应的屏幕光系数,n4为所述可见光波段对应的环境光系数。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见上文针对环境光检测方法的详细描述,此处不再赘述。
本申请实施例提供的所述环境光检测装置与上文实施例中的环境光检测方法属于同一构思,在所述环境光检测装置上可以运行所述环境光检测方法实施例中提供的任一方法,其具体实现过程详见所述环境光检测方法实施例,此处不再赘述。
需要说明的是,对本申请实施例所述环境光检测方法而言,本领域普通技术人员可以理解实现本申请实施例所述环境光检测方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,所述计算机程序可存储于一计算机可读取存储介质中,如存储在存储器中,并被至少一个处理器执行,在执行过程中可包括如所述环境光检测方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)等。
对本申请实施例的所述环境光检测装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,所述存储介质譬如为只读存储器,磁盘或光盘等。
以上对本申请实施例所提供的一种环境光检测方法、装置、存储介质以及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种环境光检测方法,应用于电子设备,其中,所述电子设备至少包括第一环境光传感器和第二环境光传感器,所述第一环境光传感器和所述第二环境光传感器被显示屏覆盖,每一环境光传感器均能检测出环境中的红光波段、绿光波段、蓝光波段的强度,所述方法包括:
    获取当前环境下所述第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度;
    获取所述当前环境下所述第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度;
    获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值,所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值;
    根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量;
    根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量;
    根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量;
    根据所述红光强度分量、绿光强度分量、蓝光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
  2. 根据权利要求1所述的环境光检测方法,其中,根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量,包括:
    所述当前环境下来自环境光的红光强度分量R3=(m1×R1-R2)/(m1-n1),其中,R1为所述第一红光强度,R2为所述第二红光强度,m1为所述红光波段对应的屏幕光系数,n1为所述红光波段对应的环境光系数;
    根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量,包括:
    所述当前环境下来自环境光的绿光强度分量G3=(m2×G1-G2)/(m2-n2),其中,G1为所述第一绿光强度,G2为所述第二绿光强度,m2为所述绿光波段对应的屏幕光系数,n2为所述绿光波段对应的环境光系数;
    根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量,包括:
    所述当前环境下来自环境光的蓝光强度分量B3=(m3×B1-B2)/(m3-n3),其中,B1为所述第一蓝光强度,B2为所述第二蓝光强度,m3为所述蓝光波段对应的屏幕光系数,n3为所述蓝光波段对应的环境光系数。
  3. 根据权利要求1所述的环境光检测方法,其中,根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量,包括:
    所述当前环境下来自环境光的红光强度分量R4=n1×(m1×R1-R2)/(m1-n1),其中,R1为所述第一红光强度,R2为所述第二红光强度,m1为所述红光波段对应的屏幕光系数,n1为所述红光波段对应的环境光系数;
    根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量,包括:
    所述当前环境下来自环境光的绿光强度分量G4=n2×(m2×G1-G2)/(m2-n2),其中,G1为所述第一绿光强度,G2为所述第二绿光强度,m2为所述绿光波段对应的屏幕光系数,n2为所述绿光波段对应的环境光系数;
    根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量,包括:
    所述当前环境下来自环境光的蓝光强度分量B4=n3×(m3×B1-B2)/(m3-n3),其中,B1为所述第一蓝光强度,B2为所述第二蓝光强度,m3为所述蓝光波段对应的屏幕光系数,n3为所述蓝光波段对应的环境光系数。
  4. 根据权利要求1所述的环境光检测方法,其中,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强均值的比值;
    所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光 传感器检测到的对应波段的光强均值的比值。
  5. 根据权利要求1所述的环境光检测方法,其中,所述方法还包括:
    识别所述当前环境的光源类型;
    所述获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,包括:
    获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述环境光系数与所述光源类型对应。
  6. 根据权利要求5所述的环境光检测方法,其中,所述方法还包括:
    获取所述当前环境下所述第一环境光传感器检测到的第一可见光强度,以及所述第二环境光传感器检测到的第二可见光强度;
    获取可见光波段所对应的屏幕光系数和环境光系数;
    根据所述第一可见光强度、第二可见光强度、可见光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的可见光强度分量;
    根据所述红光强度分量、绿光强度分量、蓝光强度分量,获取所述当前环境对应的环境光强度值和/或色温值,包括:
    根据所述红光强度分量、绿光强度分量、蓝光强度分量以及所述可见光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
  7. 根据权利要求6所述的环境光检测方法,其中,根据所述第一可见光强度、第二可见光强度、可见光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的可见光强度分量,包括:
    所述当前环境下来自环境光的可见光强度分量C3=(m4×C1-C2)/(m4-n4),其中,C1为所述第一可见光强度,C2为所述第二可见光强度,m4为所述可见光波段对应的屏幕光系数,n4为所述可见光波段对应的环境光系数;
    或者,所述当前环境下来自环境光的可见光强度分量C4=n4×(m4×C1-C2)/(m4-n4),其中,C1为所述第一可见光强度,C2为所述第二可见光强度,m4为所述可见光波段对应的屏幕光系数,n4为所述可见光波段对应的环境光系数。
  8. 根据权利要求1所述的环境光检测方法,其中,所述获取当前环境下所述第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度,包括:
    当屏幕为红色屏幕时,获取当前环境下所述第一环境光传感器检测到的第一红光强度,当屏幕为绿色屏幕时,获取当前环境下所述第一环境光传感器检测到的第一绿光强度,当屏幕为蓝色屏幕时,获取当前环境下所述第一环境光传感器检测到的第一蓝光强度;
    所述获取所述当前环境下所述第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度,包括:
    当屏幕为红色屏幕时,获取当前环境下所述第二环境光传感器检测到的第二红光强度;当屏幕为绿色屏幕时,获取当前环境下所述第二环境光传感器检测到的第二绿光强度,当屏幕为蓝色屏幕时,获取当前环境下所述第二环境光传感器检测到的第二蓝光强度。
  9. 根据权利要求1所述的环境光检测方法,其中,所述获取当前环境下所述第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度,包括:
    当屏幕为白色屏幕时,获取当前环境下所述第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度;
    所述获取所述当前环境下所述第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度,包括:
    当屏幕为白色屏幕时,获取当前环境下所述第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度。
  10. 一种环境光检测装置,应用于电子设备,其中,所述电子设备至少包括第一环境光传感器和第二环境光传感器,所述第一环境光传感器和所述第二环境光传感器被显示屏覆盖,每一环境光传感器均能检测出环境中的红光波段、绿光波段、蓝光波段的强度,所述装置包括:
    获取模块,用于获取当前环境下所述第一环境光传感器检测到的第一红光强度、第一绿光强度、第一蓝光强度;获取所述当前环境下所述第二环境光传感器检测到的第二红光强度、第二绿光强度、第二蓝光强度;获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值,所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值;
    计算模块,用于根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量;根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量;根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
  11. 一种计算机可读的存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上执行时,使得所述计算机执行如权利要求1至9中任一项所述的方法。
  12. 一种电子设备,其中,包括:显示屏、第一环境光传感器、第二环境光传感器以及处理器;
    所述第一环境光传感器和所述第二环境光传感器被所述显示屏覆盖,所述第一环境光传感器和所述第二环境光传感器均能检测出环境中的红光波段、绿光波段、蓝光波段的强度;
    所述第一环境光传感器用于:获取当前环境下的第一红光强度、第一绿光强度、第一蓝光强度;
    所述第二环境光传感器用于:获取所述当前环境下的第二红光强度、第二绿光强度、第二蓝光强度;
    所述处理器用于:获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值,所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强比值;根据所述第一红光强度、第二红光强度、红光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的红光强度分量;根据所述第一绿光强度、第二绿光强度、绿光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的绿光强度分量;根据所述第一蓝光强度、第二蓝光强度、蓝光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的蓝光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
  13. 根据权利要求12所述的电子设备,其中,所述处理器用于:
    计算所述当前环境下来自环境光的红光强度分量R3=(m1×R1-R2)/(m1-n1),其中,R1为所述第一红光强度,R2为所述第二红光强度,m1为所述红光波段对应的屏幕光系数,n1为所述红光波段对应的环境光系数;
    计算所述当前环境下来自环境光的绿光强度分量G3=(m2×G1-G2)/(m2-n2),其中,G1为所述第一绿光强度,G2为所述第二绿光强度,m2为所述绿光波段对应的屏幕光系数,n2为所述绿光波段对应的环境光系数;
    计算所述当前环境下来自环境光的蓝光强度分量B3=(m3×B1-B2)/(m3-n3),其中,B1为所述第一蓝光强度,B2为所述第二蓝光强度,m3为所述蓝光波段对应的屏幕光系数,n3为所述蓝光波段对应的环境光系数。
  14. 根据权利要求12所述的电子设备,其中,所述处理器用于:
    计算所述当前环境下来自环境光的红光强度分量R4=n1×(m1×R1-R2)/(m1-n1),其中,R1为所述第一红光强度,R2为所述第二红光强度,m1为所述红光波段对应的屏幕光系数,n1为所述红光波段对应的环境光系数;
    计算所述当前环境下来自环境光的绿光强度分量G4=n2×(m2×G1-G2)/(m2-n2),其中,G1为所述第一绿光强度,G2为所述第二绿光强度,m2为所述绿光波段对应的屏幕光系数,n2为所述绿光波段对应的环境光系数;
    计算所述当前环境下来自环境光的蓝光强度分量B4=n3×(m3×B1-B2)/(m3-n3),其中,B1为所述第一蓝光强度,B2为所述第二蓝光强度,m3为所述蓝光波段对应的屏幕光系数,n3为所述蓝光波段对应的环境光系数。
  15. 根据权利要求12所述的电子设备,其中,所述屏幕光系数为预先处于屏幕点亮且无外界环境光时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强均值的比值;
    所述环境光系数为预先处于有外界环境光且屏幕熄灭时所述第一环境光传感器和所述第二环境光传感器检测到的对应波段的光强均值的比值。
  16. 根据权利要求12所述的电子设备,其中,所述处理器还用于:
    识别所述当前环境的光源类型;
    获取红光波段、绿光波段、蓝光波段中的各波段所对应的屏幕光系数和环境光系数,所述环境光系数与所述光源类型对应。
  17. 根据权利要求16所述的电子设备,其中,
    所述第一环境光传感器还用于:获取所述当前环境下的第一可见光强度;
    所述第二环境光传感器还用于:获取所述当前环境下的第二可见光强度;
    所述处理器还用于:获取可见光波段所对应的屏幕光系数和环境光系数;根据所述第一可见光强度、第二可见光强度、可见光波段对应的屏幕光系数和环境光系数,获取所述当前环境下来自环境光的可见光强度分量;根据所述红光强度分量、绿光强度分量、蓝光强度分量以及所述可见光强度分量,获取所述当前环境对应的环境光强度值和/或色温值。
  18. 根据权利要求17所述的电子设备,其中,所述处理器用于:
    计算所述当前环境下来自环境光的可见光强度分量C3=(m4×C1-C2)/(m4-n4),其中,C1为所述第一可见光强度,C2为所述第二可见光强度,m4为所述可见光波段对应的屏幕光系数,n4为所述可见光波段对应的环境光系数;或者,计算所述当前环境下来自环境光的可见光强度分量C4=n4×(m4×C1-C2)/(m4-n4),其中,C1为所述第一可见光强度,C2为所述第二可见光强度,m4为所述可见光波段对应的屏幕光系数,n4为所述可见光波段对应的环境光系数。
  19. 根据权利要求12所述的电子设备,其中,
    所述第一环境光传感器用于:当屏幕为红色屏幕时,获取当前环境下的第一红光强度,当屏幕为绿色屏幕时,获取当前环境下的第一绿光强度,当屏幕为蓝色屏幕时,获取当前环境下的第一蓝光强度;
    所述第二环境光传感器用于:当屏幕为红色屏幕时,获取当前环境下的第二红光强度,当屏幕为绿色屏幕时,获取当前环境下的第二绿光强度,当屏幕为蓝色屏幕时,获取当前环境下的第二蓝光强度。
  20. 根据权利要求12所述的电子设备,其中,
    所述第一环境光传感器用于:当屏幕为白色屏幕时,获取当前环境下的第一红光强度、第一绿光强度、第一蓝光强度;
    所述第二环境光传感器用于:当屏幕为白色屏幕时,获取当前环境下的第二红光强度、第二绿光强度、第二蓝光强度。
PCT/CN2021/105731 2020-08-28 2021-07-12 设备检测方法、装置、存储介质及电子设备 WO2022042085A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010887622.6A CN111947775B (zh) 2020-08-28 2020-08-28 设备检测方法、装置、存储介质及电子设备
CN202010887622.6 2020-08-28

Publications (1)

Publication Number Publication Date
WO2022042085A1 true WO2022042085A1 (zh) 2022-03-03

Family

ID=73367105

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/105731 WO2022042085A1 (zh) 2020-08-28 2021-07-12 设备检测方法、装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN111947775B (zh)
WO (1) WO2022042085A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111947775B (zh) * 2020-08-28 2022-10-21 Oppo广东移动通信有限公司 设备检测方法、装置、存储介质及电子设备
TWI822052B (zh) * 2022-05-23 2023-11-11 聯詠科技股份有限公司 面板裝置

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140306943A1 (en) * 2013-04-16 2014-10-16 Fih (Hong Kong) Limited Electronic device and method for adjusting backlight of electronic device
CN105575334A (zh) * 2015-07-10 2016-05-11 宇龙计算机通信科技(深圳)有限公司 一种屏幕亮度调节方法及用户终端
CN107818763A (zh) * 2017-10-25 2018-03-20 上海龙旗科技股份有限公司 一种具有护眼功能的电子设备及其信息处理方法
CN107818753A (zh) * 2017-11-22 2018-03-20 广东欧珀移动通信有限公司 屏幕亮度调整方法、装置、存储介质和电子设备
CN107941330A (zh) * 2017-11-22 2018-04-20 广东欧珀移动通信有限公司 环境光强度检测方法、装置、存储介质及电子设备
CN107945769A (zh) * 2017-11-22 2018-04-20 广东欧珀移动通信有限公司 环境光强度检测方法、装置、存储介质及电子设备
CN108877737A (zh) * 2018-06-12 2018-11-23 努比亚技术有限公司 屏幕调节方法、移动终端及计算机可读存储介质
CN111947775A (zh) * 2020-08-28 2020-11-17 Oppo广东移动通信有限公司 设备检测方法、装置、存储介质及电子设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120001841A1 (en) * 2010-06-30 2012-01-05 Jeff Gokingco Identifying ambient light type and illuminance compensation using a plurality of photodetectors
CN109119031B (zh) * 2018-09-07 2020-01-31 广州视源电子科技股份有限公司 一种控制显示器屏幕输出亮度的方法、装置及电子设备
CN110675839A (zh) * 2019-10-11 2020-01-10 Oppo广东移动通信有限公司 一种屏幕调节方法、电子设备及相关装置
CN111380609B (zh) * 2020-05-28 2020-09-18 北京小米移动软件有限公司 光感数据获取方法及装置、电子设备、存储介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140306943A1 (en) * 2013-04-16 2014-10-16 Fih (Hong Kong) Limited Electronic device and method for adjusting backlight of electronic device
CN105575334A (zh) * 2015-07-10 2016-05-11 宇龙计算机通信科技(深圳)有限公司 一种屏幕亮度调节方法及用户终端
CN107818763A (zh) * 2017-10-25 2018-03-20 上海龙旗科技股份有限公司 一种具有护眼功能的电子设备及其信息处理方法
CN107818753A (zh) * 2017-11-22 2018-03-20 广东欧珀移动通信有限公司 屏幕亮度调整方法、装置、存储介质和电子设备
CN107941330A (zh) * 2017-11-22 2018-04-20 广东欧珀移动通信有限公司 环境光强度检测方法、装置、存储介质及电子设备
CN107945769A (zh) * 2017-11-22 2018-04-20 广东欧珀移动通信有限公司 环境光强度检测方法、装置、存储介质及电子设备
CN108877737A (zh) * 2018-06-12 2018-11-23 努比亚技术有限公司 屏幕调节方法、移动终端及计算机可读存储介质
CN111947775A (zh) * 2020-08-28 2020-11-17 Oppo广东移动通信有限公司 设备检测方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
CN111947775B (zh) 2022-10-21
CN111947775A (zh) 2020-11-17

Similar Documents

Publication Publication Date Title
US20210082373A1 (en) Method for correcting brightness of display panel and apparatus for correcting brightness of display panel
WO2022042085A1 (zh) 设备检测方法、装置、存储介质及电子设备
AU2015101593A4 (en) Ambient light adaptive displays with paper-like appearance
US9582083B2 (en) Directional light sensors
CN107941330B (zh) 环境光强度检测方法、装置、存储介质及电子设备
EP2940680B1 (en) Transparent display device and method for controlling same
US9019253B2 (en) Methods and systems for adjusting color gamut in response to ambient conditions
WO2019100850A1 (en) Method for detecting ambient light intensity, storage medium and electronic device
US10444555B2 (en) Display screen, electronic device, and light intensity detection method
CN110146161B (zh) 环境光照强度的检测方法、装置和终端
KR101805512B1 (ko) 디스플레이 밝기 및 콘텐츠를 조절하기 위한 주변 광 환경에 대한 파장 정보 사용
US20100103172A1 (en) System and method for rendering ambient light affected appearing imagery based on sensed ambient lighting
US10497297B2 (en) Electronic device with ambient-adaptive display
US20190318696A1 (en) Ambient light color compensation systems and methods for electronic device displays
US20190340983A1 (en) Display device and displaying method
TWI386910B (zh) 顯示裝置及其亮度調整方法
US9124753B2 (en) Information processing apparatus and method, and photoelectric conversion apparatus
CN104318912A (zh) 一种检测环境光亮度的方法及装置
CN107945770A (zh) 环境光强度检测方法、装置、存储介质及电子设备
US11375129B2 (en) Light compensation method and device for camera under display
WO2018201727A1 (zh) 光电传感器、显示面板及显示装置
US20240046874A1 (en) Compensating for Voltage Losses in OLED Displays
CN107257414B (zh) 一种屏幕状态控制方法、装置、存储介质及移动终端
WO2022183888A1 (zh) 屏幕漏光量确定和亮度调节方法、装置及电子设备
JP4588936B2 (ja) 液晶表示装置とその自動調光制御方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21859925

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21859925

Country of ref document: EP

Kind code of ref document: A1