CN-121994351-A - Ambient light detection method, display screen adjustment method, electronic device and storage medium
Abstract
The application discloses an ambient light detection method, a display screen adjusting method, electronic equipment and a storage medium, wherein the ambient light detection method is applied to the electronic equipment, the electronic equipment comprises a display screen and an ambient light sensor positioned below the display screen, and the ambient light detection method comprises the steps of acquiring first ambient light data acquired by the ambient light sensor when the display screen is in a display state; and determining second ambient light data of the environment where the display screen is positioned according to the first ambient light data and the reflected light data. According to the method, the ambient light of the environment where the display screen is located is detected according to the ambient light data collected by the ambient light sensor and the reflected light data of the display screen, the reflected light data in the ambient light data collected by the ambient light sensor can be effectively removed, and the detection accuracy of detecting the ambient light is improved.
Inventors
- WANG HAO
Assignees
- 荣耀终端股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241107
Claims (14)
- 1. An ambient light detection method, applied to an electronic device, the electronic device including a display screen and an ambient light sensor located below the display screen, the ambient light detection method comprising: When the display screen is in a display state, acquiring first ambient light data acquired by the ambient light sensor; Determining that the ambient light sensor collects reflected light data of the display screen; and determining second ambient light data of the environment where the display screen is positioned according to the first ambient light data and the reflected light data.
- 2. The ambient light detection method of claim 1, wherein the determining that the ambient light sensor collects reflected light data of the display screen comprises: When the display screen displays a white image, determining a reflected light color mixing coefficient of the reflected light reflected by the display screen to the ambient light sensor; And determining the reflected light data according to the reflected light color mixing coefficient.
- 3. The method according to claim 2, wherein determining a reflected light color mixture coefficient of the reflected light reflected by the display screen to the ambient light sensor when the display screen displays a white figure comprises: Acquiring three primary color chart calibration data and white chart calibration data; Fitting the three primary color chart calibration data respectively to obtain three primary color curves, wherein each primary color curve is used for representing the corresponding relation between the brightness of the chart of the corresponding color displayed by the display screen and the ambient light data acquired by the ambient light sensor; and determining the color mixing coefficient of the reflected light according to the three primary color curves and the white map calibration data.
- 4. The ambient light detection method of claim 3, wherein determining the reflected light color mixing coefficient from the three primary color curves and the white map calibration data comprises: constructing a multiple linear regression model according to the three primary color curves and the white map calibration data; and fitting the multiple linear regression model based on a least square method to obtain the reflected light color mixing coefficient.
- 5. The ambient light detection method according to claim 3 or 4, wherein before the acquiring of the three primary color map calibration data and the white map calibration data, the ambient light detection method further comprises: determining whether ambient light calibration data comprises the white map calibration data; the obtaining the three primary color chart calibration data and the white chart calibration data comprises the following steps: And when the ambient light calibration data is determined to contain the white map calibration data, acquiring the three-primary color map calibration data and the white map calibration data according to the ambient light calibration data.
- 6. The ambient light detection method according to claim 5, wherein when it is determined that the ambient light calibration data includes the white map calibration data, acquiring the three primary color map calibration data and the white map calibration data from the ambient light calibration data includes: When the ambient light calibration data is determined to contain the white map calibration data, the ambient light calibration data is analyzed according to a preset analysis format, and the three-primary-color-map calibration data and the white map calibration data are obtained.
- 7. The ambient light detection method according to claim 5 or 6, wherein the determining whether ambient light calibration data contains the white map calibration data comprises: when the marker bit of the ambient light calibration data comprises a preset marker bit, determining that the ambient light calibration data comprises the white map calibration data; And when the marker bit of the ambient light calibration data does not contain a preset marker bit, determining that the ambient light calibration data does not contain the white map calibration data.
- 8. The ambient light detection method according to any one of claims 5 to 7, wherein before the first ambient light data collected by the ambient light sensor is acquired while the display screen is in the display state, the ambient light detection method further comprises: controlling the display screen to display a red image, a green image, a blue image and Bai Tu respectively; And controlling the ambient light sensor to respectively acquire third ambient light data of the red image displayed by the display screen, fourth ambient light data of the green image displayed by the display screen, fifth ambient light data of the blue image displayed by the display screen and sixth ambient light data of Bai Tu displayed by the display screen, so as to obtain the ambient light calibration data.
- 9. The ambient light detection method according to claim 8, wherein before the controlling the display screen to display the red map, the green map, the blue map, and the white map, respectively, the ambient light detection method further comprises: determining whether the electronic device supports Bai Tu calibrations; the controlling the display screen to display a red image, a green image, a blue image and the white image respectively comprises the following steps: And when the electronic equipment is determined to support the calibration of the white graph, controlling the display screen to display the red graph, the green graph, the blue graph and the white graph respectively.
- 10. The ambient light detection method of claim 9, wherein the determining whether the electronic device supports Bai Tu calibration comprises: acquiring configuration information of the electronic equipment; When the configuration information comprises preset configuration information, determining that the electronic equipment supports Bai Tu calibration; And when the configuration information does not contain the preset configuration information, determining that the electronic equipment does not support white image calibration.
- 11. The ambient light detection method according to claim 9 or 10, wherein before the controlling the display screen to display the red map, the green map, the blue map, and the white map, respectively, the ambient light detection method further comprises: And performing configuration updating on an initial data storage structure of the electronic device to obtain a target data storage structure, wherein the initial data storage structure is used for storing the third ambient light data, the fourth ambient light data and the fifth ambient light data, and the target data storage structure is used for storing the third ambient light data, the fourth ambient light data, the fifth ambient light data and the sixth ambient light data.
- 12. A display screen adjustment method, characterized by being applied to an electronic device, the electronic device including a display screen, the display screen adjustment method comprising: Acquiring second ambient light data obtained by the ambient light detection method according to any one of claims 1 to 11 when the display screen is in a display state; and adjusting the brightness of the display screen according to the second ambient light data.
- 13. An electronic device, the electronic device comprising: one or more processors, and memory; The memory is coupled to the one or more processors, the memory for storing computer program code comprising computer instructions that are invoked by the one or more processors to cause the electronic device to perform the ambient light detection method of any one of claims 1 to 11, and/or the display screen adjustment method of claim 12.
- 14. A computer readable storage medium comprising instructions that, when run on an electronic device, cause the electronic device to perform the ambient light detection method of any one of claims 1 to 11, and/or the display screen adjustment method of claim 12.
Description
Ambient light detection method, display screen adjustment method, electronic device and storage medium Technical Field The present application relates to the field of display technologies, and in particular, to an ambient light detection method, a display adjustment method, an electronic device, and a storage medium. Background The automatic brightness adjustment of the display screen along with the brightness of the external environment is a basic function of electronic equipment such as a mobile phone, when the external environment becomes bright, the brightness of the display screen of the mobile phone is automatically adjusted up, and when the external environment becomes dark, the brightness of the display screen of the mobile phone is automatically adjusted down. Currently, in the process of adjusting the brightness of a display screen, the brightness of the display screen is adjusted according to ambient light collected by an ambient light sensor arranged below the display screen. However, since the light emitted by the display screen is partially reflected to the ambient sensor, the ambient light collected by the ambient light sensor includes the reflected light of the display screen, resulting in lower adjustment accuracy for adjusting the brightness of the display screen according to the ambient light. Therefore, how to accurately detect the ambient light of the environment where the display screen is located is a technical problem to be solved. Disclosure of Invention In view of the above, the embodiments of the present application provide an ambient light detection method, a display screen adjustment method, an electronic device, and a storage medium, so as to overcome the above problems in the prior art. In a first aspect, an embodiment of the present application provides an ambient light detection method, applied to an electronic device, where the electronic device includes a display screen and an ambient light sensor located below the display screen, where the ambient light detection method includes, when the display screen is in a display state, acquiring first ambient light data acquired by the ambient light sensor; and determining second ambient light data of the environment where the display screen is positioned according to the first ambient light data and the reflected light data. According to the scheme provided by the application, the ambient light of the environment where the display screen is positioned is detected according to the ambient light data acquired by the ambient light sensor and the reflected light data of the display screen, so that the reflected light data in the ambient light data acquired by the ambient light sensor can be effectively removed, and the detection accuracy of detecting the ambient light is improved. In some alternative embodiments, determining that the ambient light sensor collects the reflected light data of the display screen includes determining a reflected light color mixing coefficient of the reflected light reflected by the display screen to the ambient light sensor when the display screen displays a white map, and determining the reflected light data according to the reflected light color mixing coefficient. According to the scheme provided by the embodiment, the reflected light data is calculated according to the reflected light color mixing coefficient of the reflected light reflected by the display screen to the ambient light sensor, so that the accuracy of the reflected light data is improved. In some optional embodiments, when a white image is displayed on a display screen, determining a reflected light color mixing coefficient of reflected light reflected by the display screen to an ambient light sensor comprises obtaining three primary color image calibration data and white image calibration data, respectively fitting the three primary color image calibration data to obtain three primary color curves, wherein each primary color curve is used for representing a corresponding relation between brightness of an image displayed on the display screen and ambient light data acquired by the ambient light sensor, and determining the reflected light color mixing coefficient according to the three primary color curves and the white image calibration data. According to the scheme provided by the embodiment, the reflected light color mixing coefficient of the display screen is calculated according to the three-primary color chart calibration data and the white chart calibration data, so that the accuracy of the reflected light color mixing coefficient is improved. In some alternative embodiments, the method for determining the color mixing coefficient of the reflected light according to the three-primary-color curve and the white-image calibration data comprises the steps of constructing a multiple linear regression model according to the three-primary-color curve and the white-image calibration data, and fitting the multiple linear regression model ba