Image processing method and device, electronic equipment and storage medium
By detecting ambient brightness and calculating the gamma adjustment coefficient, the display device parameters are adjusted to solve the problem of difficulty in distinguishing details in dark areas of the screen under bright conditions, thereby improving the contrast in dark areas and enhancing the visual effect.
Patent Information
- Application Number
- CN202511157657.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-10-28
AI Technical Summary
When the ambient light is bright, the superposition of reflected light from the screen and image light makes it difficult to distinguish details in dark areas. Existing technologies cannot effectively improve the contrast and detail recognition of dark areas.
By detecting ambient brightness, obtaining display device parameters, calling image optimization tools to calculate gamma adjustment coefficients, adjusting the brightness of dark areas to improve contrast, and using a set of gamma adjustment parameters for pixel-by-pixel processing, we can ensure that dark details are clearly presented in bright environments.
It improves the contrast and detail in dark areas, enhancing the visual experience in bright environments.
Smart Images

Figure CN120853527A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image processing method, apparatus, electronic device and storage medium. Background Technology
[0002] When displaying images on a screen, if the ambient light is bright, viewers will have a much greater perception of changes in brightness in dark scenes than in bright scenes, making it difficult to distinguish the details of changes in the dark areas of the image. Therefore, when displaying images, the display device needs to perform secondary processing on the original image signal, namely Gamma processing, so that the brightness of each pixel needs to be transformed to the power of 2.2 of the original brightness.
[0003] However, the display panel itself has reflectivity. When the ambient light is bright, the light intensity entering the viewer's eyes is the superposition of the light emitted by the image itself and the reflected light. As a result, when viewing a screen image in a bright environment, the brightness of the dark areas of the image is actually much higher than the brightness of the image itself. If the brightness of each pixel in the screen image is directly transformed to the power of 2.2 of the original brightness, the perceived brightness base of the dark areas will be further increased. This will cause the subtle brightness differences that should exist in the dark areas to be masked by the increased brightness base, making it even more difficult for the viewer to distinguish the details in the dark areas.
[0004] Therefore, there is an urgent need to develop an image processing method, device, electronic device, and storage medium to solve one or more of the aforementioned problems. Summary of the Invention
[0005] In view of this, in order to solve the above-mentioned technical problems or some of the technical problems, the present invention provides an image processing method, apparatus, electronic device and storage medium. The method can perform brightness adjustment processing on the dark areas in the image, improve the contrast between different gray levels in the dark areas of the image, so that the different gray levels in the dark areas of the image have higher contrast, thereby improving the recognition of dark details.
[0006] In a first aspect, this application provides an image processing method, the method comprising:
[0007] When the ambient brightness is detected to be higher than a preset threshold, the display parameters of the device corresponding to the target image are obtained in response to the brightness adjustment request.
[0008] The image optimization tool is invoked to analyze and process the display parameters, and the corresponding gamma adjustment coefficient is calculated. The gamma adjustment coefficient is the adjustment coefficient of the gamma function.
[0009] Based on the gamma adjustment coefficient, the target gamma adjustment parameters for the dark areas in the target image are determined, and the adjustment strategy for the dark areas in the target image is determined according to the target gamma adjustment parameters.
[0010] The adjustment strategy is used to adjust the dark areas of the target image.
[0011] In one possible implementation, determining the target gamma adjustment parameters for the dark regions in the target image based on the gamma adjustment coefficient includes:
[0012] Based on the gamma adjustment coefficient, the standard gamma function is adjusted to obtain the target gamma function corresponding to the display parameter;
[0013] Based on the target gamma function, gamma adjustment parameters corresponding to multiple different image gray levels are determined to obtain a set of gamma adjustment parameters;
[0014] Based on the image grayscale of the dark areas in the target image, a matching gamma adjustment parameter is selected from the set of gamma adjustment parameters and used as the target gamma adjustment parameter.
[0015] In one possible implementation, the method further includes:
[0016] Based on the gamma adjustment coefficient, the target gamma adjustment parameters for the bright areas in the target image are determined, and the adjustment strategy for the bright areas in the target image is determined according to the target gamma adjustment parameters.
[0017] The adjustment strategy is used to adjust the bright areas of the target image.
[0018] In one possible implementation, obtaining the display parameters of the device corresponding to the target image includes:
[0019] Obtain the current power consumption of the device corresponding to the target image;
[0020] When the current energy consumption is lower than the energy consumption threshold, obtain the device screen reflectivity and screen peak brightness;
[0021] When the current energy consumption is higher than the energy consumption threshold, the device screen reflectivity and the historical screen brightness record of the device are obtained, and the peak screen brightness of the device is determined based on the historical screen brightness record. The historical screen brightness record is the screen brightness record of the device in a low energy consumption state.
[0022] The ambient light intensity of the environment in which the device is located, and the adjustment coefficient of the device's screen brightness under the current ambient light intensity are obtained;
[0023] The illumination intensity, adjustment coefficient, screen reflectivity, and screen peak brightness are used as the display parameters of the device corresponding to the target image.
[0024] In one possible implementation, the step of invoking an image optimization tool to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient includes:
[0025] The gamma adjustment factor k is calculated using the following formula:
[0026]
[0027] Where k is the gamma adjustment factor, L a Let ρ be the illuminance, ρ be the screen reflectivity, β be the adjustment coefficient, and L be the illuminance. max γ represents the peak brightness of the screen, and γ is the preset gamma coefficient.
[0028] In one possible implementation, the method further includes:
[0029] When the ambient light intensity of the environment in which the device is located changes, the display parameters are updated according to the brightness change of the ambient light intensity.
[0030] Using the updated display parameters, the step of calling the image optimization tool is re-executed to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient.
[0031] In one possible implementation, updating the display parameters based on the brightness change of the illumination intensity includes:
[0032] The adjustment coefficient is updated based on the brightness change of the illumination intensity;
[0033] The updated adjustment coefficients, screen reflectivity, and screen peak brightness, along with the current illumination, are used as the new display parameters for the device corresponding to the target image, thereby updating the display parameters.
[0034] Secondly, this application provides an image processing apparatus, the apparatus comprising:
[0035] The acquisition module is used to acquire the display parameters of the device corresponding to the target image in response to a brightness adjustment request when the ambient brightness is detected to be higher than a preset threshold.
[0036] The calling module is used to call the image optimization tool to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient, wherein the gamma adjustment coefficient is the adjustment coefficient of the gamma function;
[0037] The determination module is used to determine the target gamma adjustment parameters of the dark areas in the target image based on the gamma adjustment coefficients, and to determine the adjustment strategy of the dark areas in the target image according to the target gamma adjustment parameters;
[0038] An adjustment module is used to adjust the dark areas of the target image using the adjustment strategy.
[0039] Thirdly, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the image processing method described in any embodiment of the first aspect.
[0040] Fourthly, this application also provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the image processing method described in any embodiment of the first aspect.
[0041] Compared with the prior art, the above-mentioned technical solutions provided in this application have the following advantages: The method provided in this application obtains the device display parameters of the image output display device when the ambient brightness is detected to be higher than a preset threshold, and then determines the adjustment strategy of the target image based on the device display parameters. The adjustment strategy can perform brightness adjustment processing on the dark areas in the image, improve the contrast between different gray levels in the dark areas of the image, and make the contrast between different gray levels in the dark areas of the image higher, thereby improving the recognition of dark details. Attached Figure Description
[0042] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0045] Figure 1 A schematic flowchart of an image processing method provided in an embodiment of this application;
[0046] Figure 2 A flowchart illustrating a method for obtaining target gamma adjustment parameters provided in an embodiment of this application;
[0047] Figure 3 A graph of a standard gamma function is provided for embodiments of this application;
[0048] Figure 4 A schematic diagram comparing the standard gamma curve and the target gamma curve provided for embodiments of this application;
[0049] Figure 5 A flowchart illustrating a method for obtaining display parameters provided in an embodiment of this application;
[0050] Figure 6 This application provides a schematic diagram of the structure of an image processing system according to an embodiment;
[0051] Figure 7 This application provides a schematic diagram of the structure of an image processing device according to an embodiment;
[0052] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0054] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0055] To address the technical problem in existing technologies where, due to the characteristics of the human eye and brain, viewers are more sensitive to changes in brightness in dark scenes; even small changes in brightness can be detected in dimly lit environments, while in bright light, larger changes in light are required to distinguish them; however, screen reflectivity also affects the viewing experience, and when the ambient light is bright, the light reflected from the screen mixes with the light from the image itself, making it difficult to discern details in dark areas, and even increasing screen brightness still cannot achieve the desired effect, this application provides an image processing method, apparatus, electronic device, and storage medium that can acquire the ambient light intensity. When the ambient light is high, it adjusts the contrast between different gray levels in the dark areas of the image according to relevant parameters and algorithms to achieve a visual effect that allows the dark areas of the image to be distinguished in bright environments.
[0056] The perceived contrast between different bright and dark areas on a screen image observed by the human eye should be close to the perceived contrast between different bright and dark areas on a real image. If the perceived contrast between different bright and dark areas on a screen image is lower than that when observing a real image, it will be difficult for human perception to distinguish between different bright and dark areas on the image.
[0057] For example, if an image consists of two gray blocks of different shades, the contrast between these two blocks can be calculated and referenced using the Michelson contrast formula:
[0058]
[0059] Among them, L max and L min Let L represent the perceived brightness of the two color blocks. Besides the light emitted by the electronic screen itself, the ambient light reflected from the screen also affects the perceived brightness L; let the ambient light brightness be L. env If the screen reflectivity is 'a' and the screen luminance is 'BL', then the perceived brightness L = BL + a·L env .
[0060] The actual contrast ratio should be:
[0061]
[0062] Therefore, it can be seen that the denominator of the above formula increases significantly, and the actual contrast decreases. Ambient light factors reduce the perceived contrast of the image. When the image brightness is high, the contrast attenuation is small; while when the brightness is low, the contrast attenuation is large.
[0063] Figure 1 This is a schematic flowchart of an image processing method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method specifically includes:
[0064] S101. When the ambient brightness is detected to be higher than the preset threshold, in response to the brightness adjustment request, the display parameters of the device corresponding to the target image are obtained.
[0065] A preset threshold is a pre-defined brightness limit value used to distinguish whether the ambient brightness has reached a level requiring image adjustment. When the ambient brightness exceeds this preset threshold, it indicates that the current ambient light is too strong, which may make it difficult to discern details in the dark areas of the image, affecting the display effect. The preset threshold can be flexibly adjusted according to different application scenarios and actual needs. For example, the preset threshold may differ between indoor and outdoor environments because indoor ambient light is relatively stable and its intensity is generally not too high, so the preset threshold may be relatively low indoors; while in outdoor environments, the preset threshold needs to be set relatively high to adapt to the variable and potentially strong ambient light.
[0066] The target image includes different bright and dark areas. If the ambient light is high, the perceived contrast between different bright and dark areas on the screen image is lower than that when observing the real image, making it difficult for human perception to distinguish between different bright and dark areas on the image. At this time, a brightness adjustment request is issued to start the image processing process.
[0067] The target image corresponds to an electronic product with a screen. The screen of such devices has reflective properties. When the ambient light is bright, the actual light intensity entering the viewer's eyes is the sum of the image's own emission and the light reflected from the screen. This results in the perceived brightness of dark areas of the image being much higher than the image's actual brightness. The device's display parameters include both the display screen parameters and the parameters of the environment in which the display is located.
[0068] In this embodiment, when the brightness of the current environment is detected to be higher than the brightness limit value, in response to the brightness adjustment request, the current ambient light intensity data and the device parameters of the current display device are first obtained to provide basic data support for subsequent image adjustment and ensure that the image can present clear details under different lighting conditions.
[0069] S102. Call the image optimization tool to analyze and process the display parameters, and calculate the corresponding gamma adjustment coefficient, wherein the gamma adjustment coefficient is the adjustment coefficient of the gamma function.
[0070] Image optimization tools are software or algorithm modules that adjust parameters such as brightness and contrast of images. They can intelligently calculate and generate the optimal adjustment strategy by analyzing the current ambient light and device parameters, ensuring that details in dark areas can be clearly presented in bright environments.
[0071] Specifically, the image optimization tool is a computer program module stored in an electronic device, which includes gamma coefficient calculation algorithms, grayscale parameter matching logic, etc. It can be executed by the processor to realize display parameter analysis and adjustment strategy generation.
[0072] The gamma adjustment factor is a parameter used in image processing to correct the non-linear relationship between light-sensing devices (such as cameras and displays) and human visual perception. Its core principle is based on the gamma function. However, viewers' sensitivity to image details varies under different lighting conditions. Due to screen reflection, the dark areas of the image that viewers see are not truly dark areas. The presence of ambient light and screen reflectivity brightens what were originally "dark areas." Therefore, it is necessary to adjust the gamma factor to compensate for the influence of ambient light and ensure that the details in the dark areas of the image are realistically presented under different lighting conditions.
[0073] Taking regions with grayscale values of 10, 20, and 30 as representing the extremely dark, moderately dark, and medium-dark areas of an image, respectively, as an example, in situations with strong ambient light, details in dark areas may become blurred due to the superposition of screen reflections and ambient light. The grayscale values of the target image are adjusted using a target gamma function. For example, a region with a grayscale value of 10 might be adjusted to a darker grayscale value (such as 8 or 9) to enhance its contrast with surrounding areas; a region with a grayscale value of 20 might be adjusted to a slightly darker grayscale value (such as 18 or 19) to maintain its dark characteristics while enhancing contrast; and a region with a grayscale value of 30 might be adjusted to a slightly lighter grayscale value (such as 31 or 32) to maintain its dark characteristics while creating a better transition with brighter areas.
[0074] In this embodiment, an image optimization tool is invoked to calculate a gamma adjustment factor that matches the output device in the current lighting environment, taking into account ambient light and device parameters. The standard gamma curve is then adjusted to ensure that details in dark areas are clearly displayed under different lighting conditions.
[0075] S103. Based on the gamma adjustment coefficient, determine the target gamma adjustment parameters for the dark areas in the target image, and determine the adjustment strategy for the dark areas in the target image according to the target gamma adjustment parameters.
[0076] Dark areas refer to the parts of an image with relatively low brightness. In high ambient light, details in dark areas are easily difficult to discern due to factors such as screen reflection.
[0077] It should be noted that the division between dark and bright areas can be based on the grayscale value distribution of the image. For example, a preset grayscale threshold can be set; areas with grayscale values below this threshold are considered dark areas, while areas above the threshold are considered bright areas. The grayscale threshold can be determined in various ways, such as based on the overall brightness statistics of the image, or by combining the perceptual characteristics of the human eye for different brightness areas.
[0078] In this embodiment, after obtaining the gamma adjustment coefficients, the gamma adjustment parameters corresponding to the image grayscale of the dark area are determined from the adjusted gamma function to obtain the target gamma adjustment parameters. Furthermore, the adjustment strategy for the entire target image is determined by using the target gamma adjustment parameters corresponding to each pixel of the target image.
[0079] S104. Adjust the dark areas of the target image using the adjustment strategy.
[0080] In this embodiment, after obtaining the adjustment strategy, the dark areas of the target image are processed pixel by pixel, the gray levels of the dark areas are dynamically adjusted, the contrast between different gray levels in the dark areas of the image is improved, the details in the dark areas are clearer in the bright environment, and the overall visual effect is improved.
[0081] The image processing method provided in this application embodiment obtains the device display parameters of the image output display device when the current ambient brightness is detected to be higher than a preset threshold. Then, based on the device display parameters, it calls the image optimization tool to determine the adjustment strategy of the target image. The adjustment strategy can perform brightness adjustment processing on the dark areas in the image, improve the contrast between different gray levels in the dark areas of the image, ensure that the dark details are clear in the bright environment, thereby improving the recognition of dark details and enhancing the overall visual experience.
[0082] Figure 2 This is a flowchart illustrating a method for obtaining target gamma adjustment parameters provided in an embodiment of this application, as shown below. Figure 2 As shown, determining the target gamma adjustment parameters for the dark areas of the target image based on the gamma adjustment coefficient includes:
[0083] S201. Based on the gamma adjustment coefficient, the standard gamma function is adjusted to obtain the target gamma function corresponding to the display parameter.
[0084] The standard gamma function is y = x γ Where y is the actual gray level / brightness, x is the image electrical signal gray level / brightness (close to perceived gray level), and γ is the standard gamma value, which is generally taken as 2.2.
[0085] In this embodiment, by adjusting the value of k, the target gamma function is made to approach 1 when x approaches 1, thus obtaining a new target gamma function with corresponding display parameters.
[0086] Specifically, the gamma function is represented by a gamma curve, which reflects the non-linear relationship between image grayscale values and output brightness. Combining parameters such as screen reflectivity, backlight brightness, and existing gamma curves, a new set of gamma curves is obtained using a specific algorithm. Compared to the original gamma curve parameters, the new parameters significantly improve the contrast between different grayscale levels in the dark areas of the image. Introducing the new gamma parameters into the display system is a smooth transition. Thus, the image uses the new gamma parameters, resulting in higher contrast between different grayscale levels in the dark areas, making details in the darker areas easier to discern.
[0087] S202. Based on the target gamma function, determine the gamma adjustment parameters corresponding to multiple different image gray levels to obtain a set of gamma adjustment parameters.
[0088] In this embodiment, after obtaining the adjusted target gamma function, the gamma adjustment parameters corresponding to each different image gray level between 0 and 255 are determined from the target gamma function to obtain a set of gamma adjustment parameters.
[0089] S203. Based on the image grayscale of the dark area in the target image, select a matching gamma adjustment parameter from the set of gamma adjustment parameters as the target gamma adjustment parameter.
[0090] In this embodiment, the brightness value of each pixel in the dark area of the target image is determined, i.e., the image grayscale. Then, based on the image grayscale, the gamma adjustment parameter corresponding to the grayscale value is selected from the gamma adjustment parameter set as the target gamma adjustment parameter.
[0091] The target gamma adjustment parameter acquisition method provided in this application adjusts the standard gamma function based on the gamma adjustment coefficient to obtain a target gamma function that meets specific display requirements. Then, it determines the parameters corresponding to the gray values of the dark areas from the adjusted gamma function to obtain the target gamma adjustment parameters, ensuring that the details in the dark areas of the image are realistically restored.
[0092] like Figure 3 As shown, the curve of the standard gamma function illustrates the screen luminance corresponding to different grayscale values under ideal conditions. However, in practical applications, due to the influence of ambient light and screen reflection, the gamma function needs to be adjusted to adapt to different lighting conditions.
[0093] For display screens, any grayscale level (0%–100%) in an ideal environment corresponds to the screen's specific luminous intensity, and the reflected light intensity can also be found on the curve as a key point for the "ideal output grayscale." Therefore, to ensure that dark areas under ambient light conditions can be well identified and perceived, the actual changes in dark area output brightness need to closely approximate the trend of change after the "identified key point." Figure 4As shown, the green line represents the adjusted target gamma function, which approaches 1 when the grayscale value x is close to 1, thus avoiding the overexposure problem to the right of point A in the image.
[0094] To address this, by applying the gamma adjustment coefficient, a target gamma function was obtained after adjusting for specific display parameters. This ensures that the dark details of the image can be appropriately enhanced at different grayscale values, while avoiding overexposure of the bright areas.
[0095] like Figure 3 As shown, the curve of the standard gamma function depicts the changes in screen luminance corresponding to different gray values (from the darkest 0% to the brightest 100%) in an idealized, interference-free environment.
[0096] However, in real-world usage environments, the screen is inevitably affected by ambient light and reflected light from its surface. These external factors can interfere with and alter the actual display effect. For display screens, in an ideal, interference-free environment, any specific grayscale value (ranging from 0% black to 100% white) can precisely correspond to a specific luminance value on the screen. Furthermore, even the luminance generated by screen reflections can be traced to a corresponding "ideal output grayscale" key point on the standard gamma function curve. By adjusting the screen's output brightness to make its trend as close as possible to the trend of the standard gamma function curve from the "identified key point," a technical effect can be achieved where, under actual ambient light conditions, the dark areas of the screen can still be clearly discerned and perceived by the viewer.
[0097] like Figure 4 As shown, the green line represents the adjusted target gamma function, which maintains the trend of the original curve to the right of the key point, while ensuring the rationality of the output across the entire grayscale range.
[0098] A(k, k) γ Point A is the small blue dot on the graph. Assuming that this point is the "key point" calculated based on the brightness information of a certain display screen and the ambient reflected light, we need to shift the curve (i.e., the red line) to the green line, that is, move point A to the origin (0, 0).
[0099] Red line function: y = x γ γ = 2.2, 0 ≤ x ≤ 1;
[0100] Green line function: y = (x + k) γ -k γ γ = 2.2;
[0101] The green line function maintains the trend to the right of point A on the red line, but when the green line is in the range of (0.8, 1), y > 1, and the highlighted parts of the image are already overexposed. Therefore, the green line needs to be adjusted so that when x approaches 1, y also approaches 1.
[0102] Therefore, the new formula is as follows:
[0103]
[0104] In the above formula, k represents the correlation coefficient of the "key point", that is, the adjustment coefficient.
[0105] In this embodiment, the adjusted gamma function can ensure that the dark details of the image are enhanced appropriately under different grayscale settings, so that the dark areas no longer lose details due to the interference of ambient light, while effectively avoiding overexposure of the bright parts of the image, thereby improving the overall quality and visual experience of the displayed image.
[0106] In an optional embodiment of the present invention, the method further includes:
[0107] Based on the gamma adjustment coefficient, the target gamma adjustment parameters for the bright areas in the target image are determined, and the adjustment strategy for the bright areas in the target image is determined according to the target gamma adjustment parameters.
[0108] The adjustment strategy is used to adjust the bright areas of the target image.
[0109] Highlight areas refer to the relatively bright parts of an image. In bright environments, these areas are prone to overexposure, leading to a loss of detail.
[0110] In this embodiment, the bright areas are treated in a similar way to the dark areas described above. First, an adjustment strategy is determined, and then the adjustment strategy is used to make specific adjustments. The process of determining the adjustment strategy can be referred to in the detailed description of the dark area processing method above. Since the core principle and implementation process are basically the same, they will not be discussed again here.
[0111] Figure 5 This is a flowchart illustrating a method for obtaining display parameters provided in an embodiment of this application, as shown below. Figure 5 As shown, obtaining the display parameters of the device corresponding to the target image includes:
[0112] S501. Obtain the current power consumption of the device corresponding to the target image.
[0113] Current energy consumption refers to the energy consumed by the device corresponding to the target image in its current operating state. The energy consumption of a device is related to many factors, such as the type of device, screen brightness, and running programs.
[0114] In this embodiment, the current energy consumption data of the device is obtained through the built-in energy consumption monitoring module.
[0115] S502. When the current energy consumption is lower than the energy consumption threshold, obtain the device screen reflectivity and screen peak brightness.
[0116] Energy consumption threshold refers to a pre-set standard value for energy consumption. When the current energy consumption of the device is lower than the threshold, it means that the device is in a relatively low energy consumption operating state. When the current energy consumption of the device is higher than the threshold, it means that the device is in a high energy consumption operating state.
[0117] Device screen reflectivity refers to the screen's ability to reflect ambient light, which affects image contrast and sharpness; peak screen brightness refers to the maximum brightness value that the screen can achieve. These two parameters are crucial for accurately adjusting the display effect.
[0118] In this embodiment, when the device energy consumption is lower than the energy consumption threshold, that is, when the device is in a low energy consumption state, the device screen reflectivity and peak screen brightness are obtained by professional optical measurement instruments.
[0119] S503. When the current energy consumption is higher than the energy consumption threshold, obtain the device screen reflectivity and the historical screen brightness record of the device, and determine the peak screen brightness of the device based on the historical screen brightness record. The historical screen brightness record is the screen brightness record of the device in a low energy consumption state.
[0120] In this embodiment, when the device energy consumption is higher than the energy consumption threshold, that is, when the device is in a high energy consumption state, the screen brightness may be unstable due to various factors in the high energy consumption state. The peak brightness of the device screen is determined by obtaining the device screen reflectivity and the historical screen brightness records of the device in the low energy consumption state. By using the brightness data of the device in the stable low energy consumption state, the maximum brightness value that the screen can reach can be inferred more accurately.
[0121] S504. Obtain the ambient light level of the environment in which the device is located, and the adjustment coefficient of the device's screen brightness under the current ambient light level.
[0122] The adjustment coefficient is the numerical value used by the device to adjust the screen brightness under different lighting conditions.
[0123] In this embodiment, the ambient light level of the device's environment is obtained through a light sensor, and the screen brightness adjustment coefficient under the current ambient light level is determined by combining the device's historical usage data and a preset algorithm.
[0124] S505, The illumination intensity, adjustment coefficient, screen reflectivity and screen peak brightness are used as the display parameters of the device corresponding to the target image.
[0125] In this embodiment, the influence of ambient light and screen characteristics on image processing effects are comprehensively considered to form the display parameters of the device corresponding to the target image, providing a data basis for subsequent image adjustment. Then, using these parameters, the image optimization tool calculates an image adjustment strategy that adapts to the current environment, thereby ensuring that the image can present the best visual effect under various lighting conditions.
[0126] The display parameter acquisition method provided in this application can adjust the acquisition method of image display parameters according to the power consumption status of the device. When the device is in a low power consumption state, the screen reflectivity and peak screen brightness are directly measured. When the device is in a high power consumption state, the peak screen brightness is determined by acquiring the device screen reflectivity and historical screen brightness records. This effectively avoids interference from unstable screen brightness in high power consumption state on parameter acquisition, and ensures that relatively accurate display parameters can be obtained under different power consumption conditions, so as to achieve a balance between image display effect and device power consumption.
[0127] In an optional embodiment of the present invention, the step of calling an image optimization tool to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient includes:
[0128] The gamma adjustment factor k is calculated using the following formula:
[0129]
[0130] Where k is the gamma adjustment factor, L a Let ρ be the illuminance, ρ be the screen reflectivity, β be the adjustment coefficient, and L be the illuminance. max γ represents the peak brightness of the screen, and γ is the preset gamma coefficient.
[0131] Specifically, a function switch item (such as "Auto Anti-reflection" function) is added to the relevant settings menu. When the user turns on the function, it takes effect, and a new adjustment function item appears on the UI (or the item that was originally in an unadjustable state becomes adjustable) to adjust the degree of intensity. Through this function, users can flexibly adjust the image processing effect according to actual needs. The coefficient β corresponding to this function is used to deal with the problem that ambient light and screen brightness are difficult to measure uniformly.
[0132] In an optional embodiment of the present invention, the method further includes: updating the display parameters according to the brightness change of the ambient light intensity of the environment in which the device is located when the ambient light intensity changes; and re-executing the step of calling the image optimization tool to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient using the updated display parameters.
[0133] In this embodiment, by monitoring changes in ambient light in real time and dynamically adjusting display parameters, the image maintains the best display effect under different lighting conditions, thereby improving the user experience.
[0134] Specifically, when the ambient light changes, the system re-acquires display parameters, including screen reflectivity, peak brightness, and adjustment coefficient, and recalculates the gamma adjustment coefficient based on the new parameters. It also automatically updates the image processing strategy to ensure continuous optimization of visual effects and meet the user's visual needs under different lighting conditions.
[0135] In an optional embodiment of the present invention, updating the display parameters according to the brightness change of the illumination includes: updating the adjustment coefficient according to the brightness change of the illumination; and using the updated adjustment coefficient, screen reflectivity, screen peak brightness, and current illumination as new display parameters for the device corresponding to the target image, so as to update the display parameters.
[0136] When the ambient light level changes, the adjustment coefficient β set by the device will be dynamically adjusted according to the change in ambient light level in order to adapt to the current environment, ensuring that the image optimization tool can respond to environmental changes in real time.
[0137] In this embodiment, when the ambient light changes, the change in light intensity is automatically detected, and the adjustment coefficient β is dynamically adjusted according to the magnitude of the change to ensure that the display parameters match the actual environment.
[0138] like Figure 6 As shown, the image processing process mainly includes the following units:
[0139] Image Presentation Unit: This unit is primarily responsible for clearly displaying images for user viewing. Specifically, this unit can be a high-resolution LCD screen, featuring vibrant colors, high contrast, and fast response; or it can be a large projection screen, projecting images onto the screen via a projector, suitable for scenarios such as large conferences or home theaters.
[0140] Image processing and output unit: The core function of this unit is to process and output image electronic data signals for display by the image presentation unit. Specifically, it performs a series of complex processing operations such as decoding, scaling, and color correction on the original image data to ensure that the output image signal has high quality and strong stability, and finally presents a delicate and realistic picture effect on the image presentation unit.
[0141] Light sensor unit: The main function of this unit is to acquire real-time information about the ambient light intensity. Through a built-in high-sensitivity light sensor, it accurately measures the brightness of the ambient light and transmits this data to the processing and control center unit. This allows the system to automatically adjust the brightness and contrast of the image display unit according to the actual lighting conditions, thereby enhancing the user's visual experience.
[0142] Processing Control Center Unit: As the core component of the entire system, the processing control center unit undertakes several key tasks, including data analysis and processing, and overall control of business logic. It not only needs to efficiently process and analyze data from various units, but also coordinate and control the collaborative work of various units according to preset business logic and user instructions to ensure the stable operation and rapid response of the entire system and meet the diverse needs of users.
[0143] Based on this system architecture, image processing includes the following steps:
[0144] Step 1: Enable the function. Specifically, find and activate this function on the user interface (UI) and ensure that the function is adjustable to facilitate the subsequent steps.
[0145] Step 2: The light sensor unit starts working, accurately collecting the light intensity information of the current environment, and quickly sending this real-time data to the processing and control center for subsequent analysis and processing;
[0146] Step 3: After receiving the ambient light brightness information sent by the light sensor unit, the processing control center combines a series of key parameters (including ambient light brightness, current screen brightness, screen reflectivity, user-defined β coefficient, and preset Gamma dataset) and specific algorithms to perform complex calculations and optimizations, and finally generate a new Gamma dataset.
[0147] Step 4: The processing control center accurately transmits the newly generated Gamma dataset to the "Image Processing and Output Unit" to ensure that the unit can perform image processing according to the latest dataset;
[0148] Step 5: After receiving the new Gamma dataset, the "Image Processing and Output Unit" performs fine processing on the image signal based on this data, and outputs the processed image signal to the image rendering unit to achieve the best display effect.
[0149] After completing the above steps, the system automatically jumps back to step two to continue a new round of ambient light intensity information collection and processing, forming a closed-loop dynamic adjustment process to ensure that image processing is always in the optimal state.
[0150] Figure 7This application provides a schematic diagram of the structure of an image processing device, as shown in the embodiments below. Figure 7 As shown, the device specifically includes:
[0151] The acquisition module 701 is used to acquire the display parameters of the device corresponding to the target image in response to a brightness adjustment request when the ambient brightness is detected to be higher than a preset threshold.
[0152] The calling module 702 is used to call the image optimization tool to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient, wherein the gamma adjustment coefficient is the adjustment coefficient of the gamma function;
[0153] The determining module 703 is used to determine the target gamma adjustment parameters of the dark area in the target image based on the gamma adjustment coefficient, and to determine the adjustment strategy of the dark area in the target image according to the target gamma adjustment parameters;
[0154] The adjustment module 704 is used to adjust the dark areas of the target image using the adjustment strategy.
[0155] In one possible implementation, the determining module 703 is further configured to adjust the standard gamma function based on the gamma adjustment coefficient to obtain the target gamma function corresponding to the display parameter; determine gamma adjustment parameters corresponding to multiple different image gray levels according to the target gamma function to obtain a set of gamma adjustment parameters; and select a matching gamma adjustment parameter from the set of gamma adjustment parameters as the target gamma adjustment parameter according to the image gray level of the dark area in the target image.
[0156] In one possible implementation, the apparatus further includes a processing module 705 (not shown in the figure), configured to determine target gamma adjustment parameters for the bright areas in the target image based on the gamma adjustment coefficients, and to determine an adjustment strategy for the bright areas in the target image based on the target gamma adjustment parameters; and to adjust the bright areas of the target image using the adjustment strategy.
[0157] In one possible implementation, the acquisition module 701 is further configured to acquire the current power consumption of the device corresponding to the target image; when the current power consumption is lower than the power consumption threshold, acquire the device screen reflectivity and peak screen brightness; when the current power consumption is higher than the power consumption threshold, acquire the device screen reflectivity and the device's historical screen brightness records, and determine the device's peak screen brightness based on the historical screen brightness records, wherein the historical screen brightness records are the screen brightness records of the device in a low power consumption state; acquire the ambient light intensity of the environment in which the device is located, and the adjustment coefficient of the device's screen brightness under the current ambient light intensity; and use the ambient light intensity, adjustment coefficient, screen reflectivity, and peak screen brightness as display parameters of the device corresponding to the target image.
[0158] In one possible implementation, the calling module 702 is further configured to calculate the gamma adjustment factor k using the following formula: Where k is the gamma adjustment factor, L a Let ρ be the illuminance, ρ be the screen reflectivity, β be the adjustment coefficient, and L be the illuminance. max γ represents the peak brightness of the screen, and γ is the preset gamma coefficient.
[0159] In one possible implementation, the device further includes an update module 706 (not shown) for updating the display parameters according to the brightness change of the ambient light intensity when the ambient light intensity of the device changes; and using the updated display parameters, re-execute the step of calling the image optimization tool to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient.
[0160] In one possible implementation, the update module 706 is further configured to update the adjustment coefficient according to the brightness change of the illumination; and use the updated adjustment coefficient, screen reflectivity and screen peak brightness, as well as the current illumination, as new display parameters of the device corresponding to the target image, so as to realize the update of the display parameters.
[0161] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0162] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 8 As shown, this application provides an electronic device including a processor 801, a communication interface 802, a memory 803, and a communication bus 804. The processor 801, communication interface 802, and memory 803 communicate with each other via the communication bus 804. The memory 803 stores computer programs. When the processor 801 executes the program stored in the memory 803, it implements the image processing steps provided in any of the aforementioned method embodiments.
[0163] When the ambient brightness is detected to be higher than a preset threshold, in response to a brightness adjustment request, the display parameters of the device corresponding to the target image are obtained; an image optimization tool is invoked to analyze and process the display parameters, and the corresponding gamma adjustment coefficient is calculated, wherein the gamma adjustment coefficient is the adjustment coefficient of the gamma function; based on the gamma adjustment coefficient, the target gamma adjustment parameter of the dark area in the target image is determined, and the adjustment strategy of the dark area in the target image is determined according to the target gamma adjustment parameter; the dark area of the target image is adjusted using the adjustment strategy.
[0164] In one possible implementation, the standard gamma function is adjusted based on the gamma adjustment coefficient to obtain the target gamma function corresponding to the display parameter; based on the target gamma function, gamma adjustment parameters corresponding to multiple different image gray levels are determined to obtain a set of gamma adjustment parameters; according to the image gray level of the dark area in the target image, a matching gamma adjustment parameter is selected from the set of gamma adjustment parameters as the target gamma adjustment parameter.
[0165] In one possible implementation, based on the gamma adjustment coefficient, a target gamma adjustment parameter is determined for the bright areas in the target image, and an adjustment strategy for the bright areas in the target image is determined according to the target gamma adjustment parameter; the adjustment strategy is then used to adjust the bright areas of the target image.
[0166] In one possible implementation, the current power consumption of the device corresponding to the target image is obtained; when the current power consumption is lower than a power consumption threshold, the device screen reflectivity and peak screen brightness are obtained; when the current power consumption is higher than the power consumption threshold, the device screen reflectivity and historical screen brightness records of the device are obtained, and the peak screen brightness of the device is determined based on the historical screen brightness records, wherein the historical screen brightness records are the screen brightness records of the device in a low power consumption state; the ambient light intensity of the environment in which the device is located is obtained, and the adjustment coefficient of the device screen brightness under the current ambient light intensity is obtained; the ambient light intensity, adjustment coefficient, screen reflectivity, and peak screen brightness are used as display parameters of the device corresponding to the target image.
[0167] In one possible implementation, the gamma adjustment factor k is calculated using the following formula;
[0168] Where k is the gamma adjustment factor, L a Let ρ be the illuminance, ρ be the screen reflectivity, β be the adjustment coefficient, and L be the illuminance. max γ represents the peak brightness of the screen, and γ is the preset gamma coefficient.
[0169] In one possible implementation, when the ambient light intensity of the environment in which the device is located changes, the display parameters are updated according to the brightness change of the ambient light intensity; using the updated display parameters, the step of calling the image optimization tool to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient is re-executed.
[0170] In one possible implementation, the adjustment coefficient is updated based on the brightness change of the illumination; the updated adjustment coefficient, screen reflectivity, screen peak brightness, and current illumination are used as new display parameters for the device corresponding to the target image, thereby updating the display parameters.
[0171] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0172] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0173] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. An image processing method, characterized in that, include: When the ambient brightness is detected to be higher than a preset threshold, the display parameters of the device corresponding to the target image are obtained in response to the brightness adjustment request. The image optimization tool is invoked to analyze and process the display parameters, and the corresponding gamma adjustment coefficient is calculated. The gamma adjustment coefficient is the adjustment coefficient of the gamma function. Based on the gamma adjustment coefficient, the target gamma adjustment parameters for the dark areas in the target image are determined, and the adjustment strategy for the dark areas in the target image is determined according to the target gamma adjustment parameters. The adjustment strategy is used to adjust the dark areas of the target image.
2. The method according to claim 1, characterized in that, The step of determining the target gamma adjustment parameters for the dark areas of the target image based on the gamma adjustment coefficient includes: Based on the gamma adjustment coefficient, the standard gamma function is adjusted to obtain the target gamma function corresponding to the display parameter; Based on the target gamma function, gamma adjustment parameters corresponding to multiple different image gray levels are determined to obtain a set of gamma adjustment parameters; Based on the image grayscale of the dark areas in the target image, a matching gamma adjustment parameter is selected from the set of gamma adjustment parameters and used as the target gamma adjustment parameter.
3. The method according to claim 1, characterized in that, The method further includes: Based on the gamma adjustment coefficient, the target gamma adjustment parameters for the bright areas in the target image are determined, and the adjustment strategy for the bright areas in the target image is determined according to the target gamma adjustment parameters. The adjustment strategy is used to adjust the bright areas of the target image.
4. The method according to claim 1, characterized in that, The step of obtaining the display parameters of the device corresponding to the target image includes: Obtain the current power consumption of the device corresponding to the target image; When the current energy consumption is lower than the energy consumption threshold, obtain the device screen reflectivity and screen peak brightness; When the current energy consumption is higher than the energy consumption threshold, the device screen reflectivity and the historical screen brightness record of the device are obtained, and the peak screen brightness of the device is determined based on the historical screen brightness record. The historical screen brightness record is the screen brightness record of the device in a low energy consumption state. The ambient light intensity of the environment in which the device is located, and the adjustment coefficient of the device's screen brightness under the current ambient light intensity are obtained; The illumination intensity, adjustment coefficient, screen reflectivity, and screen peak brightness are used as the display parameters of the device corresponding to the target image.
5. The method according to claim 1, characterized in that, The process of calling the image optimization tool to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient includes: The gamma adjustment factor k is calculated using the following formula: Where k is the gamma adjustment factor, L a Let ρ be the illuminance, ρ be the screen reflectivity, β be the adjustment coefficient, and L be the illuminance. max γ represents the peak brightness of the screen, and γ is the preset gamma coefficient.
6. The method according to claim 4, characterized in that, The method further includes: When the ambient light intensity of the environment in which the device is located changes, the display parameters are updated according to the brightness change of the ambient light intensity. Using the updated display parameters, the step of calling the image optimization tool is re-executed to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient.
7. The method according to claim 6, characterized in that, The step of updating the display parameters based on the brightness change of the illumination intensity includes: The adjustment coefficient is updated based on the brightness change of the illumination intensity; The updated adjustment coefficients, screen reflectivity, and screen peak brightness, along with the current illumination, are used as the new display parameters for the device corresponding to the target image, thereby updating the display parameters.
8. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire the display parameters of the device corresponding to the target image in response to a brightness adjustment request when the ambient brightness is detected to be higher than a preset threshold. The calling module is used to call the image optimization tool to analyze and process the display parameters and calculate the corresponding gamma adjustment coefficient, wherein the gamma adjustment coefficient is the adjustment coefficient of the gamma function; The determination module is used to determine the target gamma adjustment parameters of the dark areas in the target image based on the gamma adjustment coefficients, and to determine the adjustment strategy of the dark areas in the target image according to the target gamma adjustment parameters; An adjustment module is used to adjust the dark areas of the target image using the adjustment strategy.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the image processing method according to any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the image processing method according to any one of claims 1 to 7.