Under-screen light sensation correction method and device, electronic equipment, storage medium and product
Calculate the screen fit brightness value and transparency parameters through screenshots, correct the under-screen light sensing data, solve the problem of large correction errors in the existing technology, improve the accuracy of under-screen light sensing, and avoid dark light and dynamic video scenes. splash screen and light flicker.
Patent Information
- Application Number
- CN202410937027.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-12-06
AI Technical Summary
The prior art has problems with errors caused by excessive errors or multiple fittings when correcting the light sensitivity under the screen, resulting in problems such as light screens that are brighter in dark environments and flashing and flickering in dynamic video scenes.
By obtaining the original under-screen light sensing data, taking a screenshot to calculate the screen fit brightness value, and computing the transparency parameters based on the current brightness value of the screen and the maximum brightness level, calculating the under-screen light sensing correction data to avoid multiple fitting errors and improve accuracy.
It effectively reduces the error of under-screen light sense correction, improves the accuracy of under-screen light sense, and solves the problems of splashing screens and flickering lights and lights in dark or dynamic video scenes.
Smart Images

Figure CN119090975A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of display technology, and in particular to an under-screen light correction method, device, electronic device, storage medium and product. Background Art
[0002] Under-screen light sensing is to place a photosensitive element under the display screen, and calculate the interference of screen light on the device through the pulse width modulation (PWM) black frame algorithm to achieve real-time detection of external ambient light. However, the black frame algorithm does not eliminate the impact of screen leakage on the under-screen light sensing, resulting in inaccurate reported light sensing values, which is manifested in the screen being brighter in dark environments and the screen flickering in dynamic video scenes.
[0003] Currently, there are two solutions to correct the light sensitivity brightness. Solution 1 calculates the brightness gain of the screen; calculates the real-time actual brightness of the screen based on the brightness gain and the real-time system brightness of the screen; and calculates the under-screen light sensitivity brightness adjustment value based on the real-time system brightness of the screen, the real-time actual brightness of the screen, and the system maximum brightness of the screen to correct the light sensitivity brightness; Solution 2 first fits the contribution of each monochromatic light (red light, green light and blue light) to the light leakage through the screenshot algorithm, and then fits the cross-component of the multi-color light. Finally, the light leakage value is obtained by subtracting the contribution of the cross-component to the light leakage from the contribution of each monochromatic light to the light leakage, and the ambient light is further obtained by subtracting the screen leakage from the original light reported by the photosensitive device.
[0004] Each monochromatic light contributes differently to the brightness, but the simple addition of them in the above-mentioned solution 1 leads to excessive correction error; while the problem of large errors in multiple fittings exists in the solution 2. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a method, device, electronic device, storage medium and product for correcting light perception under the screen, which can reduce the correction error of light perception under the screen.
[0006] In order to achieve the above purpose, the technical solutions provided by the embodiments of the present application are as follows:
[0007] In a first aspect, the present application provides a method for under-screen light correction, including: obtaining original under-screen light data; taking a screenshot of the under-screen light area, and calculating the screen fitting brightness value based on the RGB value of the screenshot; obtaining the current brightness value of the screen and the corresponding maximum brightness level, and calculating the screen transparency parameter; calculating the under-screen light correction data based on the original under-screen light data, the screen fitting brightness value and the screen transparency parameter.
[0008] As an optional implementation of the embodiment of the present application, a screenshot of the light-sensitive area under the screen is taken, and the screen fitting brightness value is calculated based on the RGB value of the screenshot, including: obtaining a full-screen screenshot; based on the position coordinates of the light sensing area under the screen, cropping the full-screen screenshot to obtain a screenshot of the light-sensitive area under the screen; wherein the position coordinates of the light sensing area under the screen are pre-stored in a configuration file; and calculating the screen fitting brightness value based on the RGB value of the screenshot.
[0009] As an optional implementation of the embodiment of the present application, the screen fitting brightness value is calculated according to the RGB value of the screenshot, including: determining the RGB value of the screenshot of the light-sensitive area under the screen, and obtaining the screen fitting brightness value Y by linear fitting according to the following formula: Y=0.299R+0.587G+0.114B.
[0010] As an optional implementation method of the embodiment of the present application, the current brightness value of the screen and the corresponding maximum brightness level are obtained, and the screen transparency parameter is calculated, including: calculating the screen transparency parameter Alpha according to the current brightness value Bri of the screen and the corresponding maximum brightness level max_Bri according to the following formula: Alpha = (P1*Bri3+P2*2+P3) / max_Bri, wherein P1, P2, P3 are third-order, second-order and first-order coefficients respectively; Bri is the current brightness value of the screen; max_Bri is the maximum brightness level corresponding to the current brightness value of the screen.
[0011] As an optional implementation of the embodiment of the present application, the under-screen light correction data is calculated according to the original under-screen light perception data, the screen fitting brightness value and the screen transparency parameter, including: calculating the under-screen light correction data correct_lux according to the following formula: correct_lux = raw_lux-Y*Alpha, where raw_lux is the original under-screen light perception data.
[0012] As an optional implementation of the embodiment of the present application, after calculating the under-screen light correction data according to the original under-screen light correction data, the screen fitting brightness value and the screen transparency parameter, the method also includes: calculating the target screen brightness outlight according to the under-screen light correction data and the light calibration coefficient according to the following formula: outlight = correct_lux * cali_param, wherein cali_param is the light calibration coefficient.
[0013] As an optional implementation of the embodiment of the present application, a screenshot of the light-sensitive area under the screen is taken, and the screen fitting brightness value is calculated based on the RGB value of the screenshot, including: taking a screenshot of the light-sensitive area under the screen in a non-preset state; wherein the preset state may be any one of a screen-off state, a fingerprint unlocking state, or a low-light state; and calculating the screen fitting brightness value based on the RGB value of the screenshot.
[0014] In a second aspect, the present application provides an under-screen light perception correction device, the device comprising:
[0015] An acquisition module is used to obtain the original light sensing data under the screen;
[0016] The fitting module is used to take a screenshot of the light-sensitive area under the screen and calculate the screen fitting brightness value based on the RGB value of the screenshot;
[0017] A calculation module is used to obtain the current brightness value of the screen and the corresponding maximum brightness level, and calculate the screen transparency parameter;
[0018] The correction module is used to calculate the under-screen light correction data based on the original under-screen light data, the screen fitting brightness value and the screen transparency parameter.
[0019] As an optional implementation of the embodiment of the present application, the fitting module is specifically used to: obtain a full-screen screenshot; based on the position coordinates of the light sensor under the screen, crop the full-screen screenshot to obtain a screenshot of the light sensor area under the screen; wherein the position coordinates of the light sensor under the screen are pre-stored in the configuration file; and calculate the screen fitting brightness value according to the RGB value of the screenshot.
[0020] As an optional implementation of the embodiment of the present application, the fitting module is specifically used to: determine the RGB value of the screenshot of the light-sensitive area under the screen, and obtain the screen fitting brightness value Y by linear fitting according to the following formula: Y=0.299R+0.587G+0.114B.
[0021] As an optional implementation of the embodiment of the present application, the calculation module is specifically used to calculate the screen transparency parameter Alpha according to the current screen brightness value Bri and the corresponding maximum brightness level max_Bri according to the following formula: Alpha = (P1*ri 3 +P2*ri 2 +P3) / max_Bri, where P1, P2, P3 are third-order, second-order and first-order coefficients respectively; Bri is the current brightness value of the screen; max_Bri is the maximum brightness level corresponding to the current brightness value of the screen.
[0022] As an optional implementation of the embodiment of the present application, the correction module is specifically used to calculate the under-screen light correction data correct_lux according to the following formula: correct_lux = raw_lux-Y*Alpha, where raw_lux is the original under-screen light correction data.
[0023] As an optional implementation of the embodiment of the present application, the correction module is also used to calculate the target screen brightness outlight according to the under-screen light correction data and the light calibration coefficient according to the following formula: outlight = correct_lux * cali_param, wherein cali_param is the light calibration coefficient.
[0024] In a third aspect, the present application provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the under-screen light correction method as described in the first aspect or any one of its optional embodiments is implemented.
[0025] In a fourth aspect, the present application provides a computer-readable storage medium, comprising: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the under-screen light correction method as described in the first aspect or any one of its optional embodiments is implemented.
[0026] In a fifth aspect, the present application provides a computer program product, including: the computer program product includes a computer program, and when the computer program runs on a computer, the computer implements the under-screen light correction method as described in the first aspect or any one of its optional embodiments.
[0027] Compared with the prior art, the technical solution provided by the embodiments of the present application has the following advantages:
[0028] The disclosed embodiments provide a method, device, electronic device, storage medium and product for correcting light perception under the screen, wherein the method first obtains the original light perception data under the screen to be corrected; then takes a screenshot of the light perception area under the screen, and calculates the screen fitting brightness value according to the RGB value of the screenshot, and then obtains the current brightness value of the screen and the corresponding maximum brightness level, and calculates the screen transparency parameter; further, according to the original light perception data under the screen, the screen fitting brightness value and the screen transparency parameter, calculates the light perception correction data under the screen. In this way, the present application obtains the screen brightness by fitting the screenshot RGB value once, avoiding the error caused by multiple fittings; the screen transparency parameter is calculated by the current brightness value of the screen and the corresponding maximum brightness level, so that the light perception correction data under the screen finally calculated can truly reflect the ambient light, improve the accuracy of the light perception under the screen, and effectively solve the problem of screen flickering and flickering in dark light or dynamic video scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0030] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0031] Figure 1 A schematic diagram of a flow chart of an under-screen light perception correction method provided in an embodiment of the present application;
[0032] Figure 2 A schematic diagram of the structure of an under-screen light perception correction device provided in an embodiment of the present application;
[0033] Figure 3 A schematic diagram of the structure of an electronic device described in an embodiment of the present application. DETAILED DESCRIPTION
[0034] Currently, there are two solutions to correct the light sensitivity brightness. Solution 1 calculates the brightness gain of the screen; calculates the real-time actual brightness of the screen based on the brightness gain and the real-time system brightness of the screen; and calculates the under-screen light sensitivity brightness adjustment value based on the real-time system brightness of the screen, the real-time actual brightness of the screen, and the system maximum brightness of the screen to correct the light sensitivity brightness; Solution 2 first fits the contribution of each monochromatic light (red light, green light and blue light) to the light leakage through the screenshot algorithm, and then fits the cross-component of the multi-color light. Finally, the light leakage value is obtained by subtracting the contribution of the cross-component to the light leakage from the contribution of each monochromatic light to the light leakage, and the ambient light is further obtained by subtracting the screen leakage from the original light reported by the photosensitive device.
[0035] In the above scheme, each monochromatic light includes red light, green light and blue light; and the sum of the brightness gains of each monochromatic light is used as the brightness gain. In fact, each monochromatic light contributes differently to the brightness. It is wrong to simply add them together, which will inevitably result in a large error.
[0036] The screenshot algorithm in the above solution 2 first fits the contribution of each monochromatic light (red light, green light and blue light) to the light leakage, then fits the cross component of the multi-color light, and finally subtracts the contribution of the cross component to the light leakage from the contribution of each monochromatic light to the light leakage to obtain the light leakage value. Although there is no problem in principle, this process has been fitted many times (at least 4 times), which brings a large error. In addition, this solution can only obtain the contribution value of the light leakage, but not the light leakage value, so it is impossible to obtain the ambient light by subtracting the light leakage value from the original light.
[0037] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0038] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.
[0039] In order to solve some or all of the technical problems existing in the related art, the embodiments of the present application provide a method, device, electronic device, storage medium and product for correcting the light perception under the screen, wherein the method first obtains the original light perception data under the screen to be corrected; then takes a screenshot of the light perception area under the screen, and calculates the screen fitting brightness value according to the RGB value of the screenshot, and then obtains the current brightness value of the screen and the corresponding maximum brightness level, and calculates the screen transparency parameter; further, according to the original light perception data under the screen, the screen fitting brightness value and the screen transparency parameter, the light perception correction data under the screen is calculated. In this way, the present application obtains the screen brightness by fitting the screenshot RGB value once, avoiding the error caused by multiple fittings; the screen transparency parameter is calculated by the current brightness value of the screen and the corresponding maximum brightness level, so that the light perception correction data under the screen finally calculated can truly reflect the ambient light, improve the accuracy of the light perception under the screen, and effectively solve the problem of screen flickering and flickering in dark light or dynamic video scenes.
[0040] A method for correcting light perception under the screen provided in the embodiment of the present application can be implemented by an under-screen light perception correction device or an electronic device, and the electronic device includes but is not limited to a vehicle terminal, a server, a personal computer, a laptop computer, a tablet computer, a smart phone, etc. The operating system of the electronic device may include Android, a mobile operating system (iOS) developed by Apple, an operating system (Windows) developed by Microsoft Corporation of the United States, etc., and the embodiment of the present application is not limited to this. The electronic device can be run alone to implement the present application, or it can be connected to the network and implement the present application through interactive operations with other computer devices in the network. Among them, the network in which the electronic device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN) network, etc.
[0041] It should be noted that the protection scope of the under-screen light correction method of an embodiment of the present application is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0042] Figure 1 This is a flow chart of a method for correcting light perception under a screen according to an embodiment of the present application. The method can be performed by a device for correcting light perception under a screen, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method mainly includes the following steps S101 to S104:
[0043] S101, obtaining original under-screen light sensing data;
[0044] Screen light leakage will affect the sampling of the light sensing data under the screen, and the original light sensing data under the screen is inaccurate. In the embodiment of the present application, the original light sensing data under the screen can be recorded as raw_lux.
[0045] S102, taking a screenshot of the light-sensitive area under the screen, and calculating a screen fitting brightness value according to the RGB value of the screenshot;
[0046] In some embodiments, a screenshot is taken of the light-sensitive area under the screen in a non-preset state, wherein the preset state may be any one of a screen-off state, a fingerprint unlocking state, or a low-light state. Exemplarily, the low-light state refers to a screen brightness less than or equal to a preset brightness threshold, and the preset brightness threshold may be 31ux.
[0047] Specifically, first determine whether the screenshot conditions are met. If the device is currently in the screen-off state, fingerprint unlocking state or low-light state, it means that the screenshot conditions are not met and the light-sensitive area under the screen will not be screenshoted. If the device is not in any of the above states, it means that the screenshot conditions are met and a screenshot of the light-sensitive area under the screen needs to be taken.
[0048] In some embodiments, in the process of taking a screenshot of the light sensing area under the screen, a full-screen screenshot is obtained, and then based on the position coordinates of the light sensing under the screen, the full-screen screenshot with light sensing correction under the screen is cropped to obtain a screenshot of the light sensing area under the screen. The position coordinates of the light sensing under the screen are pre-stored in a configuration file.
[0049] In some embodiments, in the process of calculating the screen fitting brightness value according to the RGB value of the screenshot of the light sensing area under the screen, the RGB value of the screenshot of the light sensing area under the screen is determined, and the screen fitting brightness value is obtained by linear fitting according to the following formula (1):
[0050] Y=0.299R+0.587G+0.114B (1)
[0051] For example, assuming that the RGB value of the screenshot of the light-sensitive area under the screen is (215, 229, 244), the screen fitting brightness value Y is calculated according to the above formula (1):
[0052] Y=0.299*215+0.587*229+0.114*244=64.285+134.423+27.816=223.524lux.
[0053] Compared with the related art, the above embodiment accurately obtains the brightness value of the light-sensitive area of the screen through only one fitting, thereby reducing the error caused by fitting a single component multiple times.
[0054] S103, obtaining the current brightness value of the screen and the corresponding maximum brightness level, and calculating the screen transparency parameter;
[0055] Get the current brightness value of the screen and the corresponding maximum brightness level from the multimedia (multiMedia), the current brightness value of the screen is recorded as Bri, and the maximum brightness level corresponding to the current brightness value of the screen is recorded as max_Bri. The maximum brightness level is determined by the hardware parameters of the screen.
[0056] In some embodiments, the screen transparency parameter Alpha is calculated according to the following formula (2) based on the current screen brightness value Bri and the corresponding maximum brightness level max_Bri:
[0057] Alpha=(P1*ri 3 +P2*ri 2 +P3) / max_Bri (2)
[0058] Among them, P1, P2, and P3 are the third-order, second-order, and first-order coefficients respectively. P1, P2, and P3 are obtained by testing different screens in an experimental environment. For example, P1 = 0.000026, P2 = -0.0193, and P3 = 9.64.
[0059] For example, assuming that the current brightness value of the screen is Bri=800, the corresponding maximum brightness level max_Bri=3515; the screen transparency parameter Alpha=(13312-12352+9.64) / 3515=0.27586 is calculated according to the above formula (2).
[0060] S104, calculating the under-screen light correction data according to the original under-screen light data, the screen fitting brightness value and the screen transparency parameter.
[0061] In some embodiments, the under-screen light correction data correct_lux is calculated according to the following formula (3):
[0062] correct_lux=raw_lux-Y*Alpha (3)
[0063] In the process of executing step S104, the screen transparency Y*Alpha is first calculated based on the screen fitting brightness value Y and the screen transparency parameter Alpha. For example, using the previous example, the screen fitting brightness value Y=223.5241, the screen transparency parameter Alpha=0.27586, and the screen transparency Y*Alpha=61.66. Assuming that the original screen light perception data raw_lux=118, the screen light perception correction data correct_lux=118-61.66=56.34 is calculated according to the above formula (3).
[0064] In some embodiments, after step S104, the target screen brightness is calculated based on the off-screen light correction data and the light calibration coefficient, so as to adjust the screen brightness according to the target screen brightness. Optionally, the target screen brightness outlight is calculated according to the following formula (4):
[0065] outlight=correct_lux*cali_param (4)
[0066] Wherein, cali_param is a light calibration coefficient. The light calibration coefficient is obtained by debugging in different brightness ranges. For example, the light calibration coefficient cali_param=1.15.
[0067] Using the previous example, if the under-screen light correction data correct_lux = 56.34, the target screen brightness outlight = 56.34*1.15 = 64.79 is calculated according to the above formula (4).
[0068] In summary, the disclosed embodiment provides a method for correcting the light perception under the screen, which first obtains the original light perception data under the screen to be corrected; then takes a screenshot of the light perception area under the screen, and calculates the screen fitting brightness value based on the RGB value of the screenshot, and then obtains the current brightness value of the screen and the corresponding maximum brightness level, and calculates the screen transparency parameter; further, according to the original light perception data under the screen, the screen fitting brightness value and the screen transparency parameter, the light perception correction data under the screen is calculated. In this way, the present application obtains the screen brightness by fitting the screenshot RGB value once, avoiding the error caused by multiple fittings; the screen transparency parameter is calculated by the current brightness value of the screen and the corresponding maximum brightness level, so that the light perception correction data under the screen finally calculated can truly reflect the ambient light, improve the accuracy of the light perception under the screen, and effectively solve the problem of screen flickering and flickering in dark light or dynamic video scenes.
[0069] like Figure 2 As shown, Figure 2 An under-screen light perception correction device provided in an embodiment of the present application includes:
[0070] An acquisition module 201 is used to acquire original under-screen light sensing data;
[0071] A fitting module 202 is used to take a screenshot of the light-sensitive area under the screen and calculate a screen fitting brightness value according to the RGB value of the screenshot;
[0072] The calculation module 203 is used to obtain the current brightness value of the screen and the corresponding maximum brightness level, and calculate the screen transparency parameter;
[0073] The correction module 204 is used to calculate the under-screen light perception correction data according to the original under-screen light perception data, the screen fitting brightness value and the screen transparency parameter.
[0074] As an optional implementation of the embodiment of the present application, the fitting module 202 is specifically used to: obtain a full-screen screenshot; based on the position coordinates of the light sensor under the screen, crop the full-screen screenshot to obtain a screenshot of the light sensor area under the screen; wherein the position coordinates of the light sensor under the screen are pre-stored in the configuration file; and calculate the screen fitting brightness value according to the RGB value of the screenshot.
[0075] As an optional implementation of the embodiment of the present application, the fitting module 202 is specifically used to: determine the RGB value of the screenshot of the light-sensitive area under the screen, and obtain the screen fitting brightness value Y by linear fitting according to the following formula: Y=0.299R+0.587G+0.114B.
[0076] As an optional implementation of the embodiment of the present application, the calculation module 203 is specifically used to calculate the screen transparency parameter Alpha according to the current screen brightness value Bri and the corresponding maximum brightness level max_Bri according to the following formula: Alpha = (P1*ri 3 +P2*ri 2 +P3) / max_Bri, where P1, P2, P3 are third-order, second-order and first-order coefficients respectively; Bri is the current brightness value of the screen; max_Bri is the maximum brightness level corresponding to the current brightness value of the screen.
[0077] As an optional implementation of the embodiment of the present application, the correction module 204 is specifically used to calculate the under-screen light correction data correct_lux according to the following formula: correct_lux=raw_lux-Y*Alpha, where raw_lux is the original under-screen light correction data.
[0078] As an optional implementation of the embodiment of the present application, the correction module 204 is also used to calculate the target screen brightness outlight according to the under-screen light correction data and the light calibration coefficient according to the following formula: outlight = correct_lux*cali_param, where cali_param is the light calibration coefficient.
[0079] In summary, the present application provides an under-screen light correction device, which first obtains the original under-screen light data to be corrected; then takes a screenshot of the under-screen light area, and calculates the screen fitting brightness value based on the RGB value of the screenshot, and then obtains the current screen brightness value and the corresponding maximum brightness level, and calculates the screen transparency parameter; further, according to the original under-screen light data, the screen fitting brightness value and the screen transparency parameter, the under-screen light correction data is calculated. In this way, the present application obtains the screen brightness by fitting the screenshot RGB value once, avoiding the error caused by multiple fittings; the screen transparency parameter is calculated by the current screen brightness value and the corresponding maximum brightness level, so that the under-screen light correction data finally calculated can truly reflect the ambient light, improve the accuracy of the under-screen light perception, and effectively solve the problem of screen flickering and flickering in dark light or dynamic video scenes.
[0080] For the specific definition of the under-screen light correction device, please refer to the definition of the under-screen light correction method above, which will not be repeated here. Each module in the above-mentioned under-screen light correction device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0081] In one embodiment, the present application provides an electronic device, which may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown. The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected by a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, an operator network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for detecting a jam is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball or a touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0082] Those skilled in the art will understand that Figure 3The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0083] In one embodiment, the under-screen light perception correction device provided by the present application can be implemented in the form of a computer program. The computer program can be Figure 3 The memory of the electronic device may store various program modules constituting the under-screen light correction device, for example, Figure 2 The acquisition module 201, the fitting module 202, the calculation module 203 and the correction module 204 are shown. The computer program composed of various program modules enables the processor to execute the steps of the under-screen light perception correction method of each embodiment of the present application described in this specification.
[0084] For example, Figure 3 The electronic device shown can be Figure 2 The acquisition module 201 in the under-screen light correction device shown is executed to obtain the original under-screen light data; the electronic device can use the fitting module 202 to take a screenshot of the under-screen light area, and calculate the screen fitting brightness value according to the RGB value of the screenshot; the electronic device can use the calculation module 203 to obtain the current brightness value of the screen and the corresponding maximum brightness level, and calculate the screen transparency parameter; the electronic device can use the correction module 204 to calculate the under-screen light correction data according to the original under-screen light data, the screen fitting brightness value and the screen transparency parameter.
[0085] In one embodiment, the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0086] Obtain the original under-screen light data; take a screenshot of the under-screen light area and calculate the screen fitting brightness value based on the RGB value of the screenshot; obtain the current screen brightness value and the corresponding maximum brightness level, and calculate the screen transparency parameter; calculate the under-screen light correction data based on the original under-screen light data, the screen fitting brightness value and the screen transparency parameter.
[0087] In one embodiment, the processor also implements the following steps when executing the computer program: As an optional implementation of the embodiment of the present application, a screenshot of the light-sensitive area under the screen is taken, and the screen fitting brightness value is calculated based on the RGB value of the screenshot, including: obtaining a full-screen screenshot; based on the position coordinates of the light sensing area under the screen, cropping the full-screen screenshot to obtain a screenshot of the light-sensitive area under the screen; wherein the position coordinates of the light sensing area under the screen are pre-stored in the configuration file; and calculating the screen fitting brightness value based on the RGB value of the screenshot.
[0088] In one embodiment, when the processor executes the computer program, the following steps are also implemented: calculating the screen fitting brightness value according to the RGB value of the screenshot, including: determining the RGB value of the screenshot of the light-sensitive area under the screen, and obtaining the screen fitting brightness value Y by linear fitting according to the following formula: Y=0.299R+0.587G+0.114B.
[0089] In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtaining the current brightness value of the screen and the corresponding maximum brightness level, and calculating the screen transparency parameter, including: calculating the screen transparency parameter Alpha according to the current brightness value Bri of the screen and the corresponding maximum brightness level max_Bri according to the following formula: Alpha = (P1*ri 3 +P2*ri 2 +P3) / max_Bri, where P1, P2, P3 are third-order, second-order and first-order coefficients respectively; Bri is the current brightness value of the screen; max_Bri is the maximum brightness level corresponding to the current brightness value of the screen.
[0090] In one embodiment, when the processor executes the computer program, it also implements the following steps: calculating the under-screen light correction data based on the original under-screen light data, the screen fitting brightness value and the screen transparency parameter, including: calculating the under-screen light correction data correct_lux according to the following formula: correct_lux = raw_lux - Y*Alpha, where raw_lux is the original under-screen light data.
[0091] In one embodiment, the processor also implements the following steps when executing the computer program: after calculating the under-screen light correction data based on the original under-screen light correction data, the screen fitting brightness value and the screen transparency parameter, the method also includes: calculating the target screen brightness outlight according to the under-screen light correction data and the light calibration coefficient according to the following formula: outlight = correct_lux*cali_param, wherein cali_param is the light calibration coefficient.
[0092] In one embodiment, when the processor executes the computer program, the following steps are also implemented: taking a screenshot of the light-sensitive area under the screen, and calculating the screen fitting brightness value based on the RGB value of the screenshot, including: taking a screenshot of the light-sensitive area under the screen in a non-preset state; wherein the preset state can be any one of the screen off state, fingerprint unlocking state or low-light state; calculating the screen fitting brightness value based on the RGB value of the screenshot.
[0093] When the processor in the electronic device provided by the present application executes the computer program, it first obtains the original under-screen light sensing data to be corrected; then takes a screenshot of the under-screen light sensing area, and calculates the screen fitting brightness value based on the RGB value of the screenshot, and then obtains the current screen brightness value and the corresponding maximum brightness level, and calculates the screen transparency parameter; further, according to the original under-screen light sensing data, the screen fitting brightness value and the screen transparency parameter, the under-screen light sensing correction data is calculated. In this way, the present application obtains the screen brightness by fitting the screenshot RGB value once, avoiding the error caused by multiple fittings; the screen transparency parameter is calculated by the current screen brightness value and the corresponding maximum brightness level, so that the under-screen light sensing correction data finally calculated can truly reflect the ambient light, improve the accuracy of the under-screen light sensing, and effectively solve the problem of screen flickering and flickering in dark light or dynamic video scenes.
[0094] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by the computer program, the following steps are implemented:
[0095] Obtain the original under-screen light data; take a screenshot of the under-screen light area and calculate the screen fitting brightness value based on the RGB value of the screenshot; obtain the current screen brightness value and the corresponding maximum brightness level, and calculate the screen transparency parameter; calculate the under-screen light correction data based on the original under-screen light data, the screen fitting brightness value and the screen transparency parameter.
[0096] In one embodiment, the computer program also implements the following steps when executing the computer program: as an optional implementation of the embodiment of the present application, a screenshot of the light-sensitive area under the screen is taken, and the screen fitting brightness value is calculated based on the RGB value of the screenshot, including: obtaining a full-screen screenshot; based on the position coordinates of the light sensing area under the screen, cropping the full-screen screenshot to obtain a screenshot of the light-sensitive area under the screen; wherein the position coordinates of the light sensing area under the screen are pre-stored in the configuration file; and calculating the screen fitting brightness value based on the RGB value of the screenshot.
[0097] In one embodiment, when the computer program executes the computer program, the following steps are also implemented: calculating the screen fitting brightness value according to the RGB value of the screenshot, including: determining the RGB value of the screenshot of the light-sensitive area under the screen, and obtaining the screen fitting brightness value Y by linear fitting according to the following formula: Y=0.299R+0.587G+0.114B.
[0098] In one embodiment, when the computer program executes the computer program, the following steps are also implemented: obtaining the current brightness value of the screen and the corresponding maximum brightness level, and calculating the screen transparency parameter, including: calculating the screen transparency parameter Alpha according to the current brightness value Bri of the screen and the corresponding maximum brightness level max_Bri according to the following formula: Alpha = (P1*ri 3 +P2*ri2 +P3) / max_Bri, where P1, P2, P3 are third-order, second-order and first-order coefficients respectively; Bri is the current brightness value of the screen; max_Bri is the maximum brightness level corresponding to the current brightness value of the screen.
[0099] In one embodiment, when the computer program executes the computer program, the following steps are also implemented: calculating the under-screen light correction data based on the original under-screen light perception data, the screen fitting brightness value and the screen transparency parameter, including: calculating the under-screen light perception correction data correct_lux according to the following formula: correct_lux = raw_lux - Y*Alpha, where raw_lux is the original under-screen light perception data.
[0100] In one embodiment, when the computer program executes the computer program, the following steps are also implemented: after calculating the under-screen light correction data according to the original under-screen light correction data, the screen fitting brightness value and the screen transparency parameter, the method also includes: calculating the target screen brightness outlight according to the under-screen light correction data and the light calibration coefficient according to the following formula: outlight = correct_lux*cali_param, wherein cali_param is the light calibration coefficient.
[0101] In one embodiment, when the computer program executes the computer program, the following steps are also implemented: taking a screenshot of the light-sensitive area under the screen, and calculating the screen fitting brightness value based on the RGB value of the screenshot, including: taking a screenshot of the light-sensitive area under the screen in a non-preset state; wherein the preset state can be any one of the screen off state, fingerprint unlocking state or low-light state; calculating the screen fitting brightness value based on the RGB value of the screenshot.
[0102] When the computer program in the computer-readable storage medium provided by the present application executes the computer program, the original under-screen light sensing data to be corrected is first obtained; then a screenshot of the under-screen light sensing area is taken, and the screen fitting brightness value is calculated based on the RGB value of the screenshot, and then the current screen brightness value and the corresponding maximum brightness level are obtained to calculate the screen transparency parameter; further, the under-screen light sensing correction data is calculated based on the original under-screen light sensing data, the screen fitting brightness value and the screen transparency parameter. In this way, the present application obtains the screen brightness by fitting the screenshot RGB value once, avoiding the error caused by multiple fittings; the screen transparency parameter is calculated by the current screen brightness value and the corresponding maximum brightness level, so that the under-screen light sensing correction data finally calculated can truly reflect the ambient light, improve the accuracy of the under-screen light sensing, and effectively solve the problem of screen flickering and flickering in dark light or dynamic video scenes.
[0103] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media that include computer-usable program code.
[0104] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0105] In the present application, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0106] In this application, memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0107] In this application, computer-readable media includes permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, and the information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0108] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0109] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for correcting light perception under a screen, characterized in that: include: Get the original light sensing data under the screen; Take a screenshot of the light-sensitive area under the screen, and calculate the screen fitting brightness value based on the RGB value of the screenshot; Get the current brightness value of the screen and the corresponding maximum brightness level, and calculate the screen transparency parameter; The under-screen light correction data is calculated according to the original under-screen light perception data, the screen fitting brightness value and the screen transparency parameter.
2. The method according to claim 1, characterized in that The method of taking a screenshot of the light-sensing area under the screen and calculating the screen fitting brightness value according to the RGB value of the screenshot includes: Get full screen screenshot; Based on the position coordinates of the light sensor under the screen, the full-screen screenshot is cropped to obtain a screenshot of the light sensor area under the screen; wherein the position coordinates of the light sensor under the screen are pre-stored in the configuration file; Calculate the screen fitting brightness value based on the RGB value of the screenshot.
3. The method according to any one of claims 1-2, characterized in that: The step of calculating the screen fitting brightness value according to the RGB value of the screenshot includes: Determine the RGB value of the screenshot of the light-sensitive area under the screen, and obtain the screen fitting brightness value according to the following formula: Y=0.299R+0.587G+0.114B.
4. The method according to claim 3, characterized in that The obtaining of the current brightness value of the screen and the corresponding maximum brightness level and the calculation of the screen transparency parameter include: The screen transparency parameter Alpha is calculated according to the current screen brightness value Bri and the corresponding maximum brightness level max_Bri according to the following formula: Alpha=(P1*ri 3 +P2*ri 2 +P3) / max_Bri Among them, P1, P2, P3 are the third-order, second-order and first-order coefficients respectively; Bri is the current brightness value of the screen; max_Bri is the maximum brightness level corresponding to the current brightness value of the screen.
5. The method according to claim 4, characterized in that The calculating the under-screen light perception correction data according to the original under-screen light perception data, the screen fitting brightness value and the screen transparency parameter includes: Calculate the under-screen light correction data correct_lux according to the following formula: correct_lux=raw_lux-Y*Alpha Among them, raw_lux is the original off-screen light data.
6. The method according to claim 5, characterized in that After calculating the under-screen light perception correction data according to the original under-screen light perception data, the screen fitting brightness value and the screen transparency parameter, the method further includes: According to the under-screen light correction data and the light calibration coefficient, the target screen brightness outlight is calculated according to the following formula: outlight=correct_lux*cali_param Among them, cali_param is the light sensitivity calibration coefficient.
7. An under-screen light perception correction device, characterized in that: include: An acquisition module is used to obtain the original light sensing data under the screen; The fitting module is used to take a screenshot of the light-sensitive area under the screen and calculate the screen fitting brightness value based on the RGB value of the screenshot; A calculation module is used to obtain the current brightness value of the screen and the corresponding maximum brightness level, and calculate the screen transparency parameter; A correction module is used to calculate the under-screen light perception correction data according to the original under-screen light perception data, the screen fitting brightness value and the screen transparency parameter.
8. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the under-screen light correction method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the under-screen light perception correction method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that include: The computer program product includes a computer program, and when the computer program is run on a computer, the computer is enabled to implement the under-screen light perception correction method as described in any one of claims 1 to 6.
