WO2023045884A1 - 屏幕光检测模型训练方法、环境光检测方法及装置 - Google Patents

屏幕光检测模型训练方法、环境光检测方法及装置 Download PDF

Info

Publication number
WO2023045884A1
WO2023045884A1 PCT/CN2022/119722 CN2022119722W WO2023045884A1 WO 2023045884 A1 WO2023045884 A1 WO 2023045884A1 CN 2022119722 W CN2022119722 W CN 2022119722W WO 2023045884 A1 WO2023045884 A1 WO 2023045884A1
Authority
WO
WIPO (PCT)
Prior art keywords
screen
light detection
parameter
screen light
light
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2022/119722
Other languages
English (en)
French (fr)
Inventor
李正汉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Publication of WO2023045884A1 publication Critical patent/WO2023045884A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the application belongs to the technical field of electronic equipment, and in particular relates to a screen light detection model training method, an ambient light detection method and a device.
  • the electronic device can select an appropriate screen brightness or shooting mode based on the ambient light information collected by the photosensitive sensor.
  • the light emitted by the screen of the electronic device may interfere with the collection result of ambient light information.
  • the compensation value is usually determined according to the luminous color of the screen and the correspondence between the preset color and the compensation value, and the light information collected by the photosensitive sensor is corrected by the compensation value to obtain ambient light information.
  • the determined compensation value may be less accurate.
  • the purpose of the embodiment of the present application is to provide a screen light detection model training method, ambient light detection method and device, which can solve the poor accuracy of the compensation value determined by the corresponding relationship between the preset color and the compensation value in the prior art The problem.
  • the embodiment of the present application provides a method for training a screen light detection model, the method comprising:
  • the training samples include the first display parameter and the first screen light parameter
  • the first screen light parameter is the light obtained by the photosensitive sensor when the target display area is displayed according to the first display parameter under the target environmental condition Detection value
  • the target environment condition includes the ambient light intensity less than or equal to the preset light intensity value
  • the target display area is the display area matching the position of the photosensitive sensor in the screen
  • the first display parameter is the display parameter of the target display area
  • N is greater than 1 an integer of
  • the neural network to be trained is trained through N training samples to obtain a screen light detection model.
  • the embodiment of the present application provides an ambient light detection method, the method comprising:
  • the second display parameter, light detection value, and screen light detection model of the target display area the light detection value is obtained through a photosensitive sensor, and the screen light detection model is obtained by training according to the screen light detection model training method as shown in the first aspect;
  • the embodiment of the present application provides a screen light detection model training device, which includes:
  • the first acquisition module is used to acquire N training samples, the training samples include the first display parameter and the first screen light parameter, the first screen light parameter is under the target environment condition, and when the target display area is displayed according to the first display parameter , the light detection value obtained by the photosensitive sensor, the target environmental conditions include that the ambient light intensity is less than or equal to the preset light intensity value, the target display area is the display area that matches the position of the photosensitive sensor in the screen, and the first display parameter is the target display area.
  • Display parameters, N is an integer greater than 1;
  • the training module is used to train the neural network to be trained by using N training samples to obtain a screen light detection model.
  • an ambient light detection device which includes:
  • the second acquisition module is used to acquire the second display parameter, light detection value and screen light detection model of the target display area; the light detection value is obtained through the photosensitive sensor, and the screen light detection model is based on the screen light
  • the detection model training method is trained;
  • a processing module configured to process the second display parameters through the screen light detection model to obtain the second screen light parameters
  • the determination module is configured to determine the ambient light parameter according to the second screen light parameter and the light detection value.
  • the embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and operable on the processor.
  • the program or instruction is executed by the processor, the following The steps of the method of the first aspect, or the steps of the method implementing the second aspect.
  • the embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented, or the steps of the method of the second aspect are implemented. Aspect method steps.
  • the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the method in the first aspect, or implement the method in the second aspect. aspects of the method.
  • an embodiment of the present application provides a computer program product, the program product is stored in a non-volatile storage medium, and the program product is executed by at least one processor to implement the method in the first aspect, Or implement the method as in the second aspect.
  • the embodiment of the present application provides an electronic device configured to execute the steps of the screen light detection model training method according to claim 1 or 2, or implement the method in the first aspect, Or implement the method as in the second aspect.
  • the screen light detection model training method provided in the embodiment of the present application can train the neural network to be trained through N training samples to obtain the screen light detection model.
  • the training samples include the first display parameters, and under the target environment conditions, and The first screen light parameter obtained by the photosensitive sensor when the target display area is displayed according to the first display parameter.
  • the screen light detection model can predict and obtain screen light parameters relatively accurately when the target display area is in various display states.
  • the predicted screen light parameter can be used to compensate the light detection value obtained by the photosensitive sensor, so that the ambient light parameter can be obtained more accurately.
  • Figures 1a to 1b are structural example diagrams of electronic equipment in the related art
  • Fig. 1b is an example diagram of a side view of an electronic device in the related art
  • FIG. 3 is a schematic flowchart of a method for training a screen light detection model provided in an embodiment of the present application
  • 4a to 4c are example diagrams of the display state of the target display area
  • Fig. 5 is a schematic diagram of the architecture of the neural network to be trained
  • FIG. 6 is a schematic flowchart of an ambient light detection method provided in an embodiment of the present application.
  • Fig. 7 is a schematic structural diagram of a screen light detection model training device provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an ambient light detection device provided in an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application
  • Figure 1a and Figure 1b are schematic structural diagrams of an electronic device in the related art, the electronic device mainly includes a glass cover 11, a screen 12, a diffuser 13, a photosensitive sensor 14 and a main board 15 .
  • the photosensitive sensor 14 can be used to convert the light signal into an electric signal, so as to realize the acquisition of the light detection value.
  • the light detection value may be the current or voltage value generated in the photosensitive sensor 14 , or may also be the light intensity obtained after processing these current or voltage values, and the like.
  • the main board 15 can further process the light detection value obtained by the photosensitive sensor 14 and use it for other control functions.
  • the photosensitive sensor 14 may receive ambient light and screen light emitted by the screen 12 .
  • the ambient light can pass through the glass cover 11 , the screen 12 and the diffuser 13 in sequence, and then reach the photosensitive sensor 14 .
  • the screen light emitted by the screen 12 mainly passes through the glass cover 11 and spreads to the external environment, while a small part of the light can penetrate the diffusion sheet 13 and reach the photosensitive sensor 14 .
  • the photosensitive sensor 14 may not be located under the screen 12 .
  • there may be openings or depressions on the screen 12 and the vertical projection of the photosensitive sensor 14 on the screen 12 may be located in these openings or depressions.
  • the photosensitive sensor 14 may still receive light from the surrounding screen area.
  • the electronic device may need to obtain ambient light parameters, and due to the influence of the light from the screen 12, the photosensitive sensor 14 may simultaneously receive the ambient light and the screen light, resulting in that the light detection value obtained by the photosensitive sensor 14 cannot be obtained. Accurately reflect the actual ambient light state, that is, the ambient light parameters acquired by the electronic device may not be accurate enough.
  • a change in the light detection value of the photosensitive sensor 14 caused by screen light may be referred to as a detection error.
  • a detection error In order to obtain ambient light parameters more accurately, it is often necessary to correct this part of the detection error.
  • the screen light parameters of the screen in the preset display state are obtained in advance, and the corresponding relationship between the display state and the screen light parameters is established.
  • the screen light parameters can be determined according to the display state of the screen and the corresponding relationship, and the screen light parameters are used to compensate the light detection value obtained by the photosensitive sensor to obtain the ambient light parameters.
  • the electronic device may be in a vertical display state. However, there may be differences in the displayed content of the display area on the screen 12 that matches the position of the photosensitive sensor 14 (hereinafter referred to as the target display area).
  • the target display area may display part of the content of the status bar.
  • the display colors of each pixel unit in the target display area may be the same.
  • there may be multiple display colors of the pixel units in the target display area and as the icon in the status bar changes, the display color corresponding to the target display area may also change accordingly.
  • the electronic device may be in a horizontal display state, and at this time, the display content in the target display area may be more diverse.
  • the above detection error is mainly affected by the display state of the target display area on the screen 12 .
  • embodiments of the present application provide a screen light detection model training method, an ambient light detection method and a device.
  • the screen light detection model training method, ambient light detection method and device provided in the embodiments of the present application will be described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.
  • the screen light detection model training method includes:
  • Step 301 obtain N training samples, the training samples include the first display parameter and the first screen light parameter, the first screen light parameter is under the target environment condition, and when the target display area is displayed according to the first display parameter, the light sensor
  • the obtained light detection value, the target environmental conditions include that the ambient light intensity is less than or equal to the preset light intensity value, the target display area is the display area matching the position of the photosensitive sensor in the screen, and the first display parameter is the display parameter of the target display area
  • N is an integer greater than 1;
  • step 302 the neural network to be trained is trained through N training samples to obtain a screen light detection model.
  • the screen light detection model training method provided in the embodiment of the present application can train the neural network to be trained through N training samples to obtain the screen light detection model.
  • the training samples include the first display parameters, and under the target environment conditions, and The first screen light parameter obtained by the photosensitive sensor when the target display area is displayed according to the first display parameter.
  • the screen light detection model can predict and obtain screen light parameters relatively accurately when the target display area is in various display states.
  • the predicted screen light parameter can be used to compensate the light detection value obtained by the photosensitive sensor, so that the ambient light parameter can be obtained more accurately.
  • the screen light detection model training method provided in the embodiment of the present application may be applied to a server or an electronic device.
  • this method can be applied in a server, and the server uses N training samples to train the neural network to be trained, and after obtaining the screen light detection model, the server can send the screen light detection model to at least one electronic device; or the server can also process display parameters sent by the electronic device, and send the processed screen light parameters to the electronic device.
  • this method can also be applied to electronic devices such as mobile terminals or personal computers. After the screen light detection model is trained in the electronic device, it can be directly used for subsequent determination of the screen light parameters; or, the electronic device can also use the screen Light detection patterns are sent to other electronic devices.
  • the following description mainly takes the application of the screen light detection model training method to electronic equipment as an example.
  • the electronic device can acquire multiple training samples.
  • the first display parameters in the training samples may include brightness parameters or color parameters.
  • the first display parameter can be obtained directly from the mainboard of the electronic device.
  • the brightness setting parameters of the user may be recorded in the motherboard, and the electronic device may directly extract the brightness setting parameters from the motherboard as brightness parameters.
  • electronic equipment can also extract color parameters, etc. from the main board.
  • the first display parameter may be the display parameter of the target display area, that is, the display parameter of the display area on the screen that matches the position of the photosensitive sensor.
  • the target display area can be set according to actual needs.
  • the target display area may be the display area occupied by the projection of the photosensitive sensor on the screen, or a rectangular display area circumscribing the projection, or a preset area that is offset outward along the outline of the projection.
  • the display area enclosed after setting the distance, etc., is not specifically limited here. If the photosensitive sensor is not located under the screen of the electronic device, the target display area may be agreed to be a display area within a preset distance range from the photosensitive sensor.
  • the photosensitive sensor can acquire the first screen light parameter.
  • the light detection value can be the current or voltage value generated in the photosensitive sensor, or it can also be the light intensity obtained after processing these current or voltage values; correspondingly, each first screen light
  • the unit of the parameter may be an optical unit or an electrical unit, etc., which are not specifically limited here.
  • the light detection value obtained by the photosensitive sensor in the electronic device is the light detection value of the screen light.
  • the target environment condition here may be that the intensity of the ambient light is less than or equal to a preset light intensity value and the like.
  • the screen Before obtaining the first screen light parameter, the screen can be turned off to obtain the ambient light intensity (corresponding to the ambient light parameter), and determine whether the ambient light intensity is less than or equal to the preset light intensity value.
  • the ambient light intensity corresponding to the ambient light parameter
  • an independent sensor may also be used to detect the ambient light to determine whether the intensity of the ambient light is less than or equal to a preset light intensity value.
  • the target display area when the target display area is displayed according to a first display parameter, it may be called that the target display area is in a display state.
  • the photosensitive sensor can obtain the corresponding light detection value of the screen light (ie, the first screen light parameter).
  • a training sample can be obtained by associating the first display parameter in the display state with the first screen light parameter.
  • Other training samples can be obtained in a similar manner, and details will not be described here.
  • the neural network to be trained may be trained based on N training samples to obtain a screen light detection model.
  • the first screen light parameter can be regarded as the identification of the first display parameter to a certain extent, and the neural network to be trained can process the first display parameter and output a predicted value, if the predicted value The same or similar to the light parameters of the first screen, it means that the prediction result of the neural network to be trained is relatively accurate; on the contrary, if the predicted value is quite different from the light parameters of the first screen, it means that the prediction result of the neural network to be trained is not accurate enough.
  • the accuracy of the prediction result can be reflected in the loss value of the preset loss function in the neural network to be trained, and the neural network to be trained can adjust the relevant network parameters based on the loss value.
  • the screen light detection model can process the input display parameters and predict more accurate screen light parameters.
  • the screen light detection model is a fully trained neural network, which can accurately predict screen light parameters when the target display area is in various display states. Therefore, in this embodiment, there is no need to exhaustively enumerate the display states of the target display area to establish the correspondence between the display state and the screen light parameters; when there is no corresponding correspondence between the display states, the screen can also be obtained more accurately. light parameters. Using the screen light parameter as a compensation value to correct the light detection value obtained by the photosensitive sensor can also obtain relatively accurate ambient light parameters.
  • the first display parameter includes at least one of a brightness parameter and a color parameter.
  • the first display parameter can be obtained directly from the main board or other electronic components of the electronic device.
  • the first display parameter may include a plurality of brightness parameters.
  • the plurality of brightness parameters may be obtained by sampling from the brightness range of the electronic device according to a preset sampling rule.
  • sampling rules can be determined in combination with empirical data. For example, according to the sampling rule, sampling may be performed at a smaller sampling interval in a luminance range commonly used by users, and sampling may be performed at a larger sampling interval in a luminance range not commonly used by users.
  • sampling can be performed at a sampling interval of 40 between 8-208 brightness levels, sampling at a sampling interval of 40 between 208 and 508, and sampling at a sampling interval of 40 between 508 and 2047.
  • the first display parameter may include a color parameter.
  • color parameters can be represented by optical three primary colors (Red Green Blue, RGB) values.
  • each color parameter may include at least three types of values, which are values in three color channels of red, green, and blue, respectively, and the value range of each color channel is 0-255.
  • color parameters can also be represented by grayscale values. That is, each color parameter may include a type of gray value, and its value range is 0-255.
  • the target display area may include multiple pixel units, and each pixel unit may correspond to an RGB value. Therefore, a color parameter may include a set of values. For example, if the target display area includes 66 ⁇ 66 pixel units, a color parameter may include 66 ⁇ 66 RGB values. And each RGB value can include three values, therefore, a color parameter can be represented by a 66 ⁇ 66 ⁇ 3 numerical matrix.
  • a color parameter By assigning corresponding RGB values to 66 ⁇ 66 pixel units, a color parameter can be obtained.
  • the color parameters of different training samples may be the same or different.
  • the first display parameter may include a brightness parameter and a color parameter at the same time.
  • multiple brightness parameters and multiple color parameters can be freely combined to form N first display parameters.
  • the first screen light parameters of the target display area when displaying with each first display parameter can be acquired through the photosensitive sensor.
  • the first display parameter is associated with the first screen light parameter to obtain N training samples.
  • the brightness parameter can be regarded as the overall brightness of the screen, and the color parameter can correspond to the partial display content of the target display area, both of which may affect the light detection value of the photosensitive sensor.
  • the first display parameter includes brightness parameter and color parameter at the same time, which can comprehensively consider the factors that affect the first screen light parameter, and then also enable the subsequent screen light detection model to predict the screen light parameter more accurately.
  • the target display area includes P target pixel units
  • the first display parameter includes P color parameters corresponding to the P target pixel units one-to-one, and P is an integer greater than 1;
  • the N training samples there are at least two color parameters among the first display parameters included in at least some of the training samples.
  • the color parameter corresponding to each target pixel unit may be an RGB value or a gray value of the target pixel unit, and the RGB value will be used for illustration below.
  • each target pixel unit in the target display area displays the same color.
  • the RGB values of each target pixel unit may be equal.
  • the RGB values of at least two target pixel units of the 66 ⁇ 66 target pixel units in the target display area are not equal.
  • the N training samples there are at least two color parameters among the first display parameters included in at least some of the training samples, that is, there is at least one training sample, and at least two The RGB values of target pixel units are not equal.
  • the RGB values of 66 ⁇ 66 target pixel units may correspond to more than two unequal RGB values, or correspond to more than two luminous colors.
  • the first display parameter including at least two color parameters may be referred to as the third display parameter below, and an example of two RGB values among the P color parameters included in each third display parameter is used for illustration.
  • the two RGB values can correspond to white light and gray light, respectively.
  • FIGS. 4 a to 4 c these figures are example diagrams of some display states of the target display area.
  • a circle represents the outer contour of the vertical projection of the photosensitive sensor on the screen
  • the target display area is a circumscribed square of the circle, corresponding to 66 ⁇ 66 target pixel units.
  • the 60 columns of target pixel units on the left can emit white light, and the 6 columns on the right can emit gray light; in Figure 4b, the 30 columns of target pixel units on the left can emit white light, and the 36 columns on the right can emit white light. Gray light is emitted; in FIG. 4c, the target pixel units in 66 columns all emit gray light.
  • the corresponding first display parameter obtained is the above-mentioned third display parameter.
  • the RGB values of each target pixel unit are equal.
  • the display state of the target display area such as the type, quantity and distribution of the luminescent colors of each target pixel unit, can be selected according to needs.
  • the neural network to be trained includes a first decoder and a second decoder
  • the neural network to be trained is trained through N training samples to obtain a screen light detection model, including:
  • the neural network to be trained can be a first decoder and a second decoder, wherein the first decoder includes three layers of neural networks for outputting feature maps, denoted as a three-layer first neural network,
  • the second decoder includes a two-layer neural network for outputting feature vectors, which is denoted as a two-layer second neural network, which corresponds to a fully connected layer Dense in FIG. 5 .
  • Each first neural network may include a sequentially connected depthwise separable convolution network (Depthwise separable convolution), a normalization layer (Batchnorm), a linear rectification function (ReLu) and a maximum pooling layer (MaxPool).
  • the input terminal of the first decoder can receive the first display parameters, and each first display parameter can be a 66 ⁇ 66 ⁇ 4 data matrix, wherein 66 ⁇ 66 corresponds to the number of target pixel units in the target display area, and 4 corresponds to the values in the red, green, and blue color channels and the brightness parameter respectively.
  • the first display parameter is input to the first layer of the first neural network, and the depth separable convolutional network of the first layer of the neural network uses a size of 3 ⁇ 3 and a number of 64 convolution kernels to convolve the first display parameter.
  • the convolution result is normalized, and then a nonlinear activation is performed using a linear rectification function.
  • the first feature map is output using maximum pooling.
  • the first feature map is input to the first neural network of the second layer, and the depth separable convolutional network of the first neural network of this layer uses a convolution kernel with a size of 3 ⁇ 3 and a number of 32 to convolve the first feature map.
  • the convolution result is normalized, and then a nonlinear activation is performed using a linear rectification function.
  • the second feature map is output using maximum pooling.
  • the second feature map is input to the first neural network of the third layer, and the depth separable convolutional network of the first neural network of this layer uses a convolution kernel with a size of 3 ⁇ 3 and a number of 32 to convolve the second feature map.
  • the convolution result is normalized, and then a nonlinear activation is performed using a linear rectification function.
  • the third feature map is output using maximum pooling.
  • the third feature map may correspond to the above-mentioned target feature map.
  • the third feature map is input to the first layer of the second neural network, and the layer of the second neural network expands the third feature map into a vector and inputs it to the fully connected layer.
  • the number of nodes in the fully connected layer is 128. Nonlinear activation using the linear rectification function, outputting the first vector.
  • the number of nodes in the fully connected layer is 1.
  • a preset loss function may also exist in the neural network to be trained, and the above-mentioned vector expression and the first screen light parameter are input into the preset loss function to calculate a loss value.
  • the network parameters of the neural network to be trained can be reversely adjusted, so that the loss value obtained in the subsequent training process tends to decrease continuously until the loss value is less than the preset loss value threshold. That is to say, with the goal that the loss value is less than the loss value threshold, the neural network to be trained can be trained to obtain a screen light detection model.
  • the architecture or hyperparameters of the above-mentioned neural network to be trained can be adjusted according to actual needs, and a screen light detection model can be obtained through training.
  • the embodiment of the present application also provides an ambient light detection method, including:
  • Step 601 acquiring the second display parameter, light detection value and screen light detection model of the target display area; the light detection value is obtained through a photosensitive sensor, and the screen light detection model is obtained through training according to the above-mentioned screen light detection model training method;
  • Step 602 process the second display parameters through the screen light detection model to obtain the second screen light parameters
  • Step 603 Determine ambient light parameters according to the second screen light parameters and light detection values.
  • the screen light detection model is obtained through the training method of the screen light detection model, and can be processed for the second display parameters of the target display area in various display states, and can be obtained More accurate second screen light parameters; the ambient light parameters determined according to the second screen light parameters and light detection values can effectively overcome the detection error caused by the screen light on the ambient light parameters and improve the accuracy of the ambient light parameters.
  • the ambient light is incident on the photosensitive sensor through the glass cover and the screen. Let the intensity of this part of ambient light that can be detected be x 1 .
  • the process of ambient light propagating in media such as the glass cover, screen, and air gap, and being detected by the photosensitive sensor is recorded as:
  • g() represents the influence of various factors in the process of propagation and detection of ambient light on the measurement results, represents the measurement results of the photosensitive sensor, and corresponds to the ambient light parameters.
  • h() represents the influence of various factors in the propagation and detection process of a part of the screen luminescence on the measurement results
  • n represents the measurement result of the photosensitive sensor on the screen luminescence, corresponding to the screen light parameters.
  • the measurement component n produced by the screen luminescence can be considered as additive noise superimposed on the desired ambient light measurement result s.
  • the light detection value obtained by the photosensitive sensor corresponds to y; the second display parameter is processed through the screen light detection model, and the second screen light parameter obtained corresponds to n. Then the noise n in y is removed, and a more accurate ambient light measurement value can be retained.
  • removing the noise n in y can be realized by a preset compensation algorithm, for example, under the limitation of formula (3), the compensation algorithm can correspond to the calculation method of (y-n). In practical applications, the compensation algorithm can also be set to other calculation methods as required, and examples are not given here.
  • the screen light detection model can be trained on a server or electronic device, and these servers or electronic devices can send the screen light detection model to other electronic devices. Between different electronic devices, there may be differences in the luminous performance of the screen, and there may also be differences in the measurement accuracy of the photosensitive sensor, which leads to differences in the light detection values measured by different electronic devices when displaying under the same display parameters.
  • the position of the photosensitive sensor may be different, but the relative position of the target display area on the screen is determined, which will also lead to differences in the light detection values measured by different electronic devices.
  • the above step 603 determines the ambient light value according to the light parameters and light detection values of the second screen.
  • parameters which can include:
  • the light detection value is compensated by the corrected light parameters of the second screen to obtain ambient light parameters.
  • the correction coefficient may be pre-stored in the electronic device.
  • the specific acquisition process can refer to the following example.
  • the electronic device used for screen light detection model training (hereinafter referred to as the first electronic device) and the electronic device to obtain the correction coefficient (hereinafter referred to as the second electronic device) can be placed in the same environmental condition and the same display status.
  • the first electronic device and the second electronic device are placed in an environment with uniform light at the same time; at the same time, the display content and display brightness of the two are adjusted to be consistent.
  • the light detection values measured by the photosensitive sensors in the two electronic devices are respectively recorded.
  • the intensity of light in the environment is adjusted, and the light detection values measured by the photosensitive sensors in the two electronic devices are recorded multiple times. Then, according to these recorded light detection values, sorting and calculation are carried out to obtain correction coefficients.
  • correction coefficient can also be obtained in other ways, and no examples will be given here.
  • the correction coefficient can be obtained and stored once, and in the subsequent application process, the correction coefficient can be directly called to correct the light parameters of the second screen without retesting and calculating the correction coefficient.
  • the corrected second screen light parameters can more accurately reflect the ambient light detection error caused by the actual screen light of the second electronic device, and the light detection value can be compensated by the corrected second screen light parameters, which can further improve Accuracy of the resulting ambient light parameters.
  • the step of obtaining the correction coefficient may specifically include:
  • the third screen light parameter is the light detection value obtained by the photosensitive sensor when the target display area is displayed according to the fourth display parameter under the target environment condition;
  • the correction coefficient is calculated according to the light parameters of the third screen and the light parameters of the fourth screen.
  • the light detection value obtained by the photosensitive sensor in the electronic device is equal to the screen light. light detection value.
  • the fourth display parameter may be a display parameter when the target display area is in any display state.
  • the screen is displayed according to the fourth display parameter, if the electronic device is placed in an environment where the ambient light intensity is less than or equal to the light intensity threshold, the light detection value obtained by the photosensitive sensor is the third screen light parameter.
  • the above-mentioned screen light detection model can process the fourth display parameter to obtain the fourth screen light parameter.
  • the ratio of the third screen light parameter to the fourth screen light parameter may be used as the correction coefficient.
  • the target display area can be in multiple display states in turn, and in each display state, obtain the third screen light parameter and the fourth screen light parameter to calculate the correction coefficient in each display state; then take The median, average or mode of these correction coefficients is used as the final correction coefficient.
  • the light parameter of the third screen is directly acquired by the photosensitive sensor, and the correction coefficient can be calculated efficiently according to the light parameter of the third screen and the light parameter of the fourth screen obtained through the processing of the light detection model of the screen.
  • the execution subject may be the screen light detection model training device, or the control device used to execute the screen light detection model training method in the screen light detection model training device module.
  • the screen light detection model training device implemented by the screen light detection model training device is taken as an example to illustrate the screen light detection model training device provided in the embodiment of the present application.
  • the screen light detection model training device 700 provided in the embodiment of the present application includes:
  • the first acquisition module 701 is used to acquire N training samples, the training samples include the first display parameter and the first screen light parameter, the first screen light parameter is under the target environment condition, and the target display area is displayed according to the first display parameter , the light detection value obtained by the photosensitive sensor, the target environmental conditions include that the ambient light intensity is less than or equal to the preset light intensity value, the target display area is the display area that matches the position of the photosensitive sensor in the screen, and the first display parameter is the target display area
  • the display parameters of , N is an integer greater than 1;
  • the training module 702 is configured to use N training samples to train the neural network to be trained to obtain a screen light detection model.
  • the target display area includes P target pixel units
  • the first display parameter includes P color parameters corresponding to the P target pixel units one-to-one, and P is an integer greater than 1;
  • the N training samples there are at least two color parameters among the first display parameters included in at least some of the training samples.
  • the screen light detection model training device 700 provided in the embodiment of the present application trains the neural network to be trained based on N training samples, and obtains a screen light detection model that can be applied to the screen light parameters in various display states of the target display area. Accurate prediction, which in turn helps to improve the accuracy of subsequent ambient light parameters.
  • the execution subject may be an ambient light detection device, or a control module in the ambient light detection device for executing the ambient light detection method.
  • the ambient light detection device provided in the embodiment of the present application is described by taking the ambient light detection method performed by the ambient light detection device as an example.
  • an ambient light detection device 800 including:
  • the second acquisition module 801 is used to acquire the second display parameter, light detection value and screen light detection model of the target display area; the light detection value is obtained through a photosensitive sensor, and the screen light detection model is trained according to the above-mentioned screen light detection model training method get;
  • a processing module 802 configured to process the second display parameter through a screen light detection model to obtain a second screen light parameter
  • the determination module 803 is configured to determine the ambient light parameter according to the second screen light parameter and the light detection value.
  • the determining module 803 includes:
  • a first acquisition unit configured to acquire a correction coefficient
  • a correction unit configured to correct the light parameters of the second screen according to the correction coefficient
  • the compensation unit is configured to compensate the light detection value by using the corrected light parameters of the second screen to obtain ambient light parameters.
  • the first acquisition unit may include:
  • the obtaining subunit is used to obtain the third screen light parameter, the third screen light parameter is the light detection value obtained by the photosensitive sensor when the target display area is displayed according to the fourth display parameter under the target environment condition;
  • the processing subunit is used to process the fourth display parameter through the screen light detection model to obtain the fourth screen light parameter;
  • the calculation subunit is used to calculate the correction coefficient according to the third screen light parameter and the fourth screen light parameter.
  • the screen light detection model is obtained through the training method of the screen light detection model, which can process the second display parameters of the target display area in various display states, and can Accurate second screen light parameters are obtained; the ambient light parameters determined according to the second screen light parameters and light detection values can effectively overcome the detection error caused by the screen light on the ambient light parameters and improve the accuracy of the ambient light parameters.
  • the correction coefficient By correcting the light parameters of the second screen through the correction coefficient, differences in light detection values obtained by different electronic devices can be compensated, and the accuracy of the ambient light parameters can be further improved.
  • the screen light detection model training device and the ambient light detection device in the embodiment of the present application may be devices, or components, integrated circuits, or chips in the terminal.
  • the device may be a mobile electronic device or a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant).
  • non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
  • Network Attached Storage NAS
  • personal computer personal computer, PC
  • television television
  • teller machine or self-service machine etc.
  • the screen light detection model training device and the ambient light detection device in the embodiment of the present application may be devices with an operating system.
  • the operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
  • the screen light detection model training device provided by the embodiment of the present application can realize the various processes realized by the method embodiments shown in Fig. 3 to Fig. 5, and the ambient light detection device provided by the embodiment of the present application can realize the various processes realized by the method embodiment shown in Fig. 6 , to avoid repetition, it will not be repeated here.
  • the embodiment of the present application also provides an electronic device 900, including a processor 901, a memory 902, and a program or instruction stored in the memory 902 and operable on the processor 901.
  • the program or, when the instruction is executed by the processor 901, each process of the above-mentioned screen light detection model training method or ambient light detection method embodiment can be achieved, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 10 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 1000 includes, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010, etc. part.
  • the electronic device 1000 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 1010 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions.
  • a power supply such as a battery
  • the structure of the electronic device shown in FIG. 10 does not constitute a limitation to the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange different components, and details will not be repeated here. .
  • the processor 1010 is used to obtain N training samples, the training samples include the first display parameter and the first screen light parameter, the first screen light parameter is under the target environment condition, and the target display area is displayed according to the first display parameter , the light detection value obtained by the photosensitive sensor, the target environmental conditions include that the ambient light intensity is less than or equal to the preset light intensity value, the target display area is the display area that matches the position of the photosensitive sensor in the screen, and the first display parameter is the target display area display parameters, N is an integer greater than 1; the neural network to be trained is trained by N training samples to obtain a screen light detection model.
  • the electronic device provided in the embodiment of the present application can train the neural network to be trained through N training samples to obtain a screen light detection model.
  • a training sample includes a first display parameter, and under the target environmental conditions, and the target display When the area is displayed according to the first display parameter, the first screen light parameter obtained by the photosensitive sensor.
  • the screen light detection model can predict and obtain screen light parameters relatively accurately when the target display area is in various display states.
  • the predicted screen light parameter can be used to compensate the light detection value obtained by the photosensitive sensor, so that the ambient light parameter can be obtained more accurately.
  • the target display area includes P target pixel units
  • the first display parameter includes P color parameters corresponding to the P target pixel units one-to-one, and P is an integer greater than 1;
  • the N training samples there are at least two color parameters among the first display parameters included in at least some of the training samples.
  • the processor 1010 can also be used to acquire the second display parameter, the light detection value and the screen light detection model of the target display area;
  • the detection model training method is trained;
  • the second display parameter is processed through the screen light detection model to obtain the second screen light parameter;
  • the ambient light parameter is determined according to the second screen light parameter and the light detection value.
  • the processor 1010 may also be configured to obtain a correction coefficient; modify the light parameter of the second screen according to the correction coefficient; and use the corrected light parameter of the second screen to compensate the light detection value to obtain the ambient light parameter.
  • the processor 1010 may also be configured to acquire a third screen light parameter, where the third screen light parameter is the light obtained by the photosensitive sensor when the target display area is displayed according to the fourth display parameter under the target environment condition.
  • the detection value; the fourth display parameter is processed through the screen light detection model to obtain the fourth screen light parameter; the correction coefficient is calculated according to the third screen light parameter and the fourth screen light parameter.
  • the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 is used for the image capture device (such as the image data of the still picture or video obtained by the camera) for processing.
  • the display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 1007 includes a touch panel 10071 and other input devices 10072 .
  • the touch panel 10071 is also called a touch screen.
  • the touch panel 10071 may include two parts, a touch detection device and a touch controller.
  • Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here.
  • the memory 1009 can be used to store software programs as well as various data, including but not limited to application programs and operating systems.
  • Processor 1010 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, and the modem processor mainly processes wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 1010 .
  • the embodiment of the present application also provides a readable storage medium, on which a program or an instruction is stored, and when the program or instruction is executed by a processor, each embodiment of the above-mentioned screen light detection model training method or ambient light detection method is implemented. process, and can achieve the same technical effect, in order to avoid repetition, it will not be repeated here.
  • a readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
  • ROM computer read-only memory
  • RAM random access memory
  • magnetic disk or an optical disk and the like.
  • the embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above-mentioned screen light detection model training method or ambient light detection method embodiment
  • the chip includes a processor and a communication interface
  • the communication interface is coupled to the processor
  • the processor is used to run programs or instructions to implement the above-mentioned screen light detection model training method or ambient light detection method embodiment
  • chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
  • the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase “comprising a " does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
  • the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

本申请公开了一种屏幕光检测模型训练方法、环境光检测方法及装置,属于电子设备技术领域。其中,屏幕光检测模型训练方法包括:获取N个训练样本,训练样本包括第一显示参数和第一屏幕光参数,第一屏幕光参数为在目标环境条件下,且目标显示区域按第一显示参数显示时,通过光敏传感器获得的光检测值,目标环境条件包括环境光强度小于或等于预设光强值,目标显示区域为屏幕中与光敏传感器位置匹配的显示区域,第一显示参数为目标显示区域的显示参数,N为大于1的整数;通过N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型。

Description

屏幕光检测模型训练方法、环境光检测方法及装置
相关申请的交叉引用
本申请主张在2021年09月24日在中国提交的中国专利申请 202111123048.8的优先权,其全部内容通过引用包含于此。
技术领域
本申请属于电子设备技术领域,具体涉及一种屏幕光检测模型训练方法、环境光检测方法及装置。
背景技术
目前,许多电子设备中设置有光敏传感器,以根据其采集的光信息实现一些特定的功能。比如,电子设备可以根据光敏传感器采集的环境光信息,选择合适的屏幕亮度或拍摄模式等。
在一些应用场景中,电子设备的屏幕发出的光线,可能会对环境光信息的采集结果造成干扰。现有技术中,通常是根据屏幕的发光颜色以及预设的颜色与补偿值之间的对应关系,确定补偿值,通过补偿值对光敏传感器采集的光信息进行校正,以得到环境光信息。
然而,由于实际应用中,预设的颜色与补偿值之间的对应关系难以覆盖屏幕所有的发光状态,因此可能导致确定的补偿值准确性较差。
发明内容
本申请实施例的目的是提供一种屏幕光检测模型训练方法、环境光检测方法及装置,能够解决现有技术通过预设的颜色与补偿值之间的对应关系确定的补偿值准确性较差的问题。
第一方面,本申请实施例提供了一种屏幕光检测模型训练方法,该方法包 括:
获取N个训练样本,训练样本包括第一显示参数和第一屏幕光参数,第一屏幕光参数为在目标环境条件下,且目标显示区域按第一显示参数显示时,通过光敏传感器获得的光检测值,目标环境条件包括环境光强度小于或等于预设光强值,目标显示区域为屏幕中与光敏传感器位置匹配的显示区域,第一显示参数为目标显示区域的显示参数,N为大于1的整数;
通过N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型。
第二方面,本申请实施例提供了一种环境光检测方法,该方法包括:
获取目标显示区域的第二显示参数、光检测值以及屏幕光检测模型;光检测值为通过光敏传感器获得,屏幕光检测模型为根据如第一方面所示的屏幕光检测模型训练方法训练得到;
通过屏幕光检测模型对第二显示参数进行处理,得到第二屏幕光参数;
根据第二屏幕光参数与光检测值,确定环境光参数。
第三方面,本申请实施例提供了一种屏幕光检测模型训练装置,该装置包括:
第一获取模块,用于获取N个训练样本,训练样本包括第一显示参数和第一屏幕光参数,第一屏幕光参数为在目标环境条件下,且目标显示区域按第一显示参数显示时,通过光敏传感器获得的光检测值,目标环境条件包括环境光强度小于或等于预设光强值,目标显示区域为屏幕中与光敏传感器位置匹配的显示区域,第一显示参数为目标显示区域的显示参数,N为大于1的整数;
训练模块,用于通过N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型。
第四方面,本申请实施例提供了一种环境光检测装置,该装置包括:
第二获取模块,用于获取目标显示区域的第二显示参数、光检测值以及屏幕光检测模型;光检测值为通过光敏传感器获得,屏幕光检测模型为根据如第一方面所示的屏幕光检测模型训练方法训练得到;
处理模块,用于通过屏幕光检测模型对第二显示参数进行处理,得到第二屏幕光参数;
确定模块,用于根据第二屏幕光参数与光检测值,确定环境光参数。
第五方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序或指令,程序或指令被处理器执行时实现如第一方面的方法的步骤,或者实现如第二方面的方法的步骤。
第六方面,本申请实施例提供了一种可读存储介质,可读存储介质上存储程序或指令,程序或指令被处理器执行时实现如第一方面的方法的步骤,或者实现如第二方面的方法的步骤。
第七方面,本申请实施例提供了一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现如第一方面的方法,或者实现如第二方面的方法。
第八方面,本申请实施例提供了一种计算机程序产品,所述程序产品被存储在非易失的存储介质中,所述程序产品被至少一个处理器执行以实现如第一方面的方法,或者实现如第二方面的方法。
第九方面,本申请实施例提供了一种电子设备,所述电子设备被配置成执行如权利要求1或2所述的屏幕光检测模型训练方法的步骤,或者实现如第一方面的方法,或者实现如第二方面的方法。
本申请实施例提供的屏幕光检测模型训练方法,可以通过N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型,训练样本包括了第一显示参数,以及在目标环境条件下,且目标显示区域按第一显示参数进行显示时,通过光敏传感器获得的第一屏幕光参数。如此,屏幕光检测模型可以在目标显示区域处于各类显示状态时,均可以较为准确地预测得到屏幕光参数。而在后续的应用中,该预测的屏幕光参数可以用于对光敏传感器获得的光检测值进行补偿,进而能够比较准确地得到环境光参数。
附图说明
图1a~图1b是相关技术中电子设备的结构示例图;
图1b是相关技术中电子设备的侧视图的示例图;
图2a~图2c是相关技术中电子设备的状态栏的示例图;
图3是本申请实施例提供的屏幕光检测模型训练方法的流程示意图;
图4a~图4c是目标显示区域的显示状态的示例图;
图5是待训练的神经网络的架构示意图;
图6是本申请实施例提供的环境光检测方法的流程示意图;
图7是本申请实施例提供的屏幕光检测模型训练装置的结构示意图;
图8是本申请实施例提供的环境光检测装置的结构示意图;
图9是本申请实施例提供的电子设备的结构示意图;
图10是实现本申请实施例的一种电子设备的硬件结构示意图
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。
如图1a与图1b所示,图1a与图1b是相关技术中的一种电子设备的结构示意图,该电子设备主要包括玻璃盖板11、屏幕12、扩散片13、光敏传感器14以及主板15。
其中,光敏传感器14可以用于将光信号转换成电信号,以实现对光检测值的获取。在一些示例中,光检测值可以是光敏传感器14中产生的电流或电压值,或者也可以是对这些电流值或电压值进行处理后得到的光强等等。
而主板15则可以对光敏传感器14获得的光检测值进行进一步的处理,并用于其他控制功能。
一般来说,光敏传感器14在接收光信号的过程中,可能会接收到环境光和屏幕12发出的屏幕光。
如图1b所示,在光敏传感器14位于屏幕12的下方时,环境光可以依次穿透玻璃盖板11、屏幕12以及扩散片13后,到达光敏传感器14。而屏幕12发出的屏幕光主要是透过玻璃盖板11后传播到外部环境中,而少部分光线则可以穿透扩散片13后到达光敏传感器14。
当然,在另一些电子设备中,光敏传感器14也可以并非位于屏幕12下方。例如,屏幕12上可能存在开口或凹陷,光敏传感器14在屏幕12上的垂直投影,可以是位于这些开口或凹陷中。然而,在这些电子设备中,光敏传感器14依然可能接收到周边屏幕区域发出的光线。
在一些应用场景下,电子设备可以需要获取环境光参数,而受到屏幕12发光的影响,光敏传感器14可能同时接收到环境光与屏幕光,进而导致通过光敏传感器14获得得到的光检测值并不能准确地反映实际的环境光状态,即电子设备获取的环境光参数可能不够准确。
为便于说明,可以将电子设备在对环境光参数进行获取时,由屏幕光带来的光敏传感器14的光检测值的变化称为检测误差。为了比较准确地获取环境光参数,往往需要对这部分检测误差进行校正。
相关技术中,为了对监测误差进行校正,通过会预先获取屏幕处于预设的 显示状态下的屏幕光参数,并建立显示状态与屏幕光参数之间的对应关系。在实际应用中,可以根据屏幕的显示状态,以及该对应关系,来确定屏幕光参数,并使用屏幕光参数对光敏传感器获得的光检测值进行补偿,得到环境光参数。
参见图2a~图2c,在一些应用场景下,电子设备可以是处于竖屏显示的状态。然而,屏幕12中与光敏传感器14位置匹配的显示区域(以下简称目标显示区域)的显示内容可以存在差异。
比如,目标显示区域可以显示状态栏的部分内容,在图2a中,目标显示区域中各个像素单元的显示颜色可以是相同的。而在图2b与图2c中,目标显示区域中的像素单元的显示颜色可以存在多种,而且随着状态栏图标的变化,目标显示区域对应的显示颜色也可能发生相应的变化。
在另一些应用场景下,电子设备可能是处于横屏显示的状态,此时,目标显示区域的显示内容可能更加多样。
然而,一般来说,上述的检测误差主要受到屏幕12中的目标显示区域的显示状态的影响。
综上可见,通过建立显示状态与屏幕光参数之间的对应关系,以对光检测值进行补偿得到环境光参数的方式,难以对显示状态进行穷举,进而导致在一些显示状态下得到的环境光参数不够准确。
为解决以上问题,本申请实施例提供了一种屏幕光检测模型训练方法、环境光检测方法及装置。下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的屏幕光检测模型训练方法、环境光检测方法及装置进行详细地说明。
如图3所示,本申请实施例提供的屏幕光检测模型训练方法,包括:
步骤301,获取N个训练样本,训练样本包括第一显示参数和第一屏幕光参数,第一屏幕光参数为在目标环境条件下,且目标显示区域按第一显示参数显示时,通过光敏传感器获得的光检测值,目标环境条件包括环境光强度小于或等于预设光强值,目标显示区域为屏幕中与光敏传感器位置匹配的显示区 域,第一显示参数为目标显示区域的显示参数,N为大于1的整数;
步骤302,通过N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型。
本申请实施例提供的屏幕光检测模型训练方法,可以通过N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型,训练样本包括了第一显示参数,以及在目标环境条件下,且目标显示区域按第一显示参数进行显示时,通过光敏传感器获得的第一屏幕光参数。如此,屏幕光检测模型可以在目标显示区域处于各类显示状态时,均可以较为准确地预测得到屏幕光参数。而在后续的应用中,该预测的屏幕光参数可以用于对光敏传感器获得的光检测值进行补偿,进而能够比较准确地得到环境光参数。
本申请实施例提供的屏幕光检测模型训练方法,可以是应用于服务器或者电子设备。
比如,该方法可以应用在服务器中,服务器使用N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型后,服务器可以将屏幕光检测模型发送至至少一个电子设备;或者服务器也可以处理电子设备发送的显示参数,并将处理得到的屏幕光参数发送至电子设备。
再比如,该方法也可以应用于例如移动终端或者个人电脑等类型电子设备中,在电子设备中训练得到屏幕光检测模型后,直接用于后续确定屏幕光参数;或者,电子设备也可以将屏幕光检测模型发送至其他电子设备。
为了简化说明,以下主要以屏幕光检测模型训练方法应用于电子设备为例进行说明。
在步骤301中,电子设备可以获取多个训练样本。其中,训练样本中的第一显示参数可以包括亮度参数或颜色参数等。
在一个示例中,第一显示参数可以直接从电子设备的主板中获取。比如,主板中可以记录有用户对亮度的设置参数,电子设备可以直接从主板中提取亮度的设置参数,作为亮度参数。类似地,电子设备也可以从主板中提取颜色参 数等。
如上文所示的,第一显示参数可以是目标显示区域的显示参数,也就是屏幕中与光敏传感器位置匹配的显示区域的显示参数。
目标显示区域可以根据实际需要进行设定。比如,对于光敏传感器位于屏幕下方的电子设备,目标显示区域可以是光敏传感器在屏幕上的投影所占据的显示区域,或者与该投影外接的矩形显示区域,或者沿投影的轮廓向外偏移预设距离后围合的显示区域等,此处不作具体限定。若对于光敏传感器未处于屏幕下方的电子设备,则可以将目标显示区域约定为位于光敏传感器预设距离范围内的显示区域。
当电子设备处于目标环境条件下,且目标显示区域按照第一显示参数进行显示时,光敏传感器可以获取第一屏幕光参数。如上文所示的,光检测值可以是光敏传感器中产生的电流或电压值,或者也可以是对这些电流值或电压值进行处理后得到的光强等等;相应地,各个第一屏幕光参数的单位可以是光学单位或者电学单元等,此处不做具体限定。
容易理解的是,当电子设备处于目标环境条件时,可以认为通过电子设备中的光敏传感器获得的光检测值为对屏幕光的光检测值。此处的目标环境条件可以是环境光的强度小于或等于一预设光强值等。
而在进行第一屏幕光参数的获取之前,可以使得屏幕处于熄屏状态以获取环境光的强度(对应环境光参数),并判断环境光强度是否小于或等于预设光强值。当然,实际应用中,也可以使用独立的传感器对环境光进行检测,以判断环境光的强度是否小于或等于预设光强值。
为简化说明,可以将目标显示区域按照一种第一显示参数进行显示时,称为目标显示区域处于一种显示状态。
结合上文可见,在电子设备处于目标环境条件的基础上,当目标显示区域处于一种显示状态时,光敏传感器可以获取到相应的屏幕光的光检测值(即第一屏幕光参数)。将该显示状态下的第一显示参数与第一屏幕光参数进行关联, 可以获得一个训练样本。而其他的训练样本可以通过类似的方式获得,此处不做赘述。
在步骤302中,可以基于N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型。
对于任一个训练样本,第一屏幕光参数在一定程度上可以认为是对第一显示参数的标识,待训练的神经网络可以对第一显示参数进行处理,并输出一预测值,若该预测值与第一屏幕光参数相同或相近,说明待训练的神经网络的预测结果比较准确;相反地,若预测值与第一屏幕光参数相差较大,说明待训练的神经网络的预测结果不够准确。
而预测结果的准确与否,可以体现在待训练的神经网络中预设的损失函数的损失值上,待训练的神经网络可以基于损失值,对相关的网络参数进行调整。
通过使用N个训练样本对待训练的神经网络进行训练,可以使其网络参数能够调整至较佳的状态,得到屏幕光检测模型。该较佳的状态,可以具体体现在后续在应用过程中,屏幕光检测模型能够对输入的显示参数进行处理,预测得到比较准确的屏幕光参数。
屏幕光检测模型为得到充分训练的神经网络,其可以在目标显示区域处于各种显示状态下,均可以比较准确地预测出屏幕光参数。因此,本实施例中,可以无需对目标显示区域的显示状态进行穷举,以建立显示状态与屏幕光参数之间的对应关系;在显示状态无相应的对应关系时,也可以比较准确得到屏幕光参数。将屏幕光参数作为补偿值,对光敏传感器获取的光检测值进行校正,也可以得到比较准确的环境光参数。
可选地,第一显示参数包括亮度参数与颜色参数中的至少一项。
如上文所示的,第一显示参数可以直接从电子设备的主板或者其他电子部件中进行获取。
第一显示参数可以包括多个亮度参数。这多个亮度参数可以是按照预设的抽样规则,从电子设备的亮度范围内抽样得到的。
在一个示例中,上述的抽样规则可以结合经验数据进行确定。例如,根据抽样规则,可以在用户常用的亮度范围内,以较小的抽样间隔进行抽样,在在用户不常用的亮度范围内,以较大的抽样间隔进行抽样。
当然,在实际应用中,也可以按照平均抽样的方式来抽取多个亮度参数。
结合一个具体的应用例,若将电子设备的整个亮度范围划分为2047个亮度等级,则可以按照预设的抽样规则,从这2047个亮度等级抽取若干个亮度等级,来确定上述的亮度参数。
具体来说,可以在8-208亮度等级之间按抽样间隔40进行抽样,在208到508之间按抽样间隔40进行抽样,在508到2047之间按抽样间隔40进行抽样。如此,可以在控制抽取的颜色参数的数量的同时,提高训练样本的合理性,保证训练得到的屏幕光检测模型的质量。
当然,第一显示参数可以包括颜色参数。
一般来说,颜色参数可以通过光学三原色(Red Green Blue,RGB)值进行表示。换而言之,每一颜色参数可以包括至少三类值,分别为红、绿、蓝三个颜色通道中的值,每个颜色通道中的值的取值范围为0~255。
当然,颜色参数也可以通过灰度值进行表示。即每一颜色参数可以包括一类灰度值,其取值范围为0~255。
为了简化描述,以下主要以颜色参数为RGB值为例进行说明。如上文所示的,目标显示区域可以包括多个像素单元,每一个像素单元可以对应有一RGB值,因此,一个颜色参数可以包括一组值。比如,若目标显示区域包括66×66个像素单元,则一个颜色参数可以包括66×66个RGB值。而每个RGB值又可以包括三个值,因此,一个颜色参数可以通过66×66×3的数值矩阵进行表示。
通过对66×66个像素单元分别分配相应的RGB值,可以得到一个颜色参数。在实际应用中,不同训练样本的颜色参数可以相同也可以存在不同。
在一个实施方式中,第一显示参数可以同时包括亮度参数与颜色参数。结 合上文的举例,多个亮度参数与多个颜色参数可以自由组合,以形成N个第一显示参数。而通过光敏传感器可以获取目标显示区域在以各个第一显示参数进行显示时的第一屏幕光参数。将第一显示参数与第一屏幕光参数进行关联,进而得到N个训练样本。
一般来说,亮度参数可以认为是屏幕的整体亮度,而颜色参数可以对应目标显示区域的局部的显示内容,这两者均可能对光敏传感器的光检测值造成影响。第一显示参数同时包括亮度参数与颜色参数,可以比较全面地考虑对第一屏幕光参数带来影响的因素,进而也使得后续得到的屏幕光检测模型能够比较准确地预测屏幕光参数。
可选地,目标显示区域包括P个目标像素单元,第一显示参数包括与P个目标像素单元一一对应的P个颜色参数,P为大于1的整数;
N个训练样本中,至少部分训练样本包括的第一显示参数中存在至少两种颜色参数。
结合上文中的举例,目标显示区域可以包括66×66个像素单元,这66×66个像素单元可以对应P个目标像素单元,其中,P=66×66。每一个目标像素单元对应的颜色参数,可以是该目标像素单元的RGB值或者灰度值,以下将主要以RGB值为了进行说明。
若目标显示区域显示的为纯色,即目标显示区域各个目标像素单元显示的为同一种颜色。具体来说,66×66个目标像素单元中,各个目标像素单元的RGB值均可以是相等的。
若目标显示区域显示的并非纯色,则目标显示区域的66×66个目标像素单元,至少有两个目标像素单元的RGB值是不相等的。
本实施例中,N个训练样本中,至少部分训练样本包括的第一显示参数中存在至少两种颜色参数,也就是说,存在至少一个训练样本,其包括的第一显示参数中,至少两个目标像素单元的RGB值是不相等的。
在实际应用中,在一个第一显示参数中,66×66个目标像素单元的RGB 值,可以对应了两种以上的不等的RGB值,或者说对应两种以上的发光颜色。
为简化说明,以下可以将包括有至少两种颜色参数的第一显示参数称为第三显示参数,并且以各第三显示参数所包括P个颜色参数中,存在两种RGB值为例进行说明,两种RGB值可以分别对应为白色光线和灰色光线。
如图4a至图4c所示,这些附图为目标显示区域的一些显示状态的示例图。在图4a至图4c中,圆形表示光敏传感器在屏幕上的垂直投影的外轮廓,而目标显示区域为该圆形的外接正方形,对应了66×66个目标像素单元。
在图4a中,左侧的60列目标像素单元可以发出白色光线,右侧的6列发出灰色光线;在图4b中,左侧的30列目标像素单元可以发出白色光线,右侧的36列发出灰色光线;在图4c中,66列目标像素单元均发出灰色光线。
可见,当目标显示区域处于图4a或图4b的显示状态时,对应得到的第一显示参数即上述的第三显示参数。而目标显示区域处于图4c的显示状态时,各个目标像素单元的RGB值是相等的。
当然,在实际应用中,目标显示区域的显示状态,例如个目标像素单元的发光颜色的种类、数量与分布均可以根据需要进行选择。
本实施例中,N个训练样本所包括的N个第一显示参数中存在至少一个第三显示参数,有助于提高训练得到的屏幕光检测模型的泛化能力,即屏幕光检测模型能够有效针对目标显示区域的多种显示状态进行屏幕光参数的预测。
可选地,待训练的神经网络包括第一解码器与第二解码器;
通过N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型,包括:
通过第一解码器对训练样本进行卷积处理,得到目标特征图;
通过第二解码器对目标特征图进行卷积处理,得到向量表达;
将向量表达与第一屏幕光参数输入至预设损失函数,获得损失值;
在损失值小于损失值阈值的情况下,得到屏幕光检测模型。
以下结合一具体应用例,来对本实施例中的待训练的神经网络的架构以及 工作过程进行说明。
如图5所示,该待训练的神经网络可以第一解码器与第二解码器,其中,第一解码器包括三层用于输出特征图的神经网络,记为三层第一神经网络,第二解码器包括两层用于输出特征向量的神经网络,记为两层第二神经网络,图5中对应为全连接层Dense。
各第一神经网络均可以包括依次连接的深度可分离卷积网络(Depthwise separable convolution)、归一化层(Batchnorm)、线性整流函数(ReLu)以及最大池化层(MaxPool)。
第一解码器的输入端可以接收第一显示参数,每一第一显示参数可以是一66×66×4的数据矩阵,其中,66×66对应了目标显示区域的目标像素单元的数量,而4则分别对应了红、绿、蓝三个颜色通道中的值以及亮度参数。
第一显示参数输入到第一层第一神经网络,该层第一神经网络的深度可分离卷积网络使用大小为3×3,数量为64的卷积核对第一显示参数进行卷积。将卷积结果进行归一化,然后使用线性整流函数进行非线性激活。最后使用最大池化输出第一特征图。
将第一特征图输入到第二层第一神经网络,该层第一神经网络的深度可分离卷积网络使用大小为3×3,数量为32的卷积核对第一特征图进行卷积。将卷积结果进行归一化,然后使用线性整流函数进行非线性激活。最后使用最大池化输出第二特征图。
将第二特征图输入到第三层第一神经网络,该层第一神经网络的深度可分离卷积网络使用大小为3×3,数量为32的卷积核对第二特征图进行卷积。将卷积结果进行归一化,然后使用线性整流函数进行非线性激活。最后使用最大池化输出第三特征图。该第三特征图可以对应上述的目标特征图。
将第三特征图输入到第一层第二神经网络,该层第二神经网络将第三特征图展开为向量,并输入到全连接层。全连接层的节点个数为128。使用线性整流函数进行非线性激活,输出第一向量。
将第一向量输入到第二层第二神经网络的全连接层。全连接层的节点个数为1。使用线性整流函数进行非线性激活,输出对第一显示参数的预测值,对应上述的向量表达。
待训练的神经网络中还可以存在预设损失函数,将上述的向量表达与第一屏幕光参数输入至预设损失函数,可以计算得到损失值。
一般来说,向量表达与第一屏幕光参数的差异越大,预设损失函数的损失值越大,反之亦然。而根据损失值,可以反向对待训练的神经网络的网络参数进行调节,以使得后续训练过程得到的损失值趋向不断减小,直到损失值小于预设的损失值阈值。也就是说,以损失值小于损失值阈值为目标,训练待训练的神经网络,可以得到屏幕光检测模型。
在实际应用中,上述待训练的神经网络的架构或者超参数可以根据实际需要进行调整,能够通过训练获得屏幕光检测模型即可。
如图6所示,本申请实施例还提供了一种环境光检测方法,包括:
步骤601,获取目标显示区域的第二显示参数、光检测值以及屏幕光检测模型;光检测值为通过光敏传感器获得,屏幕光检测模型为根据上述屏幕光检测模型训练方法训练得到;
步骤602,通过屏幕光检测模型对第二显示参数进行处理,得到第二屏幕光参数;
步骤603,根据第二屏幕光参数与光检测值,确定环境光参数。
本申请实施例提供的环境光检测方法中,屏幕光检测模型为通过屏幕光检测模型训练方法训练得到的,可以针对目标显示区域在各种显示状态下的第二显示参数进行处理,并能够得到比较准确的第二屏幕光参数;根据第二屏幕光参数与光检测值,确定的环境光参数,可以有效克服屏幕光对环境光参数带来的检测误差,提高环境光参数的准确度。
以下针对根据第二屏幕光参数与光检测值,确定环境光参数的原理进行举例说明。
结合图1a和图1b,环境光经过玻璃盖板以及屏幕等入射至光敏传感器。设这部分能够被探测的环境光的强度为x 1。环境光在玻璃盖板、屏幕以及空气间隙等介质中传播,以及被光敏传感器探测的过程记为:
s=g(x 1)                    (1)
其中,g()表示环境光在传播与探测过程中的各类因素对测量结果的影响,表示光敏传感器的测量结果,对应环境光参数。
当屏幕发光时,屏幕发出的光的一部分会经过介质传播,并被光敏传感器探测到。假设有效区域的屏幕(对应目标显示区域)发出的光的强度为x 2,那么其中一部分光经过介质传播并被探测的过程为:
n=h(x 2)                       (2)
其中,h()表示屏幕发光的一部分的传播与探测过程中的各类因素对测量结果的影响,n表示光敏传感器对屏幕发光的测量结果,对应屏幕光参数。
当环境光和屏幕发光同时存在时,光敏传感器的测量结果记为y。假设环境光和屏幕发光对最后的探测结果满足线性叠加关系,由式(1)和(2)得到整个探测过程为:
y=s+n=g(x 1)+h(x 2)                (3)
那么屏幕发光产生的测量分量n可以认为是叠加到期望得到的环境光测量结果s上的加性噪声。
结合上一实施例,通过光敏传感器获得的光检测值对应为y;通过屏幕光检测模型对第二显示参数进行处理,得到第二屏幕光参数对应为n。则将y中的噪声n进行去除,可以保留比较准确的环境光测量值。
在一个示例中,将y中的噪声n进行去除可以通过预设的补偿算法实现,比如,在式(3)的限定下,补偿算法可以对应(y-n)的计算方式。在实际应用中,该补偿算法也可以根据需要设定为其他的计算方式,此处不做一一举例说明。
如上文所示的,屏幕光检测模型可以是在服务器或电子设备上训练得到, 这些服务器或电子设备可以将屏幕光检测模型发送至其他电子设备。不同的电子设备之间,屏幕发光性能可能存在差异,光敏传感器的测量精度也可能存在差异,这导致在相同的显示参数下进行显示时,不同电子设备测得的光检测值可能存在差异。
或者,不同电子设备中,光敏传感器的位置可能存在差异,而目标显示区域在屏幕中的相对位置是确定的,这样也会导致不同电子设备测得的光检测值存在差异。
为克服不同电子设备在同一显示参数的情况下,光敏传感器测得的光检测值存在较大差异的问题,可选地,上述步骤603,根据第二屏幕光参数与光检测值,确定环境光参数,可以包括:
获取修正系数;
根据修正系数,修正第二屏幕光参数;
通过修正后的第二屏幕光参数对光检测值进行补偿,得到环境光参数。
本实施例中,修正系数可以是预先存储在电子设备中的。其具体的获取过程可以参见如下举例。
在一个举例中,可以将用于屏幕光检测模型训练的电子设备(以下简称第一电子设备)与待获取修正系数的电子设备(以下简称第二电子设备),置于同一环境条件与同一显示状态中。
比如,将第一电子设备与第二电子设备同时置于光线均匀的环境中;同时,将两者的显示内容以及显示亮度调节为一致。分别记录两电子设备中光敏传感器测量的光检测值。调节环境中光线的强度,多次记录两电子设备中光敏传感器测得的光检测值。然后,根据这些记录的光检测值进行整理计算,得到修正系数。
当然,修正系数也可以通过其他方式进行获取,此处不做一一举例。
在一个示例中,修正系数可以是一次获取并存储,后续应用的过程中,直接调用该修正系数对第二屏幕光参数进行修正即可,而无需重新测试计算修正 系数。
修正后的第二屏幕光参数,可以比较准确地反映第二电子设备的屏幕光实际的带来的环境光检测误差,通过修正后的第二屏幕光参数对光检测值进行补偿,可以进一步提高得到的环境光参数的准确性。
可选地,获取修正系数的步骤可以具体包括:
获取第三屏幕光参数,第三屏幕光参数为在目标环境条件下,且目标显示区域按第四显示参数进行显示时,通过光敏传感器获得的光检测值;
通过屏幕光检测模型对第四显示参数进行处理,得到第四屏幕光参数;
根据第三屏幕光参数与第四屏幕光参数,计算修正系数。
如上文所示的,当电子设备处于目标环境条件下,例如所处环境的环境光光强小于或等于光强阈值时,可以认为通过电子设备中的光敏传感器获得的光检测值为屏幕光的光检测值。
本实施例中,第四显示参数可以是目标显示区域处于任一显示状态时的显示参数。在屏幕按第四显示参数进行显示时,若将电子设备置于环境光光强小于或等于光强阈值的环境中,则光敏传感器获得的光检测值即为第三屏幕光参数。
而上述的屏幕光检测模型可以对第四显示参数进行处理,得到第四屏幕光参数。
在一个示例中,可以将第三屏幕光参数与第四屏幕光参数的比值,作为修正系数。
而在另一个示例中,可以使目标显示区域依次处于多种显示状态,在每一显示状态下,获取第三屏幕光参数与第四屏幕光参数以计算各显示状态下的修正系数;然后取这些修正系数的中值、平均值或者众数,作为最终的修正系数。
本实施例中,通过光敏传感器直接获取第三屏幕光参数,根据第三屏幕光参数,以及通过屏幕光检测模型处理得到的第四屏幕光参数,可以比较高效地计算得到修正系数。
需要说明的是,本申请实施例提供的屏幕光检测模型训练方法,执行主体可以为屏幕光检测模型训练装置,或者该屏幕光检测模型训练装置中的用于执行屏幕光检测模型训练方法的控制模块。本申请实施例中以屏幕光检测模型训练装置执行屏幕光检测模型训练方法为例,说明本申请实施例提供的屏幕光检测模型训练装置。
如图7所示,本申请实施例提供的屏幕光检测模型训练装置700,包括:
第一获取模块701,用于获取N个训练样本,训练样本包括第一显示参数和第一屏幕光参数,第一屏幕光参数为在目标环境条件下,且目标显示区域按第一显示参数显示时,通过光敏传感器获得的光检测值,目标环境条件包括环境光强度小于或等于预设光强值,目标显示区域为屏幕中与光敏传感器位置匹配的显示区域,第一显示参数为目标显示区域的显示参数,N为大于1的整数;
训练模块702,用于通过N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型。
可选地,目标显示区域包括P个目标像素单元,第一显示参数包括与P个目标像素单元一一对应的P个颜色参数,P为大于1的整数;
N个训练样本中,至少部分训练样本包括的第一显示参数中存在至少两种颜色参数。
本申请实施例提供的屏幕光检测模型训练装置700,基于N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型可以适用于目标显示区域在各类显示状态下,对屏幕光参数进行准确预测,进而有助于提高后续得到的环境光参数的准确性。
类似地,本申请实施例提供的环境光检测方法,执行主体可以为环境光检测装置,或者该环境光检测装置中的用于执行环境光检测方法的控制模块。本申请实施例中以环境光检测装置执行环境光检测方法为例,说明本申请实施例提供的环境光检测装置。
如图8所示,本申请实施例还提供了一种环境光检测装置800,包括:
第二获取模块801,用于获取目标显示区域的第二显示参数、光检测值以及屏幕光检测模型;光检测值为通过光敏传感器获得,屏幕光检测模型为根据上述屏幕光检测模型训练方法训练得到;
处理模块802,用于通过屏幕光检测模型对第二显示参数进行处理,得到第二屏幕光参数;
确定模块803,用于根据第二屏幕光参数与光检测值,确定环境光参数。
可选地,确定模块803,包括:
第一获取单元,用于获取修正系数;
修正单元,用于根据修正系数,修正第二屏幕光参数;
补偿单元,用于通过修正后的第二屏幕光参数对光检测值进行补偿,得到环境光参数。
可选地,第一获取单元,可以包括:
获取子单元,用于获取第三屏幕光参数,第三屏幕光参数为在目标环境条件下,且目标显示区域按第四显示参数进行显示时,通过光敏传感器获得的光检测值;
处理子单元,用于通过屏幕光检测模型对第四显示参数进行处理,得到第四屏幕光参数;
计算子单元,用于根据第三屏幕光参数与第四屏幕光参数,计算修正系数。
本申请实施例提供的环境光检测装置800中,屏幕光检测模型为通过屏幕光检测模型训练方法训练得到的,可以针对目标显示区域在各种显示状态下的第二显示参数进行处理,并能够得到比较准确的第二屏幕光参数;根据第二屏幕光参数与光检测值,确定的环境光参数,可以有效克服屏幕光对环境光参数带来的检测误差,提高环境光参数的准确度。而通过修正系数修正第二屏幕光参数,可以补偿不同电子设备获取的光检测值的差异,进一步提高环境光参数的准确度。
本申请实施例中的屏幕光检测模型训练装置与环境光检测装置可以是装 置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例中的屏幕光检测模型训练装置与环境光检测装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。
本申请实施例提供的屏幕光检测模型训练装置能够实现图3至图5的方法实施例实现的各个过程,本申请实施例提供的环境光检测装置能够实现图6的方法实施例实现的各个过程,为避免重复,这里不再赘述。
可选地,如图9所示,本申请实施例还提供一种电子设备900,包括处理器901,存储器902,存储在存储器902上并可在处理器901上运行的程序或指令,该程序或指令被处理器901执行时实现上述屏幕光检测模型训练方法或环境光检测方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,本申请实施例中的电子设备包括上述的移动电子设备和非移动电子设备。
图10为实现本申请实施例的一种电子设备的硬件结构示意图。
该电子设备1000包括但不限于:射频单元1001、网络模块1002、音频输出单元1003、输入单元1004、传感器1005、显示单元1006、用户输入单元1007、接口单元1008、存储器1009、以及处理器1010等部件。
本领域技术人员可以理解,电子设备1000还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1010逻辑相连,从而 通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图10中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
其中,处理器1010,用于获取N个训练样本,训练样本包括第一显示参数和第一屏幕光参数,第一屏幕光参数为在目标环境条件下,且目标显示区域按第一显示参数显示时,通过光敏传感器获得的光检测值,目标环境条件包括环境光强度小于或等于预设光强值,目标显示区域为屏幕中与光敏传感器位置匹配的显示区域,第一显示参数为目标显示区域的显示参数,N为大于1的整数;通过N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型。
本申请实施例提供的电子设备,可以通过N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型,一个训练样本包括了一个第一显示参数,以及在目标环境条件下,且目标显示区域按第一显示参数进行显示时,通过光敏传感器获得的第一屏幕光参数。如此,屏幕光检测模型可以在目标显示区域处于各类显示状态时,均可以较为准确地预测得到屏幕光参数。而在后续的应用中,该预测的屏幕光参数可以用于对光敏传感器获得的光检测值进行补偿,进而能够比较准确地得到环境光参数。
可选地,目标显示区域包括P个目标像素单元,第一显示参数包括与P个目标像素单元一一对应的P个颜色参数,P为大于1的整数;
N个训练样本中,至少部分训练样本包括的第一显示参数中存在至少两种颜色参数。
可选地,处理器1010,还可以用于获取目标显示区域的第二显示参数、光检测值以及屏幕光检测模型;光检测值为通过光敏传感器获取,屏幕光检测模型为根据上述的屏幕光检测模型训练方法训练得到;通过屏幕光检测模型对第二显示参数进行处理,得到第二屏幕光参数;根据第二屏幕光参数与光检测值,确定环境光参数。
可选地,处理器1010,还可以用于获取修正系数;根据修正系数,修正第 二屏幕光参数;通过修正后的第二屏幕光参数对光检测值进行补偿,得到环境光参数。
可选地,处理器1010,还可以用于获取第三屏幕光参数,第三屏幕光参数为在目标环境条件下,且目标显示区域按第四显示参数进行显示时,通过光敏传感器获得的光检测值;通过屏幕光检测模型对第四显示参数进行处理,得到第四屏幕光参数;根据第三屏幕光参数与第四屏幕光参数,计算修正系数。
应理解的是,本申请实施例中,输入单元1004可以包括图形处理器(Graphics Processing Unit,GPU)10041和麦克风10042,图形处理器10041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1006可包括显示面板10061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板10061。用户输入单元1007包括触控面板10071以及其他输入设备10072。触控面板10071,也称为触摸屏。触控面板10071可包括触摸检测装置和触摸控制器两个部分。其他输入设备10072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器1009可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器1010可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1010中。
本申请实施例还提供一种可读存储介质,可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述屏幕光检测模型训练方法或环境光检测方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,处理器为上述实施例中的电子设备中的处理器。可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。
本申请实施例另提供了一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现上述屏幕光检测模型训练方法或环境光检测方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保 护的范围情况下,还可做出很多形式,均属于本申请的保护之内。

Claims (15)

  1. 一种屏幕光检测模型训练方法,包括:
    获取N个训练样本,所述训练样本包括第一显示参数和第一屏幕光参数,所述第一屏幕光参数为在目标环境条件下,且目标显示区域按所述第一显示参数显示时,通过光敏传感器获得的光检测值,所述目标环境条件包括环境光强度小于或等于预设光强值,所述目标显示区域为屏幕中与所述光敏传感器位置匹配的显示区域,所述第一显示参数为所述目标显示区域的显示参数,N为大于1的整数;
    通过所述N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型。
  2. 根据权利要求1所述的方法,其中,所述目标显示区域包括P个目标像素单元,所述第一显示参数包括与所述P个目标像素单元一一对应的P个颜色参数,P为大于1的整数;
    所述N个训练样本中,至少部分所述训练样本包括的第一显示参数中存在至少两种颜色参数。
  3. 一种环境光检测方法,包括:
    获取目标显示区域的第二显示参数、光检测值以及屏幕光检测模型;所述光检测值为通过光敏传感器获得,所述屏幕光检测模型为根据如权利要求1或2所述屏幕光检测模型训练方法训练得到;
    通过所述屏幕光检测模型对所述第二显示参数进行处理,得到第二屏幕光参数;
    根据所述第二屏幕光参数与所述光检测值,确定环境光参数。
  4. 根据权利要求3所述的方法,其中,所述根据所述第二屏幕光参数与所述光检测值,确定环境光参数,包括:
    获取修正系数;
    根据所述修正系数,修正所述第二屏幕光参数;
    通过修正后的所述第二屏幕光参数对所述光检测值进行补偿,得到环境光参数。
  5. 根据权利要求4所述的方法,其中,所述获取修正系数,包括:
    获取第三屏幕光参数,所述第三屏幕光参数为在目标环境条件下,且所述目标显示区域按第四显示参数进行显示时,通过所述光敏传感器获得的光检测值;
    通过所述屏幕光检测模型对所述第四显示参数进行处理,得到第四屏幕光参数;
    根据所述第三屏幕光参数与所述第四屏幕光参数,计算所述修正系数。
  6. 一种屏幕光检测模型训练装置,包括:
    第一获取模块,用于获取N个训练样本,所述训练样本包括第一显示参数和第一屏幕光参数,所述第一屏幕光参数为在目标环境条件下,且目标显示区域按所述第一显示参数显示时,通过光敏传感器获得的光检测值,所述目标环境条件包括环境光强度小于或等于预设光强值,所述目标显示区域为屏幕中与所述光敏传感器位置匹配的显示区域,所述第一显示参数为所述目标显示区域的显示参数,N为大于1的整数;
    训练模块,用于通过所述N个训练样本对待训练的神经网络进行训练,得到屏幕光检测模型。
  7. 根据权利要求6所述的装置,其中,所述目标显示区域包括P个目标像素单元,所述第一显示参数包括与所述P个目标像素单元一一对应的P个颜色参数,P为大于1的整数;
    所述N个训练样本中,至少部分所述训练样本包括的第一显示参数中存在至少两种颜色参数。
  8. 一种环境光检测装置,包括:
    第二获取模块,用于获取目标显示区域的第二显示参数、光检测值以及屏幕光检测模型;所述光检测值为通过光敏传感器获得,所述屏幕光检测模型为根据如权利要求1或2所述屏幕光检测模型训练方法训练得到;
    处理模块,用于通过所述屏幕光检测模型对所述第二显示参数进行处理,得到第二屏幕光参数;
    确定模块,用于根据所述第二屏幕光参数与所述光检测值,确定环境光参数。
  9. 根据权利要求8所述的装置,其中,所述确定模块,包括:
    第一获取单元,用于获取修正系数;
    修正单元,用于根据所述修正系数,修正所述第二屏幕光参数;
    补偿单元,用于通过修正后的所述第二屏幕光参数对所述光检测值进行补偿,得到环境光参数。
  10. 根据权利要求9所述的装置,其中,所述第一获取单元,包括:
    获取子单元,用于获取第三屏幕光参数,所述第三屏幕光参数为在目标环境条件下,且所述目标显示区域按第四显示参数进行显示时,通过所述光敏传感器获得的光检测值;
    处理子单元,用于通过所述屏幕光检测模型对所述第四显示参数进行处理,得到第四屏幕光参数;
    计算子单元,用于根据所述第三屏幕光参数与所述第四屏幕光参数,计算所述修正系数。
  11. 一种电子设备,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1或2所述的屏幕光检测模型训练方法的步骤,或者实现如权利要求3-5任一项所述的环境光检测方法的步骤。
  12. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1或2所述的屏幕光检测模型训练方法的步骤,或者实现如权利要求3-5任一项所述的环境光检测方法的步骤。
  13. 一种芯片,包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1或2所述的屏幕光检测模型训练方法的步骤,或者实现如权利要求3-5任一项所述的环境光检测方法的 步骤。
  14. 一种计算机程序产品,所述程序产品被存储在非易失的存储介质中,所述程序产品被至少一个处理器执行以实现如权利要求1或2所述的屏幕光检测模型训练方法的步骤,或者实现如权利要求3-5任一项所述的环境光检测方法的步骤。
  15. 一种电子设备,所述电子设备被配置成执行如权利要求1或2所述的屏幕光检测模型训练方法的步骤,或者实现如权利要求3-5任一项所述的环境光检测方法的步骤。
PCT/CN2022/119722 2021-09-24 2022-09-19 屏幕光检测模型训练方法、环境光检测方法及装置 Ceased WO2023045884A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111123048.8 2021-09-24
CN202111123048.8A CN113887599A (zh) 2021-09-24 2021-09-24 屏幕光检测模型训练方法、环境光检测方法及装置

Publications (1)

Publication Number Publication Date
WO2023045884A1 true WO2023045884A1 (zh) 2023-03-30

Family

ID=79006569

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/119722 Ceased WO2023045884A1 (zh) 2021-09-24 2022-09-19 屏幕光检测模型训练方法、环境光检测方法及装置

Country Status (2)

Country Link
CN (1) CN113887599A (zh)
WO (1) WO2023045884A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116128166A (zh) * 2023-04-17 2023-05-16 广州云硕科技发展有限公司 一种用于智能交通的数据可视化处理方法及装置
CN119252159A (zh) * 2024-04-29 2025-01-03 荣耀终端有限公司 一种环境光强度的检测方法、电子设备、存储介质和芯片
CN121053902A (zh) * 2025-10-31 2025-12-02 深圳市宝莲花光电工程有限公司 正面发光led透明屏透光率与散热协同控制方法及装置

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113887599A (zh) * 2021-09-24 2022-01-04 维沃移动通信有限公司 屏幕光检测模型训练方法、环境光检测方法及装置
CN114220381B (zh) * 2022-02-22 2022-05-13 深圳灏鹏科技有限公司 显示亮度控制方法、装置、设备及存储介质
CN114894444A (zh) * 2022-05-09 2022-08-12 深圳市汇顶科技股份有限公司 屏幕漏光及环境光的检测方法、装置和电子设备
CN115931307A (zh) * 2022-12-01 2023-04-07 苏州威达智科技股份有限公司 一种视觉传感器采样参数自适应学习系统
WO2024131365A1 (zh) * 2022-12-21 2024-06-27 武汉市聚芯微电子有限责任公司 一种环境光检测方法、装置、设备及存储介质
CN116682383B (zh) * 2023-05-30 2024-05-03 惠科股份有限公司 显示面板及其背光补偿方法和显示装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210185167A1 (en) * 2019-12-16 2021-06-17 Beijing Xiaomi Mobile Software Co., Ltd. Ambient light detection method and apparatus, and storage medium
CN113188656A (zh) * 2021-06-28 2021-07-30 深圳小米通讯技术有限公司 环境光强检测方法、检测装置、电子设备和存储介质
CN113887599A (zh) * 2021-09-24 2022-01-04 维沃移动通信有限公司 屏幕光检测模型训练方法、环境光检测方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859689B (zh) * 2019-04-09 2020-07-31 Oppo广东移动通信有限公司 屏幕亮度调节方法及相关产品
CN111476759B (zh) * 2020-03-13 2022-03-25 深圳市鑫信腾机器人科技有限公司 一种屏幕表面检测方法、装置、终端及存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210185167A1 (en) * 2019-12-16 2021-06-17 Beijing Xiaomi Mobile Software Co., Ltd. Ambient light detection method and apparatus, and storage medium
CN113188656A (zh) * 2021-06-28 2021-07-30 深圳小米通讯技术有限公司 环境光强检测方法、检测装置、电子设备和存储介质
CN113887599A (zh) * 2021-09-24 2022-01-04 维沃移动通信有限公司 屏幕光检测模型训练方法、环境光检测方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116128166A (zh) * 2023-04-17 2023-05-16 广州云硕科技发展有限公司 一种用于智能交通的数据可视化处理方法及装置
CN119252159A (zh) * 2024-04-29 2025-01-03 荣耀终端有限公司 一种环境光强度的检测方法、电子设备、存储介质和芯片
CN121053902A (zh) * 2025-10-31 2025-12-02 深圳市宝莲花光电工程有限公司 正面发光led透明屏透光率与散热协同控制方法及装置

Also Published As

Publication number Publication date
CN113887599A (zh) 2022-01-04

Similar Documents

Publication Publication Date Title
WO2023045884A1 (zh) 屏幕光检测模型训练方法、环境光检测方法及装置
CN107957294B (zh) 环境光强度检测方法、装置、存储介质及电子设备
CN112449026B (zh) 一种环境光补偿方法、装置、终端及存储介质
CN109473059B (zh) 显示电流确定、补偿方法、装置、显示装置和存储介质
CN107945769A (zh) 环境光强度检测方法、装置、存储介质及电子设备
CN110619836A (zh) 显示屏处理方法、装置、存储介质及电子设备
CN108021161A (zh) 环境光强度检测方法、装置、存储介质及电子设备
CN109238460B (zh) 一种获取环境光强度的方法及终端设备
CN112229507A (zh) 环境光检测方法、装置、存储介质及移动终端
CN111292394B (zh) 一种图像配色关系确定方法和装置
KR20230011385A (ko) 환경광 검출 방법 및 전자 장치
CN112017577B (zh) 屏幕显示校准方法及装置
WO2023143510A1 (zh) 环境光检测方法及装置、显示屏补偿显示方法及装置
CN108540594A (zh) 移动终端、外界环境光强度的确定方法及装置
CN107941330A (zh) 环境光强度检测方法、装置、存储介质及电子设备
CN116092434A (zh) 调光方法、装置、电子设备及计算机可读存储介质
CN109348206A (zh) 图像白平衡处理方法、装置、存储介质及移动终端
CN114299056A (zh) 图像的瑕疵点的识别方法、瑕疵图像识别模型训练方法
CN111380610B (zh) 环境光检测方法和装置、电子设备、存储介质
CN116758861A (zh) 补偿方法、补偿装置和电子设备
CN110059627A (zh) 一种显示控制方法及终端
WO2022253263A1 (zh) 压力感应通道的校准方法、装置及电子设备
CN108494936B (zh) 一种光强度的检测方法、移动终端
CN108234893A (zh) 一种亮度调节方法、设备和计算机可读存储介质
CN114327715A (zh) 界面显示方法、界面显示装置、电子设备和可读存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 14.08.2024)

122 Ep: pct application non-entry in european phase

Ref document number: 22871930

Country of ref document: EP

Kind code of ref document: A1