Screen light leakage and ambient light detection method, device and electronic equipment

The light leakage intensity of screens is detected by clustering and weighted summing, which solves the problem of time-consuming and high power consumption in the prior art, and realizes efficient light leakage detection to meet the application needs of electronic equipment.

CN114894443BActive Publication Date: 2024-11-29GUANGXI DAYUAN LIQUID CRYSTAL DISPLAY DEVICE CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202210498668.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-09
Publication Date
2024-11-29
Estimated Expiration
2042-05-09

AI Technical Summary

Technical Problem

The prior art consumes a long time and consumes a lot of power when detecting the light leakage in the screen, making it difficult to meet the application needs of the entire electronic device.

Method used

By obtaining the brightness value of the screen and the grayscale value of each pixel in the preset display area, clustering each pixel based on the preset multiple grayscale value intervals, obtaining a set of multiple pixel points, and according to the brightness value and After the fusion of each pixel set, the light leakage value is calculated, and the light leakage value of the screen is obtained. This method calculates the light leakage value by weighted sum of the pixel point set, reducing the number of calculations and reducing power consumption and time overhead.

Benefits of technology

It significantly reduces the power consumption and time overhead when detecting light leakage on the screen, meets the application needs of the entire electronic device, and improves the detection speed and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114894443B_ABST
    Figure CN114894443B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device, electronic device and computer storage medium for detecting screen light leakage and ambient light. The method includes: obtaining the brightness value of the screen and the grayscale value of each pixel in the preset display area of ​​the screen; clustering each pixel based on multiple preset grayscale value intervals and the grayscale value of each pixel to obtain multiple pixel sets; obtaining the light leakage value corresponding to each pixel set according to the brightness value and the fused grayscale value corresponding to each pixel set, wherein the fused grayscale value is obtained by fusion of the grayscale values ​​of the pixels in the corresponding pixel set; obtaining the light leakage value of the screen based on the light leakage value corresponding to each pixel set. Based on the above scheme, since the light leakage value calculation is performed once for each pixel set, the total number of calculations can be greatly reduced, thereby greatly reducing the power consumption and time overhead when detecting screen light leakage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of terminal detection technology, and in particular to a method, device, electronic device and computer storage medium for detecting screen light leakage and ambient light. Background Art

[0002] In order to meet the trend of large screens in electronic devices such as mobile phones, components such as ambient light sensors (ALS) are built into the bottom of the screen of electronic devices. ALS is used to detect the ambient light intensity. Electronic devices can adjust the brightness of the screen according to the ambient light intensity detected by ALS, so that the brightness of the screen meets the visual perception of the human eye. In addition, electronic devices can also integrate color temperature according to the ambient light intensity detected by ALS to assist display and photography.

[0003] Since the ALS is set under the screen, it is easily interfered by the light leakage under the screen caused by the screen's own light when detecting ambient light. The actual ambient light intensity needs to be obtained by subtracting the leakage light intensity from the ambient light intensity detected by the ALS. Therefore, the key point of detecting ambient light intensity lies in how to detect the leakage light intensity.

[0004] In the related art, some technical solutions for calculating the light leakage intensity are mentioned. However, in some actual application scenarios of ALS, using these technical solutions to detect the light leakage intensity of the screen may be time-consuming and power-intensive, and it is difficult to meet the application requirements of the entire electronic device. Summary of the invention

[0005] In view of this, embodiments of the present application provide a method, device, electronic device and computer storage medium for detecting screen light leakage and ambient light, so as to at least partially solve the above problems.

[0006] According to a first aspect of an embodiment of the present application, a method for detecting screen light leakage is provided, which includes: obtaining a brightness value of a screen and a grayscale value of each pixel in a preset display area of ​​the screen; clustering each pixel based on a plurality of preset grayscale value intervals and the grayscale value of each pixel to obtain a plurality of pixel sets, wherein the grayscale values ​​of the pixels in the same pixel set are in the same grayscale value interval; obtaining a light leakage value corresponding to each pixel set according to the brightness value and the fused grayscale value corresponding to each pixel set, wherein the fused grayscale value is obtained by fusion of the grayscale values ​​of each pixel in the corresponding pixel set; obtaining the light leakage value of the screen based on the light leakage value corresponding to each pixel set.

[0007] In an optional implementation, obtaining the light leakage value of the screen based on the light leakage value corresponding to each pixel point set includes:

[0008] Get the light leakage weight value corresponding to each pixel set;

[0009] A weighted sum is performed based on the light leakage weight value corresponding to each pixel point set and the light leakage value corresponding to each pixel point set to obtain the light leakage value of the screen.

[0010] In an optional implementation, obtaining the light leakage weight value corresponding to each pixel point set includes:

[0011] Obtaining a light leakage weight value corresponding to each pixel in each pixel set, wherein the light leakage weight value corresponding to each pixel depends on a relative position of each pixel and a light sensor disposed below the screen;

[0012] For each pixel point set, the light leakage weight value corresponding to each pixel point in the pixel point set is fused to obtain the light leakage weight value corresponding to the pixel point set.

[0013] In an optional implementation, obtaining the light leakage weight value corresponding to each pixel point set includes:

[0014] The light leakage weight value corresponding to each pixel set is calculated by the following formula:

[0015]

[0016] Among them, weight is the light leakage weight value corresponding to the pixel point set, Wi is the light leakage weight value of the block where the i-th pixel point of the pixel point set is located, N is the number of pixels contained in each block, and n is the number of pixels contained in the pixel point set.

[0017] In an optional implementation, obtaining the light leakage value corresponding to each pixel point set according to the brightness value and the fused grayscale value corresponding to each pixel point set includes:

[0018] Obtaining the corresponding relationship between the preset grayscale value, brightness value and light leakage value;

[0019] Based on the corresponding relationship, the light leakage value corresponding to each pixel point set is obtained according to the brightness value and the fused grayscale value corresponding to each pixel point set.

[0020] In an optional implementation, obtaining the light leakage value corresponding to each pixel point set according to the brightness value and the fused grayscale value corresponding to each pixel point set includes:

[0021] The brightness value and the fused grayscale value corresponding to each pixel point set are input into a neural network model, and the neural network model is used to process the brightness value and the fused grayscale value corresponding to each pixel point set to obtain a light leakage value corresponding to each pixel point set.

[0022] In an optional embodiment, the neural network model includes a residual module, the residual module includes multiple fully connected units, the multiple fully connected units are connected in series in sequence, and there are jump connections between the multiple fully connected units, and the jump connection includes a connection between two non-adjacent fully connected units.

[0023] In an optional implementation, the jump connection is a jump connection between a first fully-connected unit and a last fully-connected unit among the multiple fully-connected units.

[0024] In an optional embodiment, the number of the residual modules is multiple, and the neural network model also includes a first fully-connected module and a second fully-connected module. The multiple residual modules are cascade-connected and located between the first fully-connected module and the second fully-connected module.

[0025] In an optional implementation, the preset display area is a light detection area of ​​the screen, and the light detection area corresponds to a position of a light sensor disposed below the screen.

[0026] In an optional implementation, clustering each pixel based on a plurality of preset grayscale value intervals and the grayscale value of each pixel to obtain a plurality of pixel sets includes:

[0027] Obtaining a preset mapping relationship between a grayscale value interval and a pixel point set;

[0028] Based on the preset mapping relationship, each pixel is divided into the plurality of pixel sets according to the grayscale value of each pixel.

[0029] According to a second aspect of an embodiment of the present application, a method for detecting ambient light is provided, which includes the screen light leakage detection method as described in the first aspect, determining the light leakage value of the screen; obtaining the light sensitivity value detected by the light sensor arranged under the screen; and determining the ambient light value based on the light sensitivity value and the light leakage value.

[0030] According to a third aspect of an embodiment of the present application, a device for detecting light leakage from a screen is provided, comprising:

[0031] An acquisition module, used to acquire the brightness value of the screen and the grayscale value of each pixel in a preset display area of ​​the screen;

[0032] A clustering module, used for clustering each pixel based on a plurality of preset grayscale value intervals and the grayscale value of each pixel to obtain a plurality of pixel sets, wherein the pixels whose grayscale values ​​are in the same grayscale value interval are clustered into the same pixel set;

[0033] A light leakage calculation module, used to obtain a light leakage value corresponding to each pixel point set according to the brightness value and the fused grayscale value corresponding to each pixel point set, wherein each fused grayscale value is obtained by fusion of the grayscale values ​​of the pixels in the corresponding pixel point set;

[0034] The determination module is used to obtain the light leakage value of the screen based on the light leakage value corresponding to each pixel point set.

[0035] According to a fourth aspect of an embodiment of the present application, there is provided an ambient light detection device, comprising:

[0036] A screen light leakage detection device, used to determine the light leakage value of the screen, wherein the screen light leakage detection device is the screen light leakage detection device as described in the third aspect;

[0037] An acquisition module, used to acquire a light sensitivity value detected by a light sensor arranged below the screen;

[0038] The ambient light calculation module is used to determine the real ambient light value according to the light sensitivity value and the light leakage value.

[0039] According to the fifth aspect of the embodiments of the present application, an electronic device is provided, comprising: at least one processor, a memory, a bus and a communication interface, wherein the processor stores a program, the processor, the communication interface and the memory communicate with each other through the communication bus, the communication interface is used to communicate with other devices or components, and the processor executes the program.

[0040] According to the sixth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for detecting screen light leakage as described in the first aspect is implemented, or the method for detecting ambient light as described in the second aspect is implemented.

[0041] In the embodiment of the present application, by obtaining the brightness value of the screen and the grayscale value of each pixel in the preset display area of ​​the screen, clustering each pixel based on a plurality of preset grayscale value intervals, obtaining a plurality of pixel sets, and obtaining the light leakage value corresponding to each pixel set based on the brightness value and the fused grayscale value corresponding to each pixel set, and then obtaining the light leakage value of the screen based on the light leakage value corresponding to each pixel set. Since the grayscale values ​​of the pixels in the same pixel set are in the same grayscale value interval (that is, the pixels whose grayscale values ​​are in the same grayscale value interval are clustered into the same pixel set), performing a light leakage value calculation for each pixel set can greatly reduce the total number of calculations, thereby greatly reducing the power consumption and time overhead when detecting screen light leakage, and meeting the application requirements of the entire electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] 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, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0043] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0044] Figure 2 A schematic diagram of a flow chart of a method for detecting screen light leakage provided in an embodiment of the present application;

[0045] Figure 3 A schematic flow chart of another method for detecting screen light leakage provided in an embodiment of the present application;

[0046] Figure 4 A schematic diagram of pixel clustering provided in an embodiment of the present application;

[0047] Figure 5 A schematic diagram of a flow chart of a method for detecting ambient light provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of the structure of a screen light leakage detection device provided in an embodiment of the present application;

[0049] Figure 7 A schematic diagram of the structure of an ambient light detection device provided in an embodiment of the present application;

[0050] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.

[0052] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.

[0053] The screen light leakage detection method provided in the embodiment of the present application is applicable to electronic devices with a light sensor disposed under the screen. Figure 1In order to meet the trend of large screens of electronic devices such as mobile phones and to maintain a simple appearance and integrated industrial design, the light sensor 102 is installed below the screen 101 of the electronic device, more specifically, below the light detection area on the screen 101, to detect the ambient light intensity. In one implementation, the light sensor 102 can output the light sensitivity values ​​of the five sensing channels of RGBCW, and the ambient light intensity can be obtained by converting the light sensitivity values ​​of the five channels through a specific algorithm.

[0054] A processor is provided on the main board of the electronic device, and the processor can adjust the brightness of the screen 101 according to the ambient light intensity detected by the light sensor 102, so that the brightness of the screen 101 meets the visual perception of the human eye. The processor can also integrate the color temperature according to the ambient light intensity detected by the light sensor 102 to assist display and photography.

[0055] However, liquid crystal displays and organic light-emitting diodes (OLEDs), which are screens of commonly used electronic devices, have screen leakage. Screen leakage refers to the light emitted by the screen itself being emitted from the back of the screen 101. The back of the screen 101 is opposite to the front of the screen 101, and the front of the screen 101 refers to the side that can be directly observed. Since the light sensor 102 is arranged below the screen 101, the light sensor 102 is susceptible to interference from screen leakage when detecting ambient light. That is, the light intensity detected by the light sensor 102 includes not only the real ambient light intensity, but also the screen leakage light intensity. The screen leakage light intensity needs to be subtracted from the light intensity detected by the light sensor 102 to obtain the real ambient light intensity.

[0056] Therefore, the key point for the light sensor 102 to correctly detect the ambient light intensity is how to accurately calculate the screen leakage intensity. Screen leakage is related to many factors. The inventors analyzed a large amount of experimental data to seek factors associated with screen leakage, and finally found that screen leakage is related to the grayscale value of each pixel in the screen 101, the brightness value of the screen 101, the refresh rate of the screen 101, the display mode of the screen 101 and other screen display parameters, and there is a relatively stable relationship between screen leakage and these screen display parameters. In the related art, it is mentioned that at least a part of the content displayed on the screen is captured, and the relationship between the grayscale value of each pixel in the screenshot area and the screen leakage is used to detect the screen leakage value. When the display content on the screen is a pure color image, the grayscale value of each pixel in the screenshot area is the same, and only a few calculations are required to obtain the screen leakage value. However, in the actual application scenario of the light sensor, the screen 101 of the electronic device may display a picture or video. At this time, it is necessary to traverse each pixel in the entire screenshot area and calculate the light leakage value for each pixel separately. However, the light leakage value of the screen is obtained by weighted summing the light leakage value corresponding to each pixel and the weighting coefficient corresponding to each pixel. Since the weight of a single pixel may not achieve the same accuracy when calculating light leakage according to a single pixel, this light leakage detection method has the problem of too fine calculation granularity. In addition, when an electronic device uses this light leakage detection method to calculate light leakage, it will take too long and consume too much power, which makes it difficult to meet the application requirements of the entire electronic device.

[0057] To this end, an embodiment of the present application provides a method for detecting screen light leakage, which obtains the brightness value of the screen and the grayscale value of each pixel in the preset display area of ​​the screen, clusters each pixel based on the preset multiple grayscale value intervals and the grayscale value of each pixel, obtains multiple pixel sets, and obtains the light leakage value corresponding to each pixel set according to the brightness value and the fused grayscale value corresponding to each pixel set, and then obtains the light leakage value of the screen based on the light leakage value corresponding to each pixel set. In this scheme, since the grayscale values ​​of the pixels in the same pixel set are in the same grayscale value interval (that is, the pixels with grayscale values ​​in the same grayscale value interval are clustered into the same pixel set), a light leakage value calculation is performed for each pixel set, which can greatly reduce the number of calculations compared to the related art in which a light leakage value calculation is performed for each pixel, thereby greatly reducing the power consumption and time overhead of the electronic device when detecting screen light leakage, and meeting the application requirements of the entire electronic device.

[0058] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.

[0059] Reference Figure 2 , Figure 2A schematic diagram of a method for detecting screen light leakage provided in an embodiment of the present application is shown in FIG. Figure 1 The electronic device shown is executed. Screen light leakage refers to the light emitted by the screen itself from the back of the screen. Figure 2 As shown, the method includes:

[0060] S201, obtaining a brightness value of a screen and a grayscale value of each pixel in a preset display area of ​​the screen.

[0061] The brightness value of the screen refers to the brightness value of the content displayed on the screen. In specific implementation, the electronic device can read the brightness value of the screen from the operating system of the electronic device through a corresponding interface.

[0062] The grayscale value of each pixel in the preset display area of ​​the screen refers to the grayscale value of each pixel of the content displayed in the preset display area. When the displayed content is a multi-channel image, the grayscale value of each pixel may include the grayscale value of each color component of each pixel. Taking the displayed content as an RGB image as an example, the grayscale value of each pixel may include the grayscale value of the red channel R, the grayscale value of the green channel G, and the grayscale value of the blue channel B of each pixel. In specific implementation, the electronic device can use screenshot software to capture the displayed content in the preset display area on the screen to obtain the grayscale value of each pixel in the preset display area.

[0063] In this embodiment, the selection of the preset display area is related to the position of the light sensor set below the screen. Generally, the light signal received at the center of the light sensor is the strongest, and its contribution to screen light leakage is the largest; the further away from the center of the light sensor, the weaker the light signal received by the light sensor, and the smaller its contribution to screen light leakage.

[0064] In one implementation of the present application, the preset display area is the light detection area of ​​the light sensor set below the screen. The light detection area of ​​the light sensor is the screen area above the light sensor. By selecting the screen area above the light sensor as the preset display area, the grayscale value of each pixel in the area on the screen that contributes more to light leakage can be fully utilized to determine the light leakage value of the screen, and then in the subsequent process, the light leakage value of the screen can be determined more accurately while reducing the amount of calculation.

[0065] It should be understood that in this embodiment, the preset display area may also be other areas on the screen including at least a portion of the light detection area above the light sensor, and the embodiment of the present application is not limited to this.

[0066] S202 : clustering each pixel based on a plurality of preset gray value intervals and the gray value of each pixel to obtain a plurality of pixel sets.

[0067] The grayscale values ​​of the pixels in the same pixel set are in the same grayscale value interval. The same grayscale value interval can also be called the same color level, and accordingly, the pixel set corresponding to the same grayscale value interval can be called the same color block.

[0068] The preset multiple grayscale value intervals can be obtained by dividing in the following manner: the grayscale value range of the pixel point can be divided into P segments according to the preset step size, and P grayscale value intervals (hereinafter also referred to as P color levels) are obtained, where P is an integer and P≥2. Taking the grayscale value range of the pixel point as [0,255] and the preset step size as 32 as an example, the grayscale value range can be divided into 8 segments [0,31], [32,63], ..., [224,255], that is, 8 grayscale value intervals are obtained. When the content displayed on the screen is a multi-channel image, taking an RGB image as an example, for example, the grayscale value range [0,255] of the red channel R, the green channel G and the blue channel B can be divided into 8 segments according to the preset step size 32, thereby dividing the grayscale value range of the RGB image into 8*8*8 grayscale value intervals, that is, the total number of color combinations of the RGB image is compressed from 255*255*255 to 8*8*8.

[0069] It should be understood that the above-mentioned gray value intervals can also be determined by other rules, and this embodiment does not limit this. In addition, it should be understood that the number of gray value intervals obtained by the above division is only an example. In other embodiments, the gray value range can be divided into more or fewer gray value intervals as needed. The fewer the number of gray value intervals obtained by division, the fewer the number of pixel point sets obtained when clustering each pixel point based on the preset multiple gray value intervals, and the less time it takes to calculate the light leakage value in units of pixel point sets in the subsequent calculation, that is, time expenditure can be saved to a greater extent, but the accuracy of light leakage detection may be reduced. On the contrary, the more the number of gray value intervals obtained by division, the more time it takes to calculate the light leakage value in units of pixel point sets in the subsequent calculation, which is not conducive to saving time expenditure, but the accuracy of light leakage detection may be improved. Therefore, the number of divisions of the gray value range can be determined based on the trade-off between the detection speed and detection accuracy of light leakage detection.

[0070] After the grayscale value intervals are obtained through division, the grayscale value intervals may be stored in a memory inside or outside the electronic device, so as to be used when clustering the pixels based on the grayscale value intervals.

[0071] In this embodiment, any suitable clustering algorithm may be used to cluster the pixels whose grayscale values ​​are in the same grayscale value interval into a pixel set corresponding to the grayscale value interval. In one implementation, clustering the pixels based on a plurality of preset grayscale value intervals to obtain a plurality of pixel sets may include: obtaining a preset mapping relationship between the grayscale value interval and the pixel set; and based on the mapping relationship, dividing the pixels into the plurality of pixel sets according to the grayscale value of each pixel.

[0072] The preset mapping relationship includes a one-to-one correspondence between multiple gray value intervals and multiple pixel point sets.

[0073] Specifically, each pixel of the content displayed in the preset display area can be traversed, and when the grayscale value of the pixel falls into a certain grayscale value interval, the pixel is divided into a pixel set corresponding to the grayscale value interval. Continuing with the example that the grayscale value range of the aforementioned RGB image is divided into 512 grayscale value intervals, for example, for a first pixel with a grayscale value of (r=10, g=2, b=31) and a second pixel with a grayscale value of (r=0, g=16, b=0), since the three channel values ​​of r, g, and b of the first pixel and the second pixel are both in the grayscale value interval [0, 31], the first pixel and the second pixel are mapped to the first pixel set. For another example, for the third pixel point with a grayscale value of (r=244, g=244, b=244) and the fourth pixel point with a grayscale value of (r=255, g=255, b=255), since the three channel values ​​of r, g, and b of the third pixel point and the fourth pixel point are all in the grayscale value interval [224, 255], the third pixel point and the fourth pixel point are mapped to the 512th pixel point set. In this way, each pixel point of the content displayed in the preset display area can be divided into multiple pixel point sets. Since the pixel point set corresponds to the grayscale value interval one by one, when the light leakage value is calculated in the pixel point set as a unit in the subsequent calculation, the maximum number of calculations is only 512 times, which is greatly reduced compared to the 255*255*255 calculation times when the pixel point is used as a unit, thereby greatly reducing the time overhead of light leakage detection.

[0074] It should be understood that, since the content displayed in the preset display area may not cover the entire grayscale value range, the number of pixel point sets obtained by clustering each pixel point based on the preset multiple grayscale value intervals may be less than 512. That is, in actual application, the maximum number of calculations may be less than 512 times, so the time consumption of light leakage detection may be less.

[0075] Specifically, the number of actual pixel point sets obtained by clustering each pixel point of different display contents is related to the color complexity of the display content. Based on the preset gray value interval, if the display content is a pure color image, all pixel points will be divided into the same pixel point set. Therefore, when the light leakage value is calculated in units of pixel point sets in the subsequent calculation, only one calculation is required, and the time consumption of light leakage detection is minimized. If the RGB value distribution range of the display content is wide, the number of calculations will increase accordingly, and the time consumption of light leakage detection will also increase accordingly. Therefore, the screen leakage detection method provided in this embodiment can adaptively adjust the number of calculations according to the color complexity of the screen display content.

[0076] S203 . Obtain the light leakage value corresponding to each pixel point set according to the brightness value and the fused grayscale value corresponding to each pixel point set.

[0077] The fused gray value is obtained by fusion of the gray values ​​of each pixel in the corresponding pixel set.

[0078] In one implementation, for each pixel point set, the fused grayscale value of the pixel point set may be determined according to an average value of the grayscale values ​​of each pixel point in the pixel point set.

[0079] Similarly, taking the display content as an RGB image as an example, for each pixel set, the grayscale values ​​of the red channel R of each pixel in the pixel set can be averaged to serve as the grayscale value of the fused red channel R; similarly, the grayscale values ​​of the green channel G of each pixel in the pixel set can be averaged to serve as the grayscale value of the fused green channel G, and the grayscale values ​​of the blue channel B of each pixel in the pixel set can be averaged to serve as the grayscale value of the fused blue channel B.

[0080] It should be understood that in other implementations, the fused grayscale value of the pixel point set may be determined based on the median grayscale value of each pixel point in each pixel point set, or the fused grayscale value of the pixel point set may be determined based on the grayscale value of each pixel point in each pixel point set in other ways.

[0081] In this embodiment, each pixel set clustered in step S202 can be traversed, and the light leakage value corresponding to each pixel set can be obtained based on the brightness value of the screen and the fused grayscale value corresponding to each pixel set, taking the pixel set as a unit.

[0082] When the content displayed in the preset area is a multi-channel image, the light leakage value corresponding to each pixel point set may include the light leakage values ​​of multiple channels corresponding to each pixel point set. For example, taking the multi-channel image as an RGB image, in one implementation, the light leakage value corresponding to each pixel point set may include the light leakage value of the red channel R, the light leakage value of the color filter channel G, and the light leakage value of the blue channel B corresponding to each pixel point set. In another implementation, in addition to the light leakage value of the red channel R, the light leakage value of the green channel G, and the light leakage value of the blue channel B, the light leakage value corresponding to each pixel point may also include the light leakage value of the Clear channel (hereinafter referred to as the C channel) and the light leakage value of the Wideband channel (hereinafter referred to as the W channel), that is, the light leakage value corresponding to each pixel point includes the light leakage values ​​of five channels. Among them, the light leakage value of the C channel includes the light leakage values ​​of the three channels of RGB, and the light leakage value of the W channel includes the light leakage values ​​of the four channels of RGB and infrared (Infrared Radiation, IR).

[0083] In one implementation, the light leakage value corresponding to each pixel point set is obtained based on the brightness value and the fused grayscale value corresponding to each pixel point set, including: obtaining the correspondence between the preset grayscale value, the brightness value and the light leakage value; based on the correspondence, obtaining the light leakage value corresponding to each pixel point set based on the brightness value and the fused grayscale value corresponding to each pixel point set.

[0084] The corresponding relationship between the preset grayscale value, brightness value and light leakage value may be pre-stored in a memory inside or outside the electronic device, so that the electronic device can read it from the memory when it is actually used.

[0085] In an optional implementation, the correspondence between the preset grayscale value, brightness value and light leakage value includes a mapping relationship: light leakage value = f(r, g, b, bright), based on which the light leakage value corresponding to each pixel set is obtained as f(r, g, b, bright). Where r, g, b are the R channel value, G channel value and B channel value of each pixel respectively, and bright is the brightness value of the screen.

[0086] In a specific implementation, the electronic device can traverse each pixel point set, and determine the light leakage value corresponding to the fused grayscale value of each pixel point set and the brightness value of the screen based on the correspondence between the fused grayscale value of each pixel point set and the brightness value of the screen, and through the preset grayscale value, brightness value and light leakage value, as the light leakage value corresponding to each pixel point set.

[0087] In another implementation, the light leakage value corresponding to each pixel point set is obtained based on the brightness value and the fused grayscale value corresponding to each pixel point set, including: inputting the brightness value and the fused grayscale value corresponding to each pixel point set into a neural network model, and using the neural network model to process the brightness value and the fused grayscale value corresponding to each pixel point set to obtain the light leakage value corresponding to each pixel point set.

[0088] Specifically, each pixel set can be traversed, and the fused grayscale value corresponding to each pixel set and the brightness value of the screen can be used as a set of data to be processed and input into the neural network model. The neural network model is used to process the set of data to be processed, and the light leakage value corresponding to the pixel set can be predicted. Since the neural network model is called once for each pixel set, the number of calculations of the neural network model is reduced compared to calling the neural network model for each pixel, thereby greatly reducing the calculation time of screen light leakage.

[0089] In a specific implementation, the neural network model may adopt a deep neural network (DNN) model. Since the data to be processed including the fused grayscale value and the brightness value of the screen does not have local features, connections are formed between the lower layer neurons and all upper layer neurons in the structure of the DNN model, and the use of the DNN model can better extract the feature associations between all features of this type of data to be processed.

[0090] However, as the number of DNN models increases, the model may fail to train due to the vanishing gradient phenomenon. Considering the power consumption and performance balance when integrating neural network models in electronic devices, and in order to improve the fitting accuracy of neural network models, in another implementation, the neural network model adopts a residual block structure based on fully connected units, referred to as the ResDNN model.

[0091] In a specific implementation, the ResDNN model may include a residual module, which includes multiple fully-connected units, which are connected in series in sequence, and there are jump connections between the multiple fully-connected units, and the jump connection includes a connection between two non-adjacent fully-connected units.

[0092] In an optional implementation, the jump connection is a jump connection between a first fully-connected unit and a last fully-connected unit among the multiple fully-connected units.

[0093] Specifically, each fully connected unit includes a fully connected layer, batch normalization (BN), and an activation function. The fully connected layer, batch normalization, and activation function are connected in sequence. Among them, the fully connected layer can be implemented using General Matrix Multiplication (GEMM). Each neuron in the fully connected layer is connected to all neurons in the previous layer. The number of neurons in the fully connected layer can be set by the user, and can be set according to factors such as the desired model fitting ability and model operation efficiency. Specifically, the higher the number of neurons, the higher the model complexity, and the higher the model fitting ability. However, the model operation time increases and the operation efficiency decreases. In addition, the number of neurons in the fully connected layer can also be obtained by a neural network architecture search algorithm.

[0094] In an optional manner, the residual module includes four fully connected units connected in series in sequence: a first fully connected unit, a second fully connected unit, a third fully connected unit, and a fourth fully connected unit. The first fully connected unit also skips the second fully connected unit and the third fully connected unit in the middle of the path to connect to the fourth fully connected unit. More specifically, the output end of the activation function of the first fully connected unit is directly connected to the output end of the BN of the fourth fully connected unit, so that the output data from the activation function of the first fully connected unit is added to the output data from the BN of the fourth fully connected unit and then input into the activation function of the fourth fully connected unit, thereby enabling certain levels in the neural network model to be adaptively skipped during model training, adaptively adjusting the learning depth, and improving the fitting ability of the model. BN is located between the fully connected layer and the excitation function, and is used to perform batch normalization on the output results of the fully connected layer so that its mean is close to 0 and its standard deviation is close to 1, ensuring that the input of the activation function has a stable distribution.

[0095] The activation function is connected to BN and is used to increase the nonlinearity of the neural network model so that the neural network model can approximate any nonlinear function. In the embodiment of the present application, the activation function can use the Relu function.

[0096] In an optional embodiment, the ResDNN model includes a first fully-connected module, a second fully-connected module, and the residual module located between the first fully-connected module and the second fully-connected module, wherein there are multiple residual modules, and the multiple residual modules are cascaded and located between the first fully-connected module and the second fully-connected module.

[0097] The first fully connected module can be connected to the input layer of the neural network model, which is used to receive the data to be processed; the second fully connected module can be connected to the output layer of the neural network model, which is used to output the predicted data.

[0098] The number of residual modules can be set according to factors such as the desired model fitting capability and model operation efficiency. In a specific implementation of the present application, the number of residual modules is four. It should be understood that in other implementations, the number of residual modules can be greater than four or less than four, and this embodiment does not limit this.

[0099] The ResDNN model draws on the classic Resnet model and uses skip connections between non-adjacent fully connected units, so that it can adaptively skip certain layers in the model during training and adaptively adjust the learning depth to avoid difficult training situations such as gradient vanishing due to deep depth, thereby deepening the model layer and making the trained model have better fitting capabilities.

[0100] S204 . Obtain the light leakage value of the screen based on the light leakage value corresponding to each pixel point set.

[0101] The light leakage value of the screen is used to indicate the light intensity of the leakage light when the screen is in the current display state. The current display state can be understood as the display state of the screen in use.

[0102] Specifically, the light leakage values ​​corresponding to each pixel point set may be fused to obtain the light leakage value of the screen. In the case where each light leakage value includes the light leakage values ​​of multiple channels, in one implementation, the light leakage value of each channel in the light leakage values ​​corresponding to each pixel point set may be fused to obtain the light leakage value of the screen; in another implementation, only the light leakage value of a certain channel (for example, the green channel G) in the light leakage values ​​corresponding to the pixel point set may be fused to obtain the light leakage value of the screen, which is not limited in this embodiment.

[0103] In the embodiment of the present application, since the grayscale values ​​of the pixels located in the same pixel point set are in the same grayscale value range (that is, the pixels whose grayscale values ​​are in the same grayscale value range are clustered into the same pixel point set), a light leakage value calculation is performed once for each pixel point set. Compared with the related art in which the light leakage value calculation is performed once for each pixel point, this can greatly reduce the number of calculations, thereby greatly reducing the power consumption and time overhead of the electronic device when detecting screen leakage, thereby meeting the application requirements of the entire electronic device.

[0104] Considering the different distances between each area on the screen and the center of the light sensor set below the screen, each area contributes differently to screen light leakage. Specifically, the closer each area is to the center of the light sensor, the greater its contribution to screen light leakage. Conversely, the farther away from the center of the light sensor, the smaller its contribution to screen light leakage. When calculating the light leakage value of the screen, taking into account the light leakage weight value of each pixel point located in different areas can improve the accuracy of screen light leakage detection.

[0105] To this end, in one embodiment of the present application, Figure 3 As shown, step S204 also includes:

[0106] S2041, obtaining the light leakage weight value corresponding to each pixel point set;

[0107] In one implementation, step S2041 specifically includes:

[0108] A. Obtain the light leakage weight value corresponding to each pixel in each pixel set.

[0109] The light leakage weight value of each pixel is related to the relative position of the pixel and the light sensor arranged below the screen.

[0110] B. For each pixel point set, the light leakage weight values ​​corresponding to each pixel point in the pixel point set are fused to obtain the light leakage weight value corresponding to the pixel point set.

[0111] As mentioned above, each area on the screen contributes differently to screen light leakage. Therefore, the contribution value of each area to screen light leakage can be pre-stored in the electronic device, that is, the light leakage weight value corresponding to each area can be pre-stored.

[0112] The light leakage weight value corresponding to each pixel point can be determined according to the light leakage weight value corresponding to the original area (also called block) where each pixel point is located before being clustered and the number of pixels included in the original area.

[0113] When clustering pixels based on multiple grayscale value intervals, each pixel carries not only grayscale value information but also the light leakage weight value information corresponding to the pixel. Taking RGB images as an example, each pixel carries four-dimensional information (r, g, b, w), where w is the light leakage weight value corresponding to the pixel. Figure 4 As shown, Figure 4 A schematic diagram of pixel clustering provided in an embodiment of the present application. The original regions where each pixel is located are divided according to the positional relationship between each region and the center of the light sensor, and each original region has corresponding light leakage weight information. The dotted lines show that some pixels in each original region are clustered into corresponding pixel sets according to multiple grayscale value intervals, and the light leakage weight value of each pixel is also mapped to each pixel set accordingly.

[0114] After obtaining the light leakage weight value corresponding to each pixel point, for each pixel point set, the light leakage weight value corresponding to each pixel point in the pixel point set may be summed to obtain the light leakage weight value corresponding to the pixel point set.

[0115] Specifically, assuming that the light leakage weight value corresponding to the original area where the i-th pixel in a certain pixel set is located is Wi, and the number of pixels contained in the original area is N, then the light leakage weight value corresponding to the i-th pixel is Wi / N. The number of pixels contained in the pixel set is n, then the light leakage weight value of the pixel set can be obtained according to formula (1), and the light leakage weight value of the pixel set can be recorded as weight. Formula (1) is:

[0116]

[0117] S2042. Obtain a light leakage value of the screen based on the light leakage weight value corresponding to each pixel point set and the light leakage value corresponding to each pixel point set.

[0118] In one implementation, the light leakage value of the screen may be obtained by performing a weighted summation on the light leakage weight value corresponding to each pixel point set and the light leakage value corresponding to each pixel point set.

[0119] Assuming that m pixel sets are obtained by clustering, and the light leakage value corresponding to each pixel set obtained in step S203 is f(r, g, b, bright), the light leakage value of the screen can be obtained according to formula (2). Formula (2) is:

[0120]

[0121] Among them, leakDN is the light leakage value of the screen, f(r,g,b,bright) is the corresponding relationship between the preset grayscale value, brightness value and light leakage value, r, g, b are the R channel value, G channel value and B channel value of each pixel respectively, bright is the brightness value of the screen, m is the number of pixel sets, Wi is the light leakage weight value of the block where the i-th pixel in the j-th pixel set is located, N is the number of pixels contained in each block, and n is the number of pixels contained in the j-th pixel set.

[0122] In the embodiment of the present application, considering the contribution of each pixel to the light leakage of the screen, when calculating the light leakage of the screen, the light leakage weight value of each pixel set is determined based on the light leakage weight value corresponding to each pixel, and then the light leakage value of the screen is obtained based on the light leakage weight value corresponding to each pixel set and the light leakage value corresponding to each pixel set. Since the light leakage weight value of each pixel is taken into account when calculating the light leakage of the screen, the accuracy of the light leakage detection of the screen is improved.

[0123] It should be noted that the aforementioned embodiment mainly uses the display parameters including the brightness value and grayscale value of the screen as an example to illustrate the concept of the present application. It should be understood that, as mentioned above, the factors affecting screen light leakage also include the refresh frequency of the screen, the display mode of the screen, and / or other display parameters related to screen light leakage, etc. Calculating the light leakage value in combination with multiple factors is conducive to further improving the accuracy of light leakage detection. When the display parameters also include the refresh frequency of the screen, the display mode of the screen, and / or other display parameters related to screen light leakage, etc., the working principle is similar to the aforementioned embodiment and will not be repeated here.

[0124] Reference Figure 5 The present application also provides an ambient light detection method for determining the actual ambient light value according to the screen light leakage value detected in the above embodiment. Figure 5 The ambient light detection method provided in the embodiment of the present application is specifically described. Figure 5 As shown, the method includes:

[0125] Step S501: Determine the light leakage value of the screen according to the screen light leakage detection method mentioned in any of the aforementioned embodiments.

[0126] That is, the electronic device can use the screen light leakage detection method mentioned in any of the aforementioned embodiments to perform detection to obtain the screen light leakage value.

[0127] Step S502: Obtain the light sensitivity value detected by the light sensor provided below the screen.

[0128] Step S503: Determine the actual ambient light value according to the light sensitivity value and the light leakage value.

[0129] Specifically, the electronic device can obtain the real ambient light value according to the difference between the light sensitivity value and the light leakage value. The electronic device can adjust the brightness of the screen according to the real ambient light value so that the brightness of the screen meets the visual perception of the human eye. In addition, the electronic device can also integrate the color temperature according to the real ambient light value to assist display and photography.

[0130] In the embodiment of the present application, since the grayscale values ​​of the pixels in the same pixel set are in the same grayscale value interval (that is, the pixels whose grayscale values ​​are in the same grayscale value interval are clustered into the same pixel set), a light leakage value calculation is performed for each pixel set. Compared with the related art in which a light leakage value calculation is performed for each pixel, the number of calculations can be greatly reduced, thereby greatly reducing the power consumption and time cost of the electronic device when detecting screen light leakage. Since the speed of screen light leakage detection is improved, the real ambient light value can be quickly determined based on the light sensitivity value output by the light sensor and the light leakage value obtained by detection, which is suitable for scenes such as dynamic switching and complex display content during video playback, meeting the application requirements of electronic devices.

[0131] Reference Figure 6 , shows a schematic diagram of the structure of a device for detecting screen light leakage according to an embodiment of the present application. Figure 6 As shown, the screen light leakage detection device 60 includes:

[0132] An acquisition module 601 is used to acquire the brightness value of the screen and the grayscale value of each pixel in a preset display area of ​​the screen;

[0133] A clustering module 602 is used to cluster each pixel based on a plurality of preset grayscale value intervals and the grayscale value of each pixel to obtain a plurality of pixel sets, wherein the pixels whose grayscale values ​​are in the same grayscale value interval are clustered into the same pixel set;

[0134] The light leakage calculation module 603 is used to obtain the light leakage value corresponding to each pixel point set according to the brightness value and the fused grayscale value corresponding to each pixel point set, wherein each fused grayscale value is obtained by fusion of the grayscale values ​​of the pixels in the corresponding pixel point set;

[0135] The determination module 604 is used to obtain the light leakage value of the screen based on the light leakage value corresponding to each pixel point set.

[0136] In one implementation of the present application, the determining module 604 is specifically configured to:

[0137] Get the light leakage weight value corresponding to each pixel set;

[0138] A weighted sum is performed based on the light leakage weight value corresponding to each pixel point set and the light leakage value corresponding to each pixel point set to obtain the light leakage value of the screen.

[0139] In one implementation of the present application, the determining module 604 is specifically configured to:

[0140] Obtaining a light leakage weight value corresponding to each pixel in each pixel set, wherein the light leakage weight value corresponding to each pixel depends on a relative position of each pixel and a light sensor disposed below the screen;

[0141] For each pixel point set, the light leakage weight value corresponding to each pixel point in the pixel point set is fused to obtain the light leakage weight value corresponding to the pixel point set.

[0142] In one implementation of the present application, the determining module 604 is specifically configured to:

[0143] The light leakage weight value corresponding to each pixel set is calculated by the following formula:

[0144]

[0145] Among them, weight is the light leakage weight value corresponding to the pixel point set, Wi is the light leakage weight value of the block where the i-th pixel point of the pixel point set is located, N is the number of pixels contained in each block, and n is the number of pixels contained in the pixel point set.

[0146] In one implementation of the present application, the light leakage calculation module 603 is specifically used for:

[0147] Obtaining the corresponding relationship between the preset grayscale value, brightness value and light leakage value;

[0148] Based on the corresponding relationship, the light leakage value corresponding to each pixel point set is obtained according to the brightness value and the fused grayscale value corresponding to each pixel point set.

[0149] In one implementation of the present application, the light leakage calculation module 603 is specifically used for:

[0150] The brightness value and the fused grayscale value corresponding to each pixel point set are input into a neural network model, and the neural network model is used to process the brightness value and the fused grayscale value corresponding to each pixel point set to obtain a light leakage value corresponding to each pixel point set.

[0151] In one implementation of the present application, the neural network model includes a residual module, the residual module includes multiple fully connected units, the multiple fully connected units are connected in series in sequence, and the multiple fully connected units also have jump connections, and the jump connection includes a connection between two non-adjacent fully connected units.

[0152] In one implementation of the present application, the jump connection is a jump connection between a first fully-connected unit and a last fully-connected unit among the multiple fully-connected units.

[0153] In one implementation of the present application, the number of the residual modules is multiple, and the neural network model also includes a first fully-connected module and a second fully-connected module. The multiple residual modules are cascade-connected and located between the first fully-connected module and the second fully-connected module.

[0154] In one implementation of the present application, the preset display area is a light detection area of ​​the screen, and the light detection area corresponds to a position of a light sensor disposed below the screen.

[0155] In one implementation of the present application, the clustering module 602 is specifically used for:

[0156] Obtaining a preset mapping relationship between a grayscale value interval and a pixel point set;

[0157] Based on the preset mapping relationship, each pixel is divided into the plurality of pixel sets according to the grayscale value of each pixel.

[0158] The screen light leakage detection device 60 provided in this embodiment is used to execute the screen light leakage detection method described in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0159] Reference Figure 7 , shows a schematic diagram of the structure of an ambient light detection device according to an embodiment of the present application. Figure 7 As shown, the ambient light detection device 70 includes:

[0160] A screen light leakage detection device 701, used to determine the light leakage value of the screen, wherein the screen light leakage detection device 701 is the screen light leakage detection device 60 of the third aspect, and its function and effect can be specifically referred to the screen light leakage detection device 60 of the third aspect, which will not be described in detail here;

[0161] An acquisition module 702 is used to acquire a light sensitivity value detected by a light sensor disposed below the screen;

[0162] Ambient light calculation module 703, used to determine the actual ambient light value based on the light sensitivity value and the light leakage value

[0163] The ambient light detection device 90 provided in this embodiment is used to execute the ambient light detection method of the aforementioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0164] Reference Figure 8 , shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.

[0165] like Figure 8 As shown, the electronic device may include: a processor 801 , a communication interface 802 , a memory 803 , and a communication bus 804 .

[0166] The processor 801 , the communication interface 802 , and the memory 803 communicate with each other via a communication bus 804 .

[0167] The communication interface 802 is used to communicate with other electronic devices or servers.

[0168] The processor 801 is used to execute the program 805, and specifically can execute the relevant steps of the screen light leakage detection method and / or the ambient light detection method described in the above method embodiments.

[0169] Specifically, the program 805 may include program codes, which include computer operation instructions.

[0170] The processor may be a central processing unit, or a specific integrated circuit, or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0171] A memory for storing programs. The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory. The program can be specifically used to enable the processor to perform the relevant steps of the screen light leakage detection method and / or the ambient light detection method described in the above method embodiment. The specific implementation of each step can refer to the corresponding description in the corresponding steps and units in the above method embodiment, which will not be repeated here.

[0172] The electronic device of this embodiment is used to implement the corresponding methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. The electronic device can be, for example, a portable or mobile computing device such as a smart phone, a laptop, a tablet computer, a gaming device, or an electronic database, a car, a bank automated teller machine (Automated Teller Machine, ATM) and other electronic devices, which are not limited in this embodiment of the present application.

[0173] The 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 by a processor, the screen light leakage detection method provided in the aforementioned method embodiment and / or the ambient light detection method provided in the aforementioned method embodiment are implemented. The working principle and technical effect are similar and will not be described in detail here.

[0174] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.

[0175] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the verification code generation method described herein is implemented. In addition, when a general-purpose computer accesses a code for implementing the verification code generation method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the verification code generation method shown here.

[0176] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0177] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.

Claims

1. A method for detecting screen light leakage, comprising: Acquire the brightness value of the screen and the grayscale value of each pixel in a preset display area of ​​the screen, wherein the preset display area is a light detection area of ​​the screen, and the light detection area corresponds to a position of a light sensor set below the screen; Clustering each pixel based on a plurality of preset grayscale value intervals and the grayscale value of each pixel to obtain a plurality of pixel sets, wherein the grayscale values ​​of the pixels in the same pixel set are in the same grayscale value interval; Obtaining a light leakage value corresponding to each pixel point set according to the brightness value and the fused grayscale value corresponding to each pixel point set, wherein the fused grayscale value is obtained by fusion of the grayscale values ​​of each pixel point in the corresponding pixel point set; Based on the light leakage values ​​corresponding to the pixel point sets, the light leakage value of the screen is obtained.

2. The detection method according to claim 1, characterized in that: The obtaining the light leakage value of the screen based on the light leakage value corresponding to each pixel point set includes: Get the light leakage weight value corresponding to each pixel set; A weighted sum is performed based on the light leakage weight value corresponding to each pixel point set and the light leakage value corresponding to each pixel point set to obtain the light leakage value of the screen.

3. The detection method according to claim 2, characterized in that: The obtaining of the light leakage weight value corresponding to each pixel point set includes: Obtaining a light leakage weight value corresponding to each pixel in each pixel set, wherein the light leakage weight value corresponding to each pixel depends on a relative position of each pixel and a light sensor disposed below the screen; For each pixel point set, the light leakage weight value corresponding to each pixel point in the pixel point set is fused to obtain the light leakage weight value corresponding to the pixel point set.

4. The detection method according to claim 2, characterized in that: The obtaining of the light leakage weight value corresponding to each pixel point set includes: The light leakage weight value corresponding to each pixel set is calculated by the following formula: Among them, weight is the light leakage weight value corresponding to the pixel point set, Wi is the light leakage weight value of the block where the i-th pixel point of the pixel point set is located, N is the number of pixels contained in each block, and n is the number of pixels contained in the pixel point set.

5. The detection method according to claim 1, characterized in that: The obtaining, according to the brightness value and the fused grayscale value corresponding to each pixel point set, a light leakage value corresponding to each pixel point set, comprises: Obtaining the corresponding relationship between the preset grayscale value, brightness value and light leakage value; Based on the corresponding relationship, the light leakage value corresponding to each pixel point set is obtained according to the brightness value and the fused grayscale value corresponding to each pixel point set.

6. The detection method according to claim 1, characterized in that: The obtaining, according to the brightness value and the fused grayscale value corresponding to each pixel point set, a light leakage value corresponding to each pixel point set, comprises: The brightness value and the fused grayscale value corresponding to each pixel point set are input into a neural network model, and the neural network model is used to process the brightness value and the fused grayscale value corresponding to each pixel point set to obtain a light leakage value corresponding to each pixel point set.

7. The detection method according to claim 6, characterized in that: The neural network model includes a residual module, which includes a plurality of fully connected units, wherein the plurality of fully connected units are connected in series in sequence, and there are also jump connections between the plurality of fully connected units, wherein the jump connection includes a connection between two non-adjacent fully connected units.

8. The detection method according to claim 7, characterized in that: The jump connection is a jump connection between a first fully connected unit and a last fully connected unit among the multiple fully connected units.

9. The detection method according to claim 7 or 8, characterized in that: The number of the residual modules is multiple, and the neural network model also includes a first fully connected module and a second fully connected module. The multiple residual modules are cascade-connected and located between the first fully connected module and the second fully connected module.

10. The detection method according to claim 1, characterized in that: The clustering of each pixel point based on the preset multiple gray value intervals and the gray value of each pixel point to obtain multiple pixel point sets includes: Obtaining a preset mapping relationship between a grayscale value interval and a pixel point set; Based on the preset mapping relationship, each pixel is divided into the plurality of pixel sets according to the grayscale value of each pixel.

11. A method for detecting ambient light, characterized in that: include: Determining the light leakage value of the screen according to the screen light leakage detection method according to any one of claims 1 to 10; Obtaining a light sensitivity value detected by a light sensor disposed below the screen; An ambient light value is determined according to the light sensitivity value and the light leakage value.

12. A device for detecting screen light leakage, comprising: An acquisition module, used to acquire a brightness value of a screen and a grayscale value of each pixel in a preset display area of ​​the screen, wherein the preset display area is a light detection area of ​​the screen, and the light detection area corresponds to a position of a light sensor set below the screen; A clustering module, used for clustering each pixel based on a plurality of preset grayscale value intervals and the grayscale value of each pixel to obtain a plurality of pixel sets, wherein the pixels whose grayscale values ​​are in the same grayscale value interval are clustered into the same pixel set; A light leakage calculation module, used to obtain a light leakage value corresponding to each pixel point set according to the brightness value and the fused grayscale value corresponding to each pixel point set, wherein each fused grayscale value is obtained by fusion of the grayscale values ​​of the pixels in the corresponding pixel point set; The determination module is used to obtain the light leakage value of the screen based on the light leakage value corresponding to each pixel point set.

13. A device for detecting ambient light, comprising: A screen light leakage detection device, used to determine the light leakage value of the screen, wherein the screen light leakage detection device is the screen light leakage detection device as claimed in claim 12; An acquisition module, used to acquire a light sensitivity value detected by a light sensor arranged below the screen; The ambient light calculation module is used to determine the ambient light value according to the light sensitivity value and the light leakage value.

14. An electronic device comprising: At least one processor, a memory, a bus and a communication interface, wherein the processor stores a program, the processor, the communication interface and the memory communicate with each other through the communication bus, the communication interface is used to communicate with other devices or components, and the processor executes the program to implement the screen leakage detection method as described in any one of claims 1 to 10, or the ambient light detection method as described in claim 11.

15. A computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for detecting screen light leakage as claimed in any one of claims 1 to 10 is implemented, or the method for detecting ambient light as claimed in claim 11 is implemented.

Citation Information

Patent Citations

  • Display screen light leakage detection method and system, and display

    CN108682368A

  • Detecting method and device for light leakage of display screen

    CN108983456A

  • Display panel, display device and image processing method

    CN111445881A

  • Display screen light leakage value obtaining method, electronic equipment and storage medium

    CN112599089A

  • Ambient light detection method and device, electronic equipment and storage medium

    CN113257195A