Image display method and device, electronic equipment, storage medium and program product
By performing non-linear mapping and gamma correction on images in high-brightness environments, the problem of unclear screen content in high-brightness environments is solved, thereby improving image brightness and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2024-11-19
- Publication Date
- 2026-05-19
AI Technical Summary
In bright environments, the reflected light from the display screen of electronic devices is stronger than the emitted light, making the screen content difficult to see.
By acquiring ambient light intensity and performing nonlinear mapping, the gamma value and brightness of the image are adjusted to generate a target image with enhanced brightness to adapt to bright environments.
It significantly improves image brightness in bright environments, making screen content clearly visible and enhancing the user's viewing experience.
Smart Images

Figure CN122067474A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of display technology, and in particular to an image display method and apparatus, electronic device, storage medium and program product. Background Technology
[0002] When we look at the screen of an electronic device, the light entering our eyes includes the light emitted by the screen, ambient light, and the light reflected from the screen. Under normal use, the screen's light intensity must be higher than the reflected light from the environment for the screen content to be clearly visible. However, when an electronic device is in a bright environment, the reflected light from the screen is greater than the emitted light, making the screen content difficult to see. Therefore, improving display performance in bright environments is a crucial area of concern. Summary of the Invention
[0003] This disclosure provides an image display method and apparatus, an electronic device, a storage medium, and a program product.
[0004] According to a first aspect of the present disclosure, an image display method is provided, comprising:
[0005] Obtain the image to be displayed and the ambient light level of the environment in which the display screen is located;
[0006] In response to the ambient light brightness being greater than a first preset brightness threshold, the image to be displayed is non-linearly mapped based on the ambient light brightness to obtain a target image with enhanced brightness.
[0007] The target image is displayed on the screen.
[0008] In some embodiments, the step of performing nonlinear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness includes:
[0009] For each pixel in the image to be displayed, a gamma value for gamma correction is determined based on the ambient light brightness.
[0010] Gamma correction is performed based on the gamma value corresponding to the pixel and the first pixel value of the pixel in the image to be displayed to determine the corrected pixel value corresponding to the pixel; wherein, the corrected pixel value corresponding to the pixel is greater than the first pixel value corresponding to the pixel.
[0011] Based on the corrected pixel values of each pixel in the image to be displayed, a target image with enhanced brightness is obtained.
[0012] In some embodiments, the method further includes:
[0013] Determine the refresh rate of the display screen;
[0014] The step of determining the gamma value for gamma correction corresponding to a pixel based on the ambient light brightness includes:
[0015] In response to the refresh rate being greater than a preset frame rate threshold, the preset value corresponding to the ambient light brightness is used as the gamma value for gamma correction corresponding to the pixel.
[0016] In response to the refresh rate being less than or equal to the preset frame rate threshold, a blurred image of the image to be displayed is obtained, and the gamma value corresponding to the pixel is determined based on the ambient light brightness and the second pixel value of the pixel in the blurred image.
[0017] In some embodiments, determining the gamma value corresponding to a pixel based on the ambient light brightness and the second pixel value of the pixel in the blurred image includes:
[0018] Based on the ambient light intensity, a first base is determined; wherein the first base is a number greater than 1 and is positively correlated with the ambient light intensity;
[0019] Based on the ambient light intensity and the second pixel value of the pixel in the blurred image, a first index corresponding to the pixel is determined; wherein, the first index is a negative number and its absolute value is less than 1, and the first index is negatively correlated with the ambient light intensity;
[0020] Based on the first base and the first exponent corresponding to the pixel, the gamma value corresponding to the pixel is determined.
[0021] In some embodiments, determining the first base value based on the ambient light intensity includes:
[0022] In response to the ambient light brightness being greater than the first preset brightness threshold and less than the second preset brightness threshold, the first value is determined as the first base value;
[0023] In response to the ambient light brightness being greater than or equal to the second preset brightness threshold and less than the third preset brightness threshold, the second value is determined as the first base value;
[0024] In response to the ambient light brightness being greater than or equal to the third preset brightness threshold, the third value is determined as the first base value; wherein the first value is less than the second value, and the second value is less than the third value.
[0025] In some embodiments, determining the first index corresponding to a pixel based on the ambient light brightness and the second pixel value of the pixel in the blurred image includes:
[0026] A first pixel threshold is determined based on the ambient light intensity; wherein the first pixel threshold is positively correlated with the ambient light intensity.
[0027] In response to a second pixel value of a pixel being less than the first pixel threshold, a first index corresponding to the pixel is determined based on the first pixel threshold.
[0028] In response to a second pixel value being greater than or equal to the first pixel threshold, a first index corresponding to the pixel is determined based on the second pixel value; wherein the first index is negatively correlated with the first pixel threshold or the second pixel value.
[0029] In some embodiments, determining the first pixel threshold based on the ambient light brightness includes:
[0030] In response to the ambient light brightness being greater than the first preset brightness threshold and less than the second preset brightness threshold, the fourth value is determined as the first pixel threshold.
[0031] In response to the ambient light brightness being greater than or equal to the second preset brightness threshold and less than the third preset brightness threshold, the fifth value is determined as the first pixel threshold;
[0032] In response to the ambient light brightness being greater than or equal to the third preset brightness threshold, the sixth value is determined as the first pixel threshold; wherein the fourth value is less than the fifth value, and the fifth value is less than the sixth value.
[0033] In some embodiments, the method further includes:
[0034] In response to the first base being greater than a preset base threshold, a second pixel threshold and a second exponent are determined based on the first base; wherein, both the second pixel threshold and the second exponent are positively correlated with the first base;
[0035] The step of performing gamma correction based on the gamma value corresponding to the pixel and the first pixel value of the pixel in the image to be displayed, and determining the corrected pixel value corresponding to the pixel, includes:
[0036] The pixel value to be compared is determined based on the first pixel value of the pixel in the image to be displayed;
[0037] In response to the fact that the pixel value to be compared is less than the second pixel threshold, the ratio of the pixel value to be compared to the second pixel threshold is used as the second base. The pixel value to be corrected is determined based on the second base and the second exponent. The corrected pixel value corresponding to the pixel is determined based on the pixel value to be corrected and the gamma value corresponding to the pixel. Wherein, the pixel value to be corrected is less than the pixel value to be compared.
[0038] In response to the pixel value to be compared being greater than or equal to the second pixel threshold, the pixel value to be compared is taken as the pixel value to be corrected, and the corrected pixel value corresponding to the pixel is determined based on the pixel value to be corrected and the gamma value corresponding to the pixel.
[0039] In some embodiments, the image to be displayed is an image including different color channels, and the pixel value to be corrected is determined based on the first pixel value of a single color channel; determining the corrected pixel value corresponding to the pixel based on the pixel value to be corrected and the gamma value corresponding to the pixel includes:
[0040] Gamma correction is performed on the pixel value to be corrected based on the gamma value corresponding to the pixel, and the corrected pixel value of the pixel value to be corrected is determined.
[0041] The brightness enhancement coefficient corresponding to a pixel is determined based on the ratio of the corrected pixel value to the pixel value to be corrected.
[0042] Based on the brightness enhancement coefficient corresponding to each pixel, the first pixel value of each pixel in each color channel is weighted to obtain the corrected pixel value corresponding to each color channel.
[0043] In some embodiments, obtaining the blurred image of the image to be displayed includes:
[0044] The image to be displayed is compressed to obtain a compressed image;
[0045] The compressed image is filtered to obtain a filtered image;
[0046] Interpolation is performed on the filtered image to obtain a blurred image with the same size as the image to be displayed.
[0047] In some embodiments, the gamma value is less than 1; the step of performing gamma correction based on the gamma value corresponding to the pixel and the first pixel value of the pixel in the image to be displayed, to determine the corrected pixel value corresponding to the pixel, includes:
[0048] The pixel value is normalized based on the first pixel value to obtain the normalized pixel value; wherein the normalized pixel value is less than 1.
[0049] Using the normalized pixel value as the third base and the gamma value corresponding to the pixel as the third exponent, the initial corrected pixel value corresponding to the pixel is determined.
[0050] The initial corrected pixel value corresponding to the pixel is denormalized to obtain the corrected pixel value corresponding to the pixel.
[0051] In some embodiments, obtaining the ambient light intensity of the environment in which the display screen is located includes:
[0052] Obtain the ambient light intensity of the environment in which the display screen is located within a preset time period;
[0053] The step of responding to the ambient light brightness being greater than a first preset brightness threshold by performing a non-linear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness includes:
[0054] In response to the ambient light brightness being greater than a first preset brightness threshold for a preset duration, the image to be displayed is non-linearly mapped based on the ambient light brightness for the preset duration to obtain a target image with enhanced brightness.
[0055] According to a second aspect of the present disclosure, an image display apparatus is provided, comprising:
[0056] The acquisition module is configured to acquire the image to be displayed and the ambient light level of the environment in which the display screen is located;
[0057] The mapping module is configured to, in response to the ambient light brightness being greater than a first preset brightness threshold, perform non-linear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness.
[0058] The display module is configured to display the target image through the display screen.
[0059] In some embodiments, the mapping module is further configured to, for each pixel in the image to be displayed, determine a gamma value for gamma correction based on the ambient light brightness; perform gamma correction based on the gamma value corresponding to the pixel and a first pixel value of the pixel in the image to be displayed, and determine a corrected pixel value corresponding to the pixel; wherein the corrected pixel value corresponding to the pixel is greater than the first pixel value corresponding to the pixel; and obtain a target image with improved brightness based on the corrected pixel values of each pixel in the image to be displayed.
[0060] In some embodiments, the apparatus further includes:
[0061] The first determining module is configured to determine the refresh rate of the display screen;
[0062] The mapping module is further configured to, in response to the refresh rate being greater than a preset frame rate threshold, use a preset value corresponding to the ambient light brightness as the gamma value corresponding to the pixel for gamma correction; and in response to the refresh rate being less than or equal to the preset frame rate threshold, acquire a blurred image of the image to be displayed, and determine the gamma value corresponding to the pixel based on the ambient light brightness and the second pixel value of the pixel in the blurred image.
[0063] In some embodiments, the mapping module is further configured to: determine a first base number based on the ambient light intensity; wherein the first base number is a number greater than 1 and positively correlated with the ambient light intensity; determine a first exponent corresponding to the pixel based on the ambient light intensity and the second pixel value of the pixel in the blurred image; wherein the first exponent is a negative number with an absolute value less than 1 and is negatively correlated with the ambient light intensity; and determine the gamma value corresponding to the pixel based on the first base number and the first exponent corresponding to the pixel.
[0064] In some embodiments, the mapping module is further configured to: determine a first value as the first base value in response to the ambient light brightness being greater than the first preset brightness threshold and less than the second preset brightness threshold; determine a second value as the first base value in response to the ambient light brightness being greater than or equal to the second preset brightness threshold and less than the third preset brightness threshold; and determine a third value as the first base value in response to the ambient light brightness being greater than or equal to the third preset brightness threshold; wherein the first value is less than the second value, and the second value is less than the third value.
[0065] In some embodiments, the mapping module is further configured to determine a first pixel threshold based on the ambient light intensity; wherein the first pixel threshold is positively correlated with the ambient light intensity; in response to a second pixel value of a pixel being less than the first pixel threshold, a first exponent corresponding to the pixel is determined based on the first pixel threshold; in response to a second pixel value of a pixel being greater than or equal to the first pixel threshold, a first exponent corresponding to the pixel is determined based on the second pixel value; wherein the first exponent is negatively correlated with the first pixel threshold or the second pixel value.
[0066] In some embodiments, the mapping module is further configured to determine a fourth value as the first pixel threshold in response to the ambient light brightness being greater than the first preset brightness threshold and less than the second preset brightness threshold; to determine a fifth value as the first pixel threshold in response to the ambient light brightness being greater than or equal to the second preset brightness threshold and less than the third preset brightness threshold; and to determine a sixth value as the first pixel threshold in response to the ambient light brightness being greater than or equal to the third preset brightness threshold; wherein the fourth value is less than the fifth value, and the fifth value is less than the sixth value.
[0067] In some embodiments, the apparatus further includes:
[0068] The second determining module is configured to, in response to the first base being greater than a preset base threshold, determine a second pixel threshold and a second exponent based on the first base; wherein the second pixel threshold and the second exponent are both positively correlated with the first base;
[0069] The mapping module is further configured to: determine a pixel value to be compared based on a first pixel value of a pixel in the image to be displayed; in response to the pixel value to be compared being less than a second pixel threshold, use the ratio of the pixel value to be compared to the second pixel threshold as a second base, determine a pixel value to be corrected based on the second base and the second exponent, and determine a corrected pixel value corresponding to the pixel based on the pixel value to be corrected and the gamma value corresponding to the pixel; wherein the pixel value to be corrected is less than the pixel value to be compared; in response to the pixel value to be compared being greater than or equal to the second pixel threshold, use the pixel value to be compared as the pixel value to be corrected, and determine a corrected pixel value corresponding to the pixel based on the pixel value to be corrected and the gamma value corresponding to the pixel.
[0070] In some embodiments, the image to be displayed is an image including different color channels, and the pixel value to be corrected is determined based on the first pixel value of a single color channel; the mapping module is further configured to perform gamma correction on the pixel value to be corrected based on the gamma value corresponding to the pixel, and determine the corrected pixel value of the pixel value to be corrected; determine the brightness enhancement coefficient corresponding to the pixel based on the ratio of the corrected pixel value to the pixel value to be corrected; and weight the first pixel value of the pixel in each color channel based on the brightness enhancement coefficient corresponding to the pixel to obtain the corrected pixel value corresponding to each color channel.
[0071] In some embodiments, the acquisition module is further configured to compress the size of the image to be displayed to obtain a compressed image; filter the compressed image to obtain a filtered image; and perform interpolation processing based on the filtered image to obtain a blurred image with the same size as the image to be displayed.
[0072] In some embodiments, the gamma value is less than 1; the mapping module is further configured to perform normalization processing based on the first pixel value of the pixel to obtain a normalized pixel value; wherein the normalized pixel value is less than 1; using the normalized pixel value as the third base and the gamma value corresponding to the pixel as the third exponent, the initial correction pixel value corresponding to the pixel is determined; the initial correction pixel value corresponding to the pixel is denormalized to obtain the correction pixel value corresponding to the pixel.
[0073] In some embodiments, the acquisition module is further configured to acquire the ambient light brightness of the environment in which the display screen is located within a preset time period; the step of performing nonlinear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with improved brightness in response to the ambient light brightness being greater than a first preset brightness threshold includes: performing nonlinear mapping on the image to be displayed based on the ambient light brightness within the preset time period to obtain a target image with improved brightness in response to the ambient light brightness being continuously greater than the first preset brightness threshold within the preset time period.
[0074] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0075] processor;
[0076] Memory used to store computer programs or instructions;
[0077] The processor executes the computer program or instructions to implement the steps of the method described in the first aspect above.
[0078] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, the storage medium storing a computer program or instructions that, when executed by a processor, implement the steps of the method described in the first aspect above.
[0079] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implement the steps of the method described in the first aspect above.
[0080] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0081] In this embodiment of the disclosure, when the ambient light brightness is greater than a first preset brightness threshold, i.e., in a high-brightness environment, the electronic device performs non-linear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness before displaying it. On the one hand, since the mapping is based on the ambient light brightness, the target image with enhanced brightness can be more adapted to the current ambient light brightness. For example, different brightening effects will occur under different brightness levels in a high-brightness environment. On the other hand, brightening processing through non-linear mapping is more flexible than linear mapping, and it is convenient to enhance the brightness of the image by adjusting the relationship between pixel values. Therefore, brightening through non-linear mapping helps to improve the brightening effect.
[0082] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0083] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0084] Figures 1 to 3 This is an example image display diagram of an embodiment of the present disclosure.
[0085] Figure 4 This is a flowchart illustrating an image display method according to an embodiment of the present disclosure.
[0086] Figure 5 This is a principle example of the image display method in the embodiments of this disclosure. Figure 1 .
[0087] Figure 6 This is an example diagram of bilinear interpolation in an embodiment of this disclosure.
[0088] Figure 7 This is a principle example of the image display method in the embodiments of this disclosure. Figure 2 .
[0089] Figure 8 This is an example of a display effect based on an embodiment of the present disclosure. Figure 1 .
[0090] Figure 9 This is an example of a display effect based on an embodiment of the present disclosure. Figure 2 .
[0091] Figure 10 This is a diagram of an image display device shown in an embodiment of the present disclosure.
[0092] Figure 11 This is a structural block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation
[0093] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0094] Figures 1 to 3 This is an example image display diagram according to an embodiment of the present disclosure. As described in the background art, when an electronic device is in a bright environment, the screen content may be difficult to see because the light reflected from the screen is greater than the light emitted by the screen. Figure 1 As shown in Figure 11, an image with normal brightness appears very dark in bright environments. To make the image visible, its brightness needs to be increased to adapt to the bright environment. Figure 2 As shown in Figure 21, the lower-darkness image will become even darker in a bright environment, requiring an increase in the image's brightness to [amount missing]. Figure 3 Only images with a brightness level as shown in Figure 31 can be clearly seen. Therefore, this disclosure provides an image display method that enhances the brightness of the image to be displayed in a high-brightness environment before displaying it.
[0095] Figure 4This is a flowchart illustrating an image display method according to an embodiment of the present disclosure. Figure 4 It can be seen that the process includes the following steps:
[0096] S401. Obtain the image to be displayed and the ambient light level of the environment in which the display screen is located;
[0097] S402. In response to the ambient light brightness being greater than a first preset brightness threshold, the image to be displayed is non-linearly mapped based on the ambient light brightness to obtain a target image with enhanced brightness.
[0098] S403. Display the target image on the display screen.
[0099] The image display method in this disclosure can be applied to electronic devices with display functions. The electronic devices can be mobile phones, cameras, tablets, vehicle-mounted devices, or wearable devices, etc. This disclosure does not impose any limitations.
[0100] In step S401, the electronic device acquires an image to be displayed. This image can be a currently captured image, an image from a photo album application, or an image from an application other than the running camera or photo album application. The image to be displayed can be a single frame or a frame from a video sequence. Furthermore, in this embodiment, the electronic device acquires the ambient light brightness of the environment in which the display screen is located. For example, it can acquire the ambient light brightness based on an ambient light sensor built into the electronic device; alternatively, the electronic device can also acquire the ambient light brightness from other devices with which it has established a communication connection and which are relatively close.
[0101] In step S402, when the ambient light brightness is greater than a first preset brightness threshold, i.e., in a high-brightness environment, the electronic device performs non-linear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness.
[0102] In some embodiments, the electronic device can improve brightness by mapping based on different position areas of the image to be displayed and the ambient light brightness using a mapping function corresponding to the position area and the ambient light brightness; wherein, the mapping function corresponding to different position areas and / or ambient light brightness can be different, thus achieving non-linear mapping; and, different position areas can be areas divided based on image brightness, or foreground or background areas divided based on the subject being photographed, etc.
[0103] In other embodiments, the electronic device may also adjust the parameters of the same nonlinear mapping function for each pixel in conjunction with the ambient light brightness to obtain a target image with improved brightness. This nonlinear mapping function may be a gamma function, a logarithmic function, etc., and this disclosure does not impose any limitations.
[0104] In step S403, the electronic device displays the target image on the display screen, thereby enhancing the user's viewing experience by displaying a brighter target image in a high-brightness environment. Figure 5 This is a principle example of the image display method in the embodiments of this disclosure. Figure 1 ,like Figure 5 As shown, image data acquired by an image sensor or images to be displayed 51 received by an electronic device from other devices are typically stored in a cache medium 52, such as Double Data Rate (DDR). Subsequently, the electronic device performs layer rendering and compositing based on the cached data. The composited image is further post-processed by a processor 53, such as a Data Processing Unit (DPU) or Graphics Processing Unit (GPU), performing actions such as color correction, brightness adjustment, and contrast enhancement, before being displayed on the display screen 55. However, in this embodiment, the image data (image to be displayed) processed by the processor 53 is not directly transmitted to the display screen 55 for display. Instead, it undergoes a brightening process based on the algorithm engine 54, as described in this embodiment, before being transmitted to the display screen 55 via the processor 53.
[0105] It should be noted that in the embodiments of this disclosure, the electronic device can choose whether to execute the method of the embodiments of this disclosure. For example, the display settings interface of the electronic device includes operation controls, and the user can turn on or off the highlighting function of the embodiments of this disclosure based on the operation controls.
[0106] It is understood that in this embodiment of the present disclosure, when the ambient light brightness is greater than a first preset brightness threshold, i.e., in a high-brightness environment, the electronic device performs non-linear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness before displaying it. On the one hand, since the mapping is based on the ambient light brightness, the target image with enhanced brightness can be more adapted to the current ambient light brightness. For example, different brightening effects will occur under different brightness levels in a high-brightness environment. On the other hand, brightening through non-linear mapping is more flexible than linear mapping, and it is convenient to enhance the brightness of the image by adjusting the relationship between pixel values. Therefore, brightening through non-linear mapping helps to improve the brightening effect.
[0107] In some embodiments, the step of performing nonlinear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness includes:
[0108] For each pixel in the image to be displayed, a gamma value for gamma correction is determined based on the ambient light brightness.
[0109] Gamma correction is performed based on the gamma value corresponding to the pixel and the first pixel value of the pixel in the image to be displayed to determine the corrected pixel value corresponding to the pixel; wherein, the corrected pixel value corresponding to the pixel is greater than the first pixel value corresponding to the pixel.
[0110] Based on the corrected pixel values of each pixel in the image to be displayed, a target image with enhanced brightness is obtained.
[0111] In this embodiment of the disclosure, the electronic device adopts a nonlinear mapping method with gamma correction. Gamma correction can generally be expressed as the following formula (1):
[0112] output = input^gamma (1)
[0113] In this context, the exponential function gamma is the gamma value, input is the input value, and output is the value after gamma correction of the input value.
[0114] In this embodiment, the brightness of the image can be changed by adjusting the value of gamma. Depending on the design of the base input in the exponential function, the range of gamma values can also be different. For example, when the input is greater than 1, gamma can be a number greater than 1; when the input is less than 1, gamma can also be a number less than 1. In this embodiment, a suitable gamma function can be designed so that the output value is greater than the input value.
[0115] In this embodiment of the disclosure, the electronic device determines the gamma value corresponding to each pixel in the image to be displayed based on the ambient light brightness. In some embodiments, the gamma value corresponding to the pixel can be a value determined based on the ambient light brightness, so the gamma values corresponding to different pixels can be the same under the same ambient light brightness. In other embodiments, the gamma value corresponding to the pixel can also be a value determined based on the pixel value corresponding to the pixel and the ambient light brightness, so the gamma values corresponding to different pixels can be different. For example, the gamma value can be positively or negatively correlated with the ambient light. In addition, for different pixels with the same pixel value, the gamma values corresponding to the pixels in this embodiment of the disclosure may also be different. For example, the image to be displayed can be filtered to obtain a filtered image. Pixels with the same pixel value in the image to be displayed may have different pixel values in the filtered image, thereby making the gamma values determined based on the pixel values in the filtered image and the ambient light brightness different.
[0116] In this embodiment of the disclosure, the electronic device performs gamma correction based on the gamma value corresponding to the pixel and the first pixel value of the pixel in the image to be displayed. For example, the first pixel value in the image to be displayed can be directly used as the input value to obtain the corrected pixel value of the first pixel value. This method can be called direct correction. Alternatively, the pixel value after processing based on the first pixel value in the image to be displayed can be used as the input value. Then, the ratio of the output value to the input value is used to determine the brightness enhancement ratio. The corrected pixel value of the first pixel value is obtained by multiplying the brightness enhancement ratio by the first pixel value. This method can be called indirect correction.
[0117] Furthermore, in this embodiment of the disclosure, for a color image, the correction can be performed on the pixel values of each pixel in each color channel separately; alternatively, the pixel values of a single color channel can be corrected first, and then the brightness enhancement ratio of that single color channel can be calculated, and the brightness of the pixel values of other color channels can be increased based on the brightness enhancement ratio. The method for correcting the pixel values of a single color channel refers to the aforementioned direct or indirect correction methods, and the brightness enhancement ratio of a single color channel is essentially the ratio of output to input.
[0118] It is understood that in this embodiment of the disclosure, gamma correction is performed on each pixel of the image to be displayed, and the gamma value corresponding to the pixel is adjusted based on the ambient light brightness. On the one hand, since gamma correction is usually uneven in adjusting dark and bright areas, gamma correction can make darker pixels brighter, while the adjustment range for brighter pixels is relatively small. Therefore, gamma correction can improve the overall brightness of the image while avoiding overexposure in bright areas, thereby preserving more image details. On the other hand, since the gamma value is determined by the ambient light brightness, the final gamma correction effect can better match the current ambient light, thereby improving the display effect of the target image.
[0119] In some embodiments, the method further includes:
[0120] Determine the refresh rate of the display screen;
[0121] The step of determining the gamma value for gamma correction corresponding to a pixel based on the ambient light brightness includes:
[0122] In response to the refresh rate being greater than a preset frame rate threshold, the preset value corresponding to the ambient light brightness is used as the gamma value for gamma correction corresponding to the pixel.
[0123] In response to the refresh rate being less than or equal to the preset frame rate threshold, a blurred image of the image to be displayed is obtained, and the gamma value corresponding to the pixel is determined based on the ambient light brightness and the second pixel value of the pixel in the blurred image; wherein, the gamma value is negatively correlated with the ambient light brightness.
[0124] In this embodiment, the gamma value corresponding to a pixel is determined in conjunction with the refresh rate. When the refresh rate of the electronic device is greater than a preset frame rate threshold, such as a refresh rate greater than 120 Hz, the preset value corresponding to the ambient light brightness is used as the gamma value corresponding to the pixel. That is, when the refresh rate is high, the gamma value corresponding to the current ambient light brightness is determined based on the mapping relationship between ambient light brightness and gamma value. It can be understood that in this case, the gamma value corresponding to each pixel in the image to be displayed is the same; furthermore, for pixels with the same pixel value in the image to be displayed, since the gamma value corresponding to the pixel is the same, the grayscale after brightening the same grayscale at different positions is the same. In this embodiment, this processing method is called global brightening processing. Through global brightening, since the determination of the gamma value is simple, the speed of brightening processing can be improved, thereby matching the image display when the refresh rate is high.
[0125] In this embodiment, when the refresh rate is less than or equal to a preset frame rate threshold, such as when the refresh rate is less than or equal to 60Hz, a blurred image of the image to be displayed is acquired, and the gamma value corresponding to the pixel is determined based on the ambient light brightness and the second pixel value of the pixel in the blurred image. The blurred image can be an image obtained by filtering the image to be displayed, such as a blurred image obtained by mean filtering or Gaussian filtering. Filtering can map the same input to different outputs; that is, pixels with the same pixel value in the image to be displayed may have different pixel values in the blurred image. Furthermore, because a blurred image can reduce noise and details in the image and smooth edges, the transition between pixels in the blurred image will be natural. Based on this, electronic devices determine the gamma value of a pixel based on ambient light brightness and the second pixel value of the pixel in the blurred image. This allows pixels with the same pixel value in the image to be displayed to have different brightening effects. The brightened pixel value (i.e., the corrected pixel value) of each pixel can better adapt to the situation of its surrounding pixels, which helps to improve the contrast of the target image and increase the sense of detail. At the same time, based on the more natural transition of the blurred image, the naturalness of the target image processing can also be improved, that is, to achieve a natural and contrasting brightening effect.
[0126] In this embodiment, this processing method is called local brightening processing. It is understood that at low refresh rates, this meticulous processing method can improve the brightening and display quality of the target image. This embodiment determines the gamma value for gamma correction based on the display screen's refresh rate, demonstrating a high degree of intelligence.
[0127] It should be noted that in the embodiments of this disclosure, in either the preset value corresponding to the ambient light brightness is used as the gamma value of the pixel, or the gamma value corresponding to the pixel is determined based on the ambient light brightness and the second pixel value of the pixel in the blurred image, the gamma value can be positively or negatively correlated with the ambient light brightness. This depends on the selection of the gamma correction formula, but the purpose is to improve the brightness of each pixel in the image to be displayed through gamma correction.
[0128] Furthermore, in some embodiments of this disclosure, the blurred image of the image to be displayed can be an image obtained by directly filtering the image to be displayed, and the size of the blurred image obtained by filtering is the same as the size of the image to be displayed; in some embodiments, obtaining the blurred image of the image to be displayed includes:
[0129] The image to be displayed is compressed to obtain a compressed image;
[0130] The compressed image is filtered to obtain a filtered image;
[0131] Interpolation is performed on the filtered image to obtain a blurred image with the same size as the image to be displayed.
[0132] In this embodiment, the electronic device first compresses the size of the image to be displayed. For example, with a 6x compression, an original 1080x2340 image will be transmitted to the algorithm engine 54 as a 180x390 image. Furthermore, for color images, the maximum value from different color channels can be selected to convert the image into a monochrome image, further reducing the data size. For example, if a pixel originally has RGB values of 15, 20, and 30, the maximum value of 30 is taken as the value of that pixel.
[0133] In this embodiment of the disclosure, the electronic device performs filtering processing on the compressed image, such as mean filtering, median filtering, or Gaussian filtering. The filtered image obtained through filtering is actually a blurred image relative to the original image to be displayed. In this embodiment of the disclosure, since the size of the blurred image needs to be the same as the size of the image to be displayed, interpolation processing is required on the compressed and filtered image. For example, bilinear interpolation, nearest neighbor interpolation, etc., can be used, and this embodiment of the disclosure is not limited thereto.
[0134] Taking bilinear interpolation as an example, Figure 6 This is an example diagram of bilinear interpolation in an embodiment of this disclosure. If the compressed image is an image whose length and width are compressed by a factor of 2, such as... Figure 6As shown, given Q11(x1,y1), Q12(x1,y2), Q21(x2,y1), and Q22(x2,y2), find the value of the midpoint P(x,y). Then, during interpolation, a total of three linear interpolations can be performed in both directions. As shown in the figure, first, two linear interpolations are performed in the x-direction to obtain two temporary points, R1(x,y1) and R2(x,y2). Then, one linear interpolation is performed in the y-direction to obtain P(x,y). Alternatively, two linear interpolations can be performed in the y-direction first, followed by one linear interpolation in the x-direction. The following formula (2) is the formula for bilinear interpolation:
[0135]
[0136] It is understood that in the embodiments of this disclosure, compressing the image, filtering it, and then interpolating it can improve the image processing efficiency.
[0137] In other embodiments, the processor 53 outputs not only the image to be displayed, but also a compressed image, which is used by the algorithm engine 54 to determine, for example, the current shooting scene or to detect the subject in the image based on the compressed image, so as to assist in optimizing the shooting or optimizing the display screen. In this embodiment of the present disclosure, the compressed image output by the processor 53 can also be directly used as a blurred image, or the compressed image output by the processor 53 can be further processed to obtain a blurred image that meets the usage requirements.
[0138] It is understood that in this embodiment of the present disclosure, if the compressed image output by the processor 53 is reused to obtain a blurred image and then brightness enhancement processing is performed on it, without needing to blur the image to be displayed again, the power consumption of the electronic device can be effectively saved and the processing efficiency of brightness enhancement can be improved.
[0139] Figure 7 This is a principle example of the image display method in the embodiments of this disclosure. Figure 2 , Figure 7 Shown is Figure 5 The functions performed by the algorithm engine 54 include expansion 71 and brightening 72. Expansion 71 involves performing steps such as compression, filtering, and interpolation on the image to obtain a blurred image; brightening 72 involves determining the gamma value based on the ambient light intensity and the blurred image and performing gamma correction.
[0140] It should be noted that in this embodiment of the present disclosure, the filtered image after filtering the compressed image can also be directly used as the blurred image. However, when determining the gamma value corresponding to the pixel based on the ambient light brightness and the second pixel value of the pixel in the blurred image, multiple pixels in the image to be displayed can share one pixel in the blurred image.
[0141] In some embodiments, the gamma value is less than 1; the step of performing gamma correction based on the gamma value corresponding to the pixel and the first pixel value of the pixel in the image to be displayed, to determine the corrected pixel value corresponding to the pixel, includes:
[0142] The pixel value is normalized based on the first pixel value to obtain the normalized pixel value; wherein the normalized pixel value is less than 1.
[0143] Using the normalized pixel value as the third base and the gamma value corresponding to the pixel as the third exponent, the initial corrected pixel value corresponding to the pixel is determined.
[0144] The initial corrected pixel value corresponding to the pixel is denormalized to obtain the corrected pixel value corresponding to the pixel.
[0145] In this embodiment of the disclosure, based on the gamma correction formula of the aforementioned formula (1), it is known that when the gamma value is less than 1 and the input is a base less than 1, the output value obtained is greater than the input value. Therefore, this method can be used to brighten the pixel value of each pixel in the image to be displayed.
[0146] The following formula (3) is an example formula for gamma correction in an embodiment of this disclosure:
[0147]
[0148] like Figure 3 As shown, That is equivalent to the input in formula (1). This is equivalent to gamma in formula (1), where Output is the corrected pixel value. This refers to the normalized pixel value. Input can be the first pixel value of a pixel in the image to be displayed, or the pixel value after processing. Additionally, Mask is the second pixel value corresponding to a pixel in the blurred image. Based on... The initial corrected pixel values are obtained. Since gamma correction is performed on normalized pixel values, the initial corrected pixel values need to be denormalized to obtain the corrected pixel values corresponding to the pixels.
[0149] It is understood that in the embodiments of this disclosure, constructing a gamma function with a gamma value less than 1 and a base less than 1 to enhance image brightness can make the brightness enhancement more refined and the resulting target image more layered.
[0150] It should be noted that in this embodiment of the disclosure, the calculation of the gamma value is not limited to the exponential form shown in the above formula (3). For example, the exponent or base in formula (3) can be appropriately adjusted.
[0151] In some embodiments, determining the gamma value corresponding to a pixel based on the ambient light brightness and the second pixel value of the pixel in the blurred image includes:
[0152] Based on the ambient light intensity, a first base is determined; wherein the first base is a number greater than 1 and is positively correlated with the ambient light intensity;
[0153] Based on the ambient light intensity and the second pixel value of the pixel in the blurred image, a first index corresponding to the pixel is determined; wherein, the first index is a negative number and its absolute value is less than 1, and the first index is negatively correlated with the ambient light intensity;
[0154] Based on the first base and the first exponent corresponding to the pixel, the gamma value corresponding to the pixel is determined.
[0155] In this embodiment, the electronic device calculates the gamma value using an exponential function, as shown in formula (3) above. The first base B used to calculate the gamma value is not a fixed value, but a number greater than 1, and its value is positively correlated with ambient light intensity; while the first exponent... If the value is negative and its absolute value is less than 1, and the first index is negatively correlated with ambient light intensity, then the gamma value obtained based on this method is also negatively correlated with ambient light intensity.
[0156] Combination Figure 3 As shown in the formula and the limitation of the gamma value, it can be seen that the greater the ambient light brightness, the smaller the gamma value obtained, and the greater the output value. That is, the solution based on the embodiment of this disclosure can obtain a brightness enhancement effect that adapts to the ambient light brightness, thereby improving the viewing experience in various high-brightness environments.
[0157] In some embodiments, determining the first base value based on the ambient light intensity includes:
[0158] In response to the ambient light brightness being greater than the first preset brightness threshold and less than the second preset brightness threshold, the first value is determined as the first base value;
[0159] In response to the ambient light brightness being greater than or equal to the second preset brightness threshold and less than the third preset brightness threshold, the second value is determined as the first base value;
[0160] In response to the ambient light brightness being greater than or equal to the third preset brightness threshold, the third value is determined as the first base value; wherein the first value is less than the second value, and the second value is less than the third value.
[0161] In this embodiment of the disclosure, a first base is determined based on the brightness range of the ambient light. For example, the first preset brightness threshold is 10,000 lux, the second preset brightness threshold is 30,000 lux, and the third preset brightness threshold is 50,000 lux. If the ambient light brightness is between 10,000 lux and 30,000 lux, 1.5 is determined as the first base; if the ambient light brightness is between 30,000 lux and 50,000 lux, 2.5 is determined as the first base; and if the ambient light brightness is greater than or equal to 50,000 lux, 3.5 is determined as the first base. Since a larger ambient light brightness results in a larger first base and a smaller gamma value, the output value will be larger, and the brightness increase for the low-brightness parts of the image to be displayed will be greater.
[0162] It is understood that, in this embodiment of the disclosure, the actual detected ambient light brightness may vary due to the influence of the environment or the accuracy of the ambient light detection device. Therefore, determining the first base value based on the brightness range can reduce the frequent switching of the first base value, thereby reducing the instability of the brightness enhancement and making the brightness change of the target image after the brightness enhancement more natural. In addition, this method can also control the maximum level of brightness enhancement.
[0163] In some embodiments, determining the first index corresponding to a pixel based on the ambient light brightness and the second pixel value of the pixel in the blurred image includes:
[0164] A first pixel threshold is determined based on the ambient light intensity; wherein the first pixel threshold is positively correlated with the ambient light intensity.
[0165] In response to a second pixel value of a pixel being less than the first pixel threshold, a first index corresponding to the pixel is determined based on the first pixel threshold.
[0166] In response to a second pixel value being greater than or equal to the first pixel threshold, a first index corresponding to the pixel is determined based on the second pixel value; wherein the first index is negatively correlated with the first pixel threshold or the second pixel value.
[0167] In this embodiment of the disclosure, the first pixel threshold is determined by the ambient light brightness. The first pixel threshold is positively correlated with the ambient light brightness. The first index is calculated by comparing the first pixel threshold with the second pixel value of the pixel in the blurred image. The first index is negatively correlated with the first pixel threshold or the second pixel value. The purpose is to make the first index negative and the absolute value less than 1, so that the corrected pixel value of each pixel obtained based on the above formula (3) is improved compared with the original brightness. In addition, it can also achieve the effect that the greater the ambient light brightness, the greater the brightness improvement.
[0168] In some embodiments, determining the first pixel threshold based on the ambient light brightness includes:
[0169] In response to the ambient light brightness being greater than the first preset brightness threshold and less than the second preset brightness threshold, the fourth value is determined as the first pixel threshold.
[0170] In response to the ambient light brightness being greater than or equal to the second preset brightness threshold and less than the third preset brightness threshold, the fifth value is determined as the first pixel threshold;
[0171] In response to the ambient light brightness being greater than or equal to the third preset brightness threshold, the sixth value is determined as the first pixel threshold; wherein the fourth value is less than the fifth value, and the fifth value is less than the sixth value.
[0172] In this embodiment, a first pixel threshold is determined based on the brightness range of the ambient light. The first pixel threshold can be represented as A. For example, a first preset brightness threshold is 10000 lux, a second preset brightness threshold is 30000 lux, and a third preset brightness threshold is 50000 lux. If the ambient light brightness is between 10000 lux and 30000 lux, 128 is determined as the first pixel threshold; if the ambient light brightness is between 30000 lux and 50000 lux, 148 is determined as the first pixel threshold; and if the ambient light brightness is greater than or equal to 50000 lux, 168 is determined as the first pixel threshold. Since a higher ambient light brightness results in a higher first pixel threshold and a lower corresponding gamma value, the output value will be higher. Therefore, for the low-brightness portion of the image to be displayed, the corresponding brightness increase will be greater.
[0173] It is understood that, in this embodiment, the actual detected ambient light brightness may vary due to the influence of the environment or the accuracy of the ambient light detection device. Therefore, determining the first index based on the brightness range can reduce the frequent switching of the first index, thereby reducing the instability of the brightness increase and making the brightness change of the target image after the brightness increase more natural. In addition, this method can also control the maximum level of brightness increase.
[0174] It should be noted that the calculation method of the gamma value in the above formula (3) is not limited in this embodiment. For example, 128 can be replaced with 127, or other modified formulas can be used. However, the purpose is to make it related to the ambient light brightness and to improve the brightness of the target image.
[0175] In some embodiments, the method further includes:
[0176] In response to the first base being greater than a preset base threshold, a second pixel threshold and a second exponent are determined based on the first base; wherein, both the second pixel threshold and the second exponent are positively correlated with the first base;
[0177] The step of performing gamma correction based on the gamma value corresponding to the pixel and the first pixel value of the pixel in the image to be displayed, and determining the corrected pixel value corresponding to the pixel, includes:
[0178] The pixel value to be compared is determined based on the first pixel value of the pixel in the image to be displayed;
[0179] In response to the fact that the pixel value to be compared is less than the second pixel threshold, the ratio of the pixel value to be compared to the second pixel threshold is used as the second base, and the pixel value to be corrected is determined based on the second base and the second exponent, and the corrected pixel value corresponding to the pixel is determined based on the pixel value to be corrected and the gamma value corresponding to the pixel; wherein, the pixel value to be corrected is less than the pixel value to be compared;
[0180] In response to the pixel value to be compared being greater than or equal to the second pixel threshold, the pixel value to be compared is taken as the pixel value to be corrected, and the corrected pixel value corresponding to the pixel is determined based on the pixel value to be corrected and the gamma value corresponding to the pixel.
[0181] In this embodiment of the disclosure, the preset base threshold can be 2. When B is greater than 2, a second pixel threshold and a second exponent are determined based on the first base. For example, the value range of the second pixel threshold C is 0 to 40, and the value range of the second exponent D is 1.5 to 4. For example, when the value of B is below 2, C = 0, and no optimization is performed. When B = 2.5, the values C = 15 and D = 1.5 can be taken; when B = 3.5, the values C = 25 and D = 3 can be taken.
[0182] In this embodiment of the disclosure, the pixel value to be compared is determined based on the first pixel value of the pixel in the image to be displayed. For example, if the image to be displayed is a multi-color channel image, the pixel value to be compared can be the pixel value of a single color channel, such as the pixel value corresponding to the largest color channel (e.g., the value of the V channel in HSV space), or the first pixel value of a preset color channel such as the G channel; in addition, it can also be the average value of each color channel, etc.; if the image to be displayed is a monochrome image, the pixel value to be compared can be the first pixel value itself.
[0183] Taking the pixel value MaxG, which is the largest color channel, as an example, MaxG can be expressed as the following formula (4):
[0184] MaxG = max(INPUT(R,G,B)) (4)
[0185] Wherein, INPUT represents the pixel value of a certain pixel in the image to be displayed. In this embodiment of the present disclosure, if MaxG is less than C, the pixel value to be corrected can be determined based on the following formula (5):
[0186] MaxG=(MaxG / C)^D (5)
[0187] If MaxG is greater than or equal to C, then the original MaxG can be directly used as the pixel value to be corrected. In conjunction with the aforementioned formula (3), this embodiment introduces a second pixel threshold and a second exponent when the first base is greater than a preset base threshold, and adjusts the pixel value to be compared based on exponentiation to obtain a smaller pixel value to be corrected when the pixel value to be compared is less than the second pixel threshold. The purpose is to minimize color shift or contrast loss caused by excessive brightening of low-grayscale pixels due to a large first base B. When the pixel value to be compared is greater than the second pixel threshold, the pixel value to be compared is used as the pixel value to be corrected for gamma correction, thus maintaining the brightening of high-grayscale pixels. In this embodiment, the aforementioned method of controlling the maximum brightness enhancement level can be combined to obtain a brightness enhancement process that is limited in both low and high grayscale levels.
[0188] It is understood that, in this embodiment of the present disclosure, by introducing a second pixel threshold and a second exponent based on a first base to determine the pixel value to be corrected, the problem of color shift or contrast loss caused by excessive brightening of low grayscale pixels can be reduced, thereby improving the quality of the obtained target image.
[0189] Figure 8 This is an example of a display effect based on an embodiment of the present disclosure. Figure 1 ,like Figure 8 As shown in the figures, for the original image (i.e., the image to be displayed) in image 81, the processing effects obtained based on different combinations of parameters A, B, C, and D are shown in images 82, 83, and 84, respectively. It can be seen from the figures that different ambient light requirements necessitate different parameter combinations, resulting in different brightening effects.
[0190] In some embodiments, the image to be displayed is an image including different color channels, and the pixel value to be corrected is determined based on the first pixel value of a single color channel; determining the corrected pixel value corresponding to the pixel based on the pixel value to be corrected and the gamma value corresponding to the pixel includes:
[0191] Gamma correction is performed on the pixel value to be corrected based on the gamma value corresponding to the pixel, and the corrected pixel value of the pixel value to be corrected is determined.
[0192] The brightness enhancement coefficient corresponding to a pixel is determined based on the ratio of the corrected pixel value to the pixel value to be corrected.
[0193] Based on the brightness enhancement coefficient corresponding to each pixel, the first pixel value of each pixel in each color channel is weighted to obtain the corrected pixel value corresponding to each color channel.
[0194] As mentioned above, the corrected pixel value can be determined based on indirect correction. In this embodiment of the present disclosure, the electronic device performs gamma correction on the pixel value to be corrected based on the gamma value corresponding to the pixel. The corrected pixel value obtained is a value larger than the pixel value to be corrected. Therefore, the ratio of the corrected pixel value to the pixel value to be corrected can be called the brightness enhancement coefficient. After obtaining the brightness enhancement coefficient, the first pixel value of the pixel in each color channel is weighted based on the brightness enhancement coefficient corresponding to the pixel to obtain the corrected pixel value corresponding to each color channel.
[0195] For example, assuming the brightness enhancement coefficient corresponding to a pixel is K, the enhanced pixel value can be obtained by multiplying the pixel values of the pixel in different color channels of the image to be displayed by the same K. Combining the aforementioned formula (3), and taking the example that the pixel value to be corrected is determined based on the first pixel value of the color channel where the maximum pixel value is located, the brightness enhancement coefficient K obtained in this embodiment can be expressed by the following formula (6):
[0196] K=255*(MaxG / 255)^(B^((128-mask) / 128)) / MaxG (6)
[0197] The final corrected pixel value can be expressed as the following formula (7):
[0198] Output = INPUT * K (7)
[0199] It is understood that in the embodiments of this disclosure, a pixel is assigned a brightness enhancement coefficient and applied to different color channels. This not only enhances the brightness of the target image, but also keeps the hue and saturation of the target image relative to the original image to be displayed, thereby making the image display as realistic as possible.
[0200] In some embodiments, obtaining the ambient light intensity of the environment in which the display screen is located includes:
[0201] Obtain the ambient light intensity of the environment in which the display screen is located within a preset time period;
[0202] The step of responding to the ambient light brightness being greater than a first preset brightness threshold by performing a non-linear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness includes:
[0203] In response to the ambient light brightness being greater than a first preset brightness threshold for a preset duration, the image to be displayed is non-linearly mapped based on the ambient light brightness for the preset duration to obtain a target image with enhanced brightness.
[0204] In this embodiment of the disclosure, the preset duration can be 30 seconds. If the ambient light brightness is continuously greater than the first preset brightness threshold within the preset duration, then a non-linear mapping is performed on the image to be displayed based on the ambient light brightness within the preset duration. For example, the non-linear mapping can be performed on the image to be displayed based on the average brightness, maximum brightness, or the brightness of the last detection within the preset duration, so as to obtain a target image with improved brightness. This embodiment of the disclosure does not limit this.
[0205] It is understood that in this embodiment of the disclosure, a preset duration is introduced, that is, the brightness is adjusted after the ambient light has stabilized. This allows the brightness adjustment to have a gradual process and will not be adjusted too frequently, thus improving the user's viewing experience.
[0206] Figure 9 This is an example of a display effect based on an embodiment of the present disclosure. Figure 2 ,like Figure 9 As shown in Figure 92, the target image obtained based on the embodiment of this disclosure is obtained from the original image (i.e., the image to be displayed) of image 91. The effects of maintaining high grayscale contrast or maintaining low grayscale contrast using conventional global processing methods are shown in Figures 93 and 94, respectively. It can be seen from the figures that in the global processing method, Figure 93 maintains the high grayscale contrast of distant clouds while reducing the brightening of low grayscale levels; or, Figure 94 ensures the brightening of low grayscale levels while causing the loss of cloud details. However, the solution based on the embodiment of this disclosure results in Figure 92, which balances the brightness of both low and high grayscale levels.
[0207] Figure 10 This is a diagram illustrating an image display device according to an embodiment of the present disclosure, consisting of... Figure 10 It can be seen that this includes:
[0208] The acquisition module 1001 is configured to acquire the image to be displayed and the ambient light intensity of the environment in which the display screen is located;
[0209] The mapping module 1002 is configured to, in response to the ambient light brightness being greater than a first preset brightness threshold, perform non-linear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness;
[0210] Display module 1003 is configured to display the target image through the display screen.
[0211] In some embodiments, the mapping module 1002 is further configured to, for each pixel in the image to be displayed, determine a gamma value for gamma correction corresponding to the pixel based on the ambient light brightness; perform gamma correction based on the gamma value corresponding to the pixel and a first pixel value of the pixel in the image to be displayed, and determine a corrected pixel value corresponding to the pixel; wherein the corrected pixel value corresponding to the pixel is greater than the first pixel value corresponding to the pixel; and obtain a target image with improved brightness based on the corrected pixel values of each pixel in the image to be displayed.
[0212] In some embodiments, the apparatus further includes:
[0213] The first determining module is configured to determine the refresh rate of the display screen;
[0214] The mapping module 1002 is further configured to, in response to the refresh rate being greater than a preset frame rate threshold, use a preset value corresponding to the ambient light brightness as the gamma value corresponding to the pixel for gamma correction; and in response to the refresh rate being less than or equal to the preset frame rate threshold, acquire a blurred image of the image to be displayed, and determine the gamma value corresponding to the pixel based on the ambient light brightness and the second pixel value of the pixel in the blurred image.
[0215] In some embodiments, the mapping module 1002 is further configured to: determine a first base number based on the ambient light intensity; wherein the first base number is a number greater than 1 and positively correlated with the ambient light intensity; determine a first exponent corresponding to the pixel based on the ambient light intensity and the second pixel value of the pixel in the blurred image; wherein the first exponent is a negative number with an absolute value less than 1 and is negatively correlated with the ambient light intensity; and determine the gamma value corresponding to the pixel based on the first base number and the first exponent corresponding to the pixel.
[0216] In some embodiments, the mapping module 1002 is further configured to, in response to the ambient light brightness being greater than the first preset brightness threshold and less than the second preset brightness threshold, determine a first value as the first base; in response to the ambient light brightness being greater than or equal to the second preset brightness threshold and less than the third preset brightness threshold, determine a second value as the first base; and in response to the ambient light brightness being greater than or equal to the third preset brightness threshold, determine a third value as the first base; wherein the first value is less than the second value, and the second value is less than the third value.
[0217] In some embodiments, the mapping module 1002 is further configured to determine a first pixel threshold based on the ambient light brightness; wherein the first pixel threshold is positively correlated with the ambient light brightness; in response to a second pixel value of a pixel being less than the first pixel threshold, a first exponent corresponding to the pixel is determined based on the first pixel threshold; in response to a second pixel value of a pixel being greater than or equal to the first pixel threshold, a first exponent corresponding to the pixel is determined based on the second pixel value; wherein the first exponent is negatively correlated with the first pixel threshold or the second pixel value.
[0218] In some embodiments, the mapping module 1002 is further configured to determine a fourth value as the first pixel threshold in response to the ambient light brightness being greater than the first preset brightness threshold and less than the second preset brightness threshold; to determine a fifth value as the first pixel threshold in response to the ambient light brightness being greater than or equal to the second preset brightness threshold and less than the third preset brightness threshold; and to determine a sixth value as the first pixel threshold in response to the ambient light brightness being greater than or equal to the third preset brightness threshold; wherein the fourth value is less than the fifth value, and the fifth value is less than the sixth value.
[0219] In some embodiments, the apparatus further includes:
[0220] The second determining module is configured to, in response to the first base being greater than a preset base threshold, determine a second pixel threshold and a second exponent based on the first base; wherein the second pixel threshold and the second exponent are both positively correlated with the first base;
[0221] The mapping module 1002 is further configured to: determine a pixel value to be compared based on a first pixel value of a pixel in the image to be displayed; in response to the pixel value to be compared being less than a second pixel threshold, use the ratio of the pixel value to be compared to the second pixel threshold as a second base, determine a pixel value to be corrected based on the second base and the second exponent, and determine a corrected pixel value corresponding to the pixel based on the pixel value to be corrected and the gamma value corresponding to the pixel; wherein the pixel value to be corrected is less than the pixel value to be compared; in response to the pixel value to be compared being greater than or equal to the second pixel threshold, use the pixel value to be compared as the pixel value to be corrected, and determine a corrected pixel value corresponding to the pixel based on the pixel value to be corrected and the gamma value corresponding to the pixel.
[0222] In some embodiments, the image to be displayed is an image including different color channels, and the pixel value to be corrected is determined based on the first pixel value of a single color channel; the mapping module 1002 is further configured to perform gamma correction on the pixel value to be corrected based on the gamma value corresponding to the pixel, and determine the corrected pixel value of the pixel value to be corrected; determine the brightness enhancement coefficient corresponding to the pixel based on the ratio of the corrected pixel value to the pixel value to be corrected; and weight the first pixel value of the pixel in each color channel based on the brightness enhancement coefficient corresponding to the pixel to obtain the corrected pixel value corresponding to each color channel.
[0223] In some embodiments, the acquisition module 1001 is further configured to compress the size of the image to be displayed to obtain a compressed image; filter the compressed image to obtain a filtered image; and perform interpolation processing based on the filtered image to obtain a blurred image with the same size as the image to be displayed.
[0224] In some embodiments, the gamma value is less than 1; the mapping module 1002 is further configured to perform normalization processing based on the first pixel value of the pixel to obtain a normalized pixel value; wherein, the normalized pixel value is less than 1; using the normalized pixel value as the third base and the gamma value corresponding to the pixel as the third exponent, the initial correction pixel value corresponding to the pixel is determined; the initial correction pixel value corresponding to the pixel is denormalized to obtain the correction pixel value corresponding to the pixel.
[0225] In some embodiments, the acquisition module 1001 is further configured to acquire the ambient light brightness of the environment in which the display screen is located within a preset time period; the step of performing nonlinear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with improved brightness in response to the ambient light brightness being greater than a first preset brightness threshold includes: performing nonlinear mapping on the image to be displayed based on the ambient light brightness within the preset time period to obtain a target image with improved brightness in response to the ambient light brightness being continuously greater than the first preset brightness threshold within the preset time period.
[0226] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0227] Figure 11 This is a structural block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device may be a mobile phone, camera, or tablet computer. The electronic device may be device 1100.
[0228] Reference Figure 11The device 1100 may include one or more of the following components: processing component 1102, memory 1104, power supply component 1106, multimedia component 1108, audio component 1110, input / output (I / O) interface 1112, sensor component 1114, and communication component 1116.
[0229] Processing component 1102 typically controls the overall operation of device 1100, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. Processing component 1102 may include one or more processors 1120 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 1102 may include one or more modules to facilitate interaction between processing component 1102 and other components. For example, processing component 1102 may include a multimedia module to facilitate interaction between multimedia component 1108 and processing component 1102.
[0230] Memory 1104 is configured to store various types of data to support operation on device 1100. Examples of such data include at least one of the following: instructions for any application or method operating on device 1100, contact data, phonebook data, messages, pictures, and videos. Memory 1104 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0231] Power supply component 1106 provides power to various components of device 1100. Power supply component 1106 may include at least one of the following: a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 1100.
[0232] Multimedia component 1108 includes a screen that provides an output interface between device 1100 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1108 includes a front-facing camera and / or a rear-facing camera. When device 1100 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0233] Audio component 1110 is configured to output and / or input audio signals. For example, audio component 1110 includes a microphone (MIC) configured to receive external audio signals when device 1100 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1104 or transmitted via communication component 1116. In some embodiments, audio component 1110 also includes a speaker for outputting audio signals.
[0234] I / O interface 1112 provides an interface between processing component 1102 and peripheral interface modules, such as keyboards, click wheels, and buttons. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0235] Sensor assembly 1114 includes one or more sensors for providing state assessment of various aspects of device 1100. For example, sensor assembly 1114 may detect the on / off state of device 1100, the relative positioning of components, such as the display and keypad of device 1100, changes in position of device 1100 or one of its components, the presence or absence of user contact with device 1100, orientation or acceleration / deceleration of device 1100, and temperature changes of device 1100. Sensor assembly 1114 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1114 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, sensor assembly 1114 may also include, but is not limited to, at least one of the following: an accelerometer, a gyroscope, a magnetometer, a pressure sensor, and a temperature sensor.
[0236] Communication component 1116 is configured to facilitate wired or wireless communication between device 1100 and other devices. Device 1100 can access wireless networks based on communication standards, such as Wi-Fi, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 1116 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1116 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.
[0237] In an exemplary embodiment, device 1100 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.
[0238] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1104 including executable instructions or a computer program, which can be executed by the processor 1120 of the device 1100 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0239] A non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform any of the image display methods described above in the embodiments of this disclosure.
[0240] This disclosure provides a computer program product comprising a computer program or executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or executable instructions from the computer-readable storage medium and executes the computer program or executable instructions, causing the electronic device to perform any of the image display methods described above in this disclosure.
[0241] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the foregoing claims.
[0242] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. An image display method, characterized in that, The method includes: Obtain the image to be displayed and the ambient light level of the environment in which the display screen is located; In response to the ambient light brightness being greater than a first preset brightness threshold, the image to be displayed is non-linearly mapped based on the ambient light brightness to obtain a target image with enhanced brightness. The target image is displayed on the screen.
2. The method according to claim 1, characterized in that, The step of performing nonlinear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness includes: For each pixel in the image to be displayed, a gamma value for gamma correction is determined based on the ambient light brightness. Gamma correction is performed based on the gamma value corresponding to the pixel and the first pixel value of the pixel in the image to be displayed to determine the corrected pixel value corresponding to the pixel; wherein the corrected pixel value corresponding to the pixel is greater than the first pixel value corresponding to the pixel. Based on the corrected pixel values of each pixel in the image to be displayed, a target image with enhanced brightness is obtained.
3. The method according to claim 2, characterized in that, The method further includes: Determine the refresh rate of the display screen; The step of determining the gamma value for gamma correction corresponding to a pixel based on the ambient light brightness includes: In response to the refresh rate being greater than a preset frame rate threshold, the preset value corresponding to the ambient light brightness is used as the gamma value for gamma correction corresponding to the pixel. In response to the refresh rate being less than or equal to the preset frame rate threshold, a blurred image of the image to be displayed is obtained, and the gamma value corresponding to the pixel is determined based on the ambient light brightness and the second pixel value of the pixel in the blurred image.
4. The method according to claim 3, characterized in that, The step of determining the gamma value corresponding to a pixel based on the ambient light intensity and the second pixel value of the pixel in the blurred image includes: Based on the ambient light intensity, a first base is determined; wherein the first base is a number greater than 1 and is positively correlated with the ambient light intensity; Based on the ambient light intensity and the second pixel value of the pixel in the blurred image, a first index corresponding to the pixel is determined; wherein, the first index is a negative number and its absolute value is less than 1, and the first index is negatively correlated with the ambient light intensity; Based on the first base and the first exponent corresponding to the pixel, the gamma value corresponding to the pixel is determined.
5. The method according to claim 4, characterized in that, Determining the first base value based on the ambient light intensity includes: In response to the ambient light brightness being greater than the first preset brightness threshold and less than the second preset brightness threshold, the first value is determined as the first base value; In response to the ambient light brightness being greater than or equal to the second preset brightness threshold and less than the third preset brightness threshold, the second value is determined as the first base value; In response to the ambient light brightness being greater than or equal to the third preset brightness threshold, the third value is determined as the first base value; wherein the first value is less than the second value, and the second value is less than the third value.
6. The method according to claim 4, characterized in that, The step of determining the first index corresponding to the pixel based on the ambient light brightness and the second pixel value of the pixel in the blurred image includes: A first pixel threshold is determined based on the ambient light intensity; wherein the first pixel threshold is positively correlated with the ambient light intensity. In response to a second pixel value of a pixel being less than the first pixel threshold, a first index corresponding to the pixel is determined based on the first pixel threshold. In response to a second pixel value being greater than or equal to the first pixel threshold, a first index corresponding to the pixel is determined based on the second pixel value; wherein the first index is negatively correlated with the first pixel threshold or the second pixel value.
7. The method according to claim 6, characterized in that, Determining the first pixel threshold based on the ambient light brightness includes: In response to the ambient light brightness being greater than the first preset brightness threshold and less than the second preset brightness threshold, the fourth value is determined as the first pixel threshold. In response to the ambient light brightness being greater than or equal to the second preset brightness threshold and less than the third preset brightness threshold, the fifth value is determined as the first pixel threshold; In response to the ambient light brightness being greater than or equal to the third preset brightness threshold, the sixth value is determined as the first pixel threshold; wherein the fourth value is less than the fifth value, and the fifth value is less than the sixth value.
8. The method according to claim 4, characterized in that, The method further includes: In response to the first base being greater than a preset base threshold, a second pixel threshold and a second exponent are determined based on the first base; wherein, both the second pixel threshold and the second exponent are positively correlated with the first base; The step of performing gamma correction based on the gamma value corresponding to the pixel and the first pixel value of the pixel in the image to be displayed, and determining the corrected pixel value corresponding to the pixel, includes: The pixel value to be compared is determined based on the first pixel value of the pixel in the image to be displayed; In response to the fact that the pixel value to be compared is less than the second pixel threshold, the ratio of the pixel value to be compared to the second pixel threshold is used as the second base. The pixel value to be corrected is determined based on the second base and the second exponent. The corrected pixel value corresponding to the pixel is determined based on the pixel value to be corrected and the gamma value corresponding to the pixel. Wherein, the pixel value to be corrected is less than the pixel value to be compared. In response to the pixel value to be compared being greater than or equal to the second pixel threshold, the pixel value to be compared is taken as the pixel value to be corrected, and the corrected pixel value corresponding to the pixel is determined based on the pixel value to be corrected and the gamma value corresponding to the pixel.
9. The method according to claim 8, characterized in that, The image to be displayed is an image including different color channels, and the pixel value to be corrected is determined based on the first pixel value of a single color channel; the step of determining the corrected pixel value corresponding to a pixel based on the pixel value to be corrected and the gamma value corresponding to the pixel includes: Gamma correction is performed on the pixel value to be corrected based on the gamma value corresponding to the pixel, and the corrected pixel value of the pixel value to be corrected is determined. The brightness enhancement coefficient corresponding to a pixel is determined based on the ratio of the corrected pixel value to the pixel value to be corrected. Based on the brightness enhancement coefficient corresponding to each pixel, the first pixel value of each pixel in each color channel is weighted to obtain the corrected pixel value corresponding to each color channel.
10. The method according to claim 3, characterized in that, The step of obtaining the blurred image of the image to be displayed includes: The image to be displayed is compressed to obtain a compressed image; The compressed image is filtered to obtain a filtered image; Interpolation is performed on the filtered image to obtain a blurred image with the same size as the image to be displayed.
11. The method according to any one of claims 2-10, characterized in that, The gamma value is less than 1; the gamma correction based on the gamma value corresponding to the pixel and the first pixel value of the pixel in the image to be displayed, to determine the corrected pixel value corresponding to the pixel, includes: The pixel value is normalized based on the first pixel value to obtain the normalized pixel value; wherein the normalized pixel value is less than 1. Using the normalized pixel value as the third base and the gamma value corresponding to the pixel as the third exponent, the initial corrected pixel value corresponding to the pixel is determined. The initial corrected pixel value corresponding to the pixel is denormalized to obtain the corrected pixel value corresponding to the pixel.
12. The method according to claim 1, characterized in that, The acquisition of the ambient light intensity of the environment in which the display screen is located includes: Obtain the ambient light intensity of the environment in which the display screen is located within a preset time period; The step of responding to the ambient light brightness being greater than a first preset brightness threshold by performing a non-linear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness includes: In response to the ambient light brightness being greater than a first preset brightness threshold for a preset duration, the image to be displayed is non-linearly mapped based on the ambient light brightness for the preset duration to obtain a target image with enhanced brightness.
13. An image display device, characterized in that, The device includes: The acquisition module is configured to acquire the image to be displayed and the ambient light level of the environment in which the display screen is located; The mapping module is configured to, in response to the ambient light brightness being greater than a first preset brightness threshold, perform non-linear mapping on the image to be displayed based on the ambient light brightness to obtain a target image with enhanced brightness. The display module is configured to display the target image through the display screen.
14. An electronic device, characterized in that, include: processor; Memory used to store computer programs or instructions; The processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1 to 12.
15. A non-transitory computer-readable storage medium storing a computer program or instructions, characterized in that, When the computer program or instructions in the storage medium are executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
16. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 12.