Image processing method and device

By using the initial adjustment ratio, target brightness adjustment coefficient and pixel point saturation in the image processing method, the problem that the image dynamic range exceeds the display screen's ability is solved, and a better image display effect is achieved.

CN119809996APending Publication Date: 2025-04-11LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411998216.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

When the dynamic range of the image to be displayed is higher than the dynamic range that the display can display, the image to be displayed needs to be optimized to improve the display effect of the display screen on the image.

Method used

By obtaining the initial adjustment ratio of the image to be processed, combining the target brightness adjustment coefficient and the saturation of the pixel points, the target adjustment ratio is determined, and the image pixel value is adjusted to generate the target image.

Benefits of technology

The image is finely adjusted according to the brightness and saturation of pixel points, which improves the display effect of the image on the display screen and avoids the problem of overexposed light.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119809996A_ABST
    Figure CN119809996A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device. The method comprises the steps of obtaining a to-be-processed image; obtaining an initial adjustment proportion corresponding to the to-be-processed image, wherein the initial adjustment proportion is determined by the original brightness data of each pixel point in the to-be-processed image and a target filtering algorithm; determining a target adjustment proportion according to the initial adjustment proportion, a target brightness adjustment coefficient and the saturation of each pixel point in the to-be-processed image; and adjusting the pixel value of each pixel point in the to-be-processed image according to the target adjustment proportion and the target brightness adjustment coefficient to generate a target image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an image processing method and device. Background Art

[0002] Currently, when the dynamic range of the image to be displayed is higher than the dynamic range that can be displayed by the display screen, the image to be displayed needs to be optimized so that the optimized image can adapt to the display screen to improve the display effect of the display screen on the image. Summary of the invention

[0003] An embodiment of the present application provides an image processing method, including: obtaining an image to be processed; obtaining an initial adjustment ratio corresponding to the image to be processed, wherein the initial adjustment ratio is determined by original brightness data of each pixel in the image to be processed and a target filtering algorithm; determining a target adjustment ratio according to the initial adjustment ratio, a target brightness adjustment coefficient, and the saturation of each pixel in the image to be processed; and adjusting the pixel value of each pixel in the image to be processed according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image.

[0004] In some embodiments, the pixel value of each pixel in the image to be processed is adjusted according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image, including: obtaining ambient light parameters, and determining an ambient brightness coefficient according to the ambient light parameters; determining target color parameters according to the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient; adjusting the pixel value of each pixel in the image to be processed according to the target color parameters to generate the target image.

[0005] In some embodiments, the target color parameters are determined according to the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient, including: determining the initial color parameters according to the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient; when the initial color parameters are less than a specified threshold parameter, determining the initial color parameters as the target color parameters; when the initial color parameters are not less than the specified threshold parameter, determining the specified threshold parameter as the target color parameter.

[0006] In some embodiments, the initial color parameters are determined based on the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient, including: determining a first value range based on the ambient brightness coefficient; determining a first target value based on the target brightness adjustment coefficient and the first value range; determining the initial color parameters based on the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the first target value.

[0007] In some embodiments, the ambient light parameters include ambient brightness values, and determining an ambient brightness coefficient based on the ambient light parameters includes: determining a target ambient brightness value range corresponding to the ambient brightness value from a plurality of ambient brightness value ranges; determining a target ambient brightness reference value from a plurality of ambient brightness reference values ​​based on the target ambient brightness value range, each of the ambient brightness reference values ​​corresponding to a range of the ambient brightness values; and determining the ambient brightness coefficient based on the target ambient brightness reference value.

[0008] In some embodiments, the target adjustment ratio is determined according to the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed, including: determining an initial ratio adjustment parameter according to the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed; determining a second value range according to the initial adjustment ratio; determining a second target value according to the initial ratio adjustment parameter and the second value range; adjusting the initial adjustment ratio according to the second target value to determine the target adjustment ratio.

[0009] In some embodiments, before determining the target adjustment ratio based on the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed, it also includes: determining the brightness of each pixel in the image to be processed; determining the target brightness adjustment coefficient based on the brightness, the target brightness adjustment coefficient is positively correlated with the brightness when the brightness is lower than a first brightness threshold, and the target brightness adjustment coefficient is negatively correlated with the brightness when the brightness is higher than a second brightness threshold, and the first brightness threshold is less than the second brightness threshold.

[0010] An embodiment of the present application also proposes an image processing device, including: a first acquisition module, used to acquire an image to be processed; a second acquisition module, used to obtain an initial adjustment ratio corresponding to the image to be processed, wherein the initial adjustment ratio is determined by the original brightness data of each pixel in the image to be processed and a target filtering algorithm; a determination module, used to determine a target adjustment ratio based on the initial adjustment ratio, a target brightness adjustment coefficient and the saturation of each pixel in the image to be processed; and a generation module, used to adjust the pixel value of each pixel in the image to be processed according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image.

[0011] In some embodiments, it also includes: a display module for comparing and displaying the target image and the comparison image, the comparison image includes at least one of the image to be processed and the initial adjustment image, and the initial adjustment image is generated after adjusting the pixel value of each pixel point in the image to be processed according to the initial adjustment ratio.

[0012] In some embodiments, it also includes: an interaction module, which is used to adjust the target parameters in the target image corresponding to the adjustment instruction in response to the adjustment instruction for the target image. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0014] Figure 1 A flowchart of an image processing method according to an embodiment of the present application;

[0015] Figure 2 A flowchart of generating a target image according to an embodiment of the present application;

[0016] Figure 3 A flow chart of determining target color parameters according to an embodiment of the present application;

[0017] Figure 4 A flowchart of determining an ambient brightness coefficient according to an embodiment of the present application;

[0018] Figure 5 A flow chart of determining a target adjustment ratio according to an embodiment of the present application;

[0019] Figure 6 A flow chart of determining a target brightness adjustment coefficient according to an embodiment of the present application;

[0020] Figure 7This is a structural block diagram of an image processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0021] Various aspects and features of the present application are described herein with reference to the accompanying drawings.

[0022] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.

[0023] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0024] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.

[0025] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.

[0026] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.

[0027] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.

[0028] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.

[0029] An image processing method according to an embodiment of the present application obtains an initial adjustment ratio corresponding to an image to be processed, determines a target adjustment ratio according to the initial adjustment ratio, a target brightness adjustment coefficient, and the saturation of each pixel in the image to be processed, and adjusts the pixel value of each pixel in the image to be processed according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image. Since the brightness and saturation of each pixel are taken into consideration in the process of determining the target adjustment ratio, the pixel is adjusted according to the brightness and saturation of the pixel, thereby improving the display effect of the image.

[0030] like Figure 1 As shown, the image processing method comprises the following steps:

[0031] Step S101, obtaining an image to be processed.

[0032] In this embodiment, the execution subject of the image processing method can be a processor in an electronic device, or an image processing module independent of the processor. The electronic device can be, for example, any one of a mobile phone, a tablet, a laptop computer, a television, etc. The image to be processed can be an image captured in real time, or an image specified by a user, or an image received from another device. The dynamic range of the image to be processed can be higher than the dynamic range that can be displayed by the display screen, and the image to be processed is subsequently adjusted so that the adjusted target image can be displayed normally on the display screen. For example, the image to be processed can be an image captured by a camera, and the dynamic range of the image is higher than the dynamic range that can be displayed by the display screen of the mobile phone. The display screen of the mobile phone cannot display the image to be processed normally. The image to be processed is subsequently adjusted by the image processing method protected by this application, and the dynamic range of the image is reduced, so that the adjusted target image can be displayed normally on the display screen of the mobile phone or the display effect is better. The image processing method protected by this application is mainly used in the field of image processing, and can make the display effect of the processed image on the display screen of the electronic device better, that is, the image processed by the image processing method protected by this application has a better display effect on the display screen of the same electronic device than the image before being processed by the image processing method protected by this application.

[0033] Step S102, obtaining an initial adjustment ratio corresponding to the image to be processed, wherein the initial adjustment ratio is determined by original brightness data of each pixel in the image to be processed and a target filtering algorithm.

[0034] In this embodiment, the initial adjustment ratio is determined by the original brightness data of each pixel in the image to be processed and the target filtering algorithm. The initial adjustment ratio does not take into account the differences in brightness and saturation between the pixels. If the initial adjustment ratio is directly used to adjust the image to be processed, the area corresponding to the target pixel in the adjusted image will be overexposed, wherein the target pixel corresponds to a pixel in the image to be processed whose brightness is higher than a specified brightness or whose saturation is higher than a specified saturation.

[0035] In some embodiments of the present application, the process of determining the initial adjustment ratio includes: determining the original brightness data of each pixel in the image to be processed, filtering the original brightness data based on a target filtering algorithm to obtain filtered brightness data; and determining the initial adjustment ratio based on the original brightness data and the filtered brightness data.

[0036] In this embodiment, the original brightness data of each pixel point can be determined by weighted summing and taking logarithms of the pixel values ​​of each pixel point in the R, G, and B channels. The target filtering algorithm can be a bilateral filtering algorithm, and the original brightness data is filtered based on the target filtering algorithm to obtain filtered brightness data, and then the initial adjustment ratio is determined according to the original brightness data and the filtered brightness data.

[0037] In some embodiments of the present application, an initial adjustment ratio is determined based on the original brightness data and the filtered brightness data, including: determining a first difference between the original brightness data and the filtered brightness data, where the first difference is the brightness detail that you want to retain; compressing the filtered brightness data according to a target compression coefficient to obtain compressed brightness data, the filtered brightness data is the main reason for the large dynamic range, and by compressing the filtered brightness data, the dynamic range of the image can be reduced without affecting the human eye's perception of the image; adding the compressed brightness data, the first difference, and the target exposure compensation coefficient to determine the target brightness data; determining the initial adjustment ratio based on the target brightness data and the original brightness data.

[0038] In some embodiments of the present application, the initial adjustment ratio is determined by Formula 1, which is specifically:

[0039] scale=pow(2,(final_log_lum-l) / 16.0);

[0040] Among them, scale is the initial adjustment ratio, pow(x,y) represents x to the power of y, final_log_lum is the target brightness data, and l is the original brightness data.

[0041] In some embodiments of the present application, final_log_lum=alpha*bilateral+detail+beta, wherein alpha is the target compression coefficient, bilateral is the filtered brightness data, detail is the first difference, and beta is the target exposure compensation coefficient. In some embodiments, alpha=0.5, beta=125.

[0042] In addition, since there are differences in brightness between pixels, and the initial adjustment ratio determined by the original brightness data and the target filtering algorithm does not take into account the differences in brightness between pixels, directly performing tone mapping on the image to be processed based on the initial adjustment ratio may cause over-brightening of areas with higher brightness, resulting in overexposure. Therefore, it is necessary to subsequently determine the target adjustment ratio based on the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed.

[0043] Step S103, determining a target adjustment ratio according to the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed.

[0044] In this embodiment, a target brightness adjustment coefficient is set in advance to determine the saturation of each pixel in the image to be processed. The target adjustment ratio is determined based on the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed so that the target adjustment ratio matches the brightness and saturation of each pixel.

[0045] Step S104 , adjusting the pixel value of each pixel in the to-be-processed image according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image.

[0046] In this embodiment, tone mapping is performed on the pixel value of each pixel in the to-be-processed image according to the target adjustment ratio and the target brightness adjustment coefficient to reduce the dynamic range of the to-be-processed image and generate a target image.

[0047] In some embodiments of the present application, the image processing method can be implemented based on the Android system in the electronic device. The HWUI of the Android system obtains the image to be processed from apps such as the camera and the photo album, and sends the image to be processed to the Tone mapping shader, and the Tone mapping shader performs the methods such as S101 to S104 protected by the present application on the image to be processed. The Tone mapping shader returns the target image to the HWUI, and the HWUI sends the target image to the SurfaceFlinger of the Android system, and finally the target image is displayed in the display area on the display screen through SurfaceFlinger.

[0048] Optionally, the image processing method of the embodiment of the present application can also be applied to other system platforms, such as Apple system, Windows system, Linux system, etc. Technical personnel in this field can flexibly set it according to needs, and this application is not limited here.

[0049] The image processing method of the embodiment of the present application obtains an image to be processed; obtains an initial adjustment ratio corresponding to the image to be processed, the initial adjustment ratio being determined by the original brightness data of each pixel in the image to be processed and the target filtering algorithm; determines the target adjustment ratio according to the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed; adjusts the pixel value of each pixel in the image to be processed according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image. Since the brightness and saturation of each pixel are taken into account in the process of determining the target adjustment ratio, the pixel is adjusted according to the brightness and saturation of the pixel, thereby achieving a more precise adjustment of the image and improving the display effect of the image.

[0050] In some embodiments of the present application, the pixel value of each pixel in the image to be processed is adjusted according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image, such as Figure 2 As shown, the following steps are included:

[0051] Step S1041, obtaining ambient light parameters, and determining an ambient brightness coefficient according to the ambient light parameters.

[0052] In this embodiment, ambient light may affect the display effect of an image, and ambient light parameters may be obtained through a light sensor or from other devices having a light sensor, and the ambient brightness coefficient may be determined based on the ambient light parameters.

[0053] Step S1042, determining a target color parameter according to the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient.

[0054] In this embodiment, after the ambient brightness coefficient is obtained, the target color parameter corresponding to each pixel in the image to be processed is determined according to the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient.

[0055] Step S1043, adjusting the pixel value of each pixel in the image to be processed according to the target color parameter to generate the target image.

[0056] In this embodiment, tone mapping is performed on the pixel value of each pixel point in the image to be processed according to the target color parameter to reduce the dynamic range of the image to be processed and generate a target image.

[0057] Since the ambient light parameters are taken into account in the process of determining the target color parameters, the target image can maintain a good display effect under different ambient lights. When the electronic device is in different ambient lights, the target image is displayed in the display area on the electronic device display screen. For example, when the electronic device is in a high-brightness environment, the image brightness can be increased by the corresponding ambient brightness coefficient to improve the visibility of the target image; when the electronic device is in a low-brightness environment, the image brightness can be reduced by the corresponding ambient brightness coefficient, which can also ensure a clear display of the target image.

[0058] In some embodiments of the present application, the target color parameter is determined according to the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient, such as Figure 3 As shown, the following steps are included:

[0059] Step S10421, determining initial color parameters according to the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient.

[0060] In this embodiment, the pixel value of each pixel in the image to be processed is determined, and the initial color parameters are determined according to the pixel value of each pixel, the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient.

[0061] Step S10422: when the initial color parameter is less than a specified threshold parameter, determine the initial color parameter as the target color parameter.

[0062] In this embodiment, the initial color parameter is compared with the specified threshold parameter, and if the initial color parameter is less than the specified threshold parameter, the initial color parameter is determined as the target color parameter.

[0063] Step S10423: When the initial color parameter is not less than the specified threshold parameter, the specified threshold parameter is determined as the target color parameter.

[0064] In this embodiment, if the initial color parameter is not less than the specified threshold parameter, the specified threshold parameter is determined as the target color parameter.

[0065] By determining the initial color parameters and comparing the initial color parameters with the specified threshold parameters to determine the specified threshold parameters, the target color parameters can be limited within the specified range, avoiding parameter over-adjustment, thereby ensuring that the target image has a good display effect.

[0066] In some embodiments of the present application, determining the initial color parameter according to the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient includes:

[0067] Determine a first value range according to the ambient brightness coefficient;

[0068] Determine a first target value according to the target brightness adjustment coefficient and the first value range;

[0069] The initial color parameter is determined according to the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the first target value.

[0070] In the embodiment of the present application, the first value range is first determined according to the ambient brightness coefficient, and then the target brightness adjustment coefficient is compared with the first value range. If the target brightness adjustment coefficient is within the first value range, the target brightness adjustment coefficient is used as the first target value; if the target brightness adjustment coefficient is less than the minimum value of the first value range, the minimum value of the first value range is used as the first target value; if the target brightness adjustment coefficient is greater than the maximum value of the first value range, the maximum value of the first value range is used as the first target value. Then, the initial color parameters are determined according to the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the first target value.

[0071] The first target value is determined according to the target brightness adjustment coefficient and the first value range, and the target brightness adjustment coefficient can be limited to the first value range corresponding to the ambient brightness coefficient, thereby ensuring that the brightness adjustment coefficient conforms to the actual ambient brightness and further improving the accuracy of the initial color parameters.

[0072] In some embodiments of the present application, the initial color parameters are determined according to Formula 2, which is specifically:

[0073] color=half4(c.rgb*linear_scale*(0.5+ltmratio-clamp(lum_ratio,0,0.5-ltmratio))+c.rgb*(0.5-ltmratio+clamp(lum_ratio,0,0.5-ltmratio)),1.0);

[0074] Among them, color represents the initial color parameter, half4 represents the four-dimensional data, c.rgb represents the pixel values ​​of the pixel points in R, G, and B respectively, linear_scale represents the target adjustment ratio, ltmratio represents the ambient brightness coefficient, clamp(value,min,max) represents the value limited to the value between min and max, and lum_ratio represents the target brightness adjustment coefficient.

[0075] It can be seen that in Formula 2, the minimum value of the first value range is 0, the maximum value is 0.5-ltmratio, and clamp(lum_ratio,0,0.5-ltmratio) is the first target value. The value of ltmratio includes any one of 0.1, 0.2, 0.3, 0.4 and 0.5. As the ambient brightness value increases, the value of ltmratio also increases. Therefore, by (0.5+ltmratio-clamp(lum_ratio,0,0.5-ltmratio), the adjustment of c.rgb*linear_scale can be achieved. By (0.5-ltmratio+clamp(lum_ratio,0,0.5-ltmratio), the adjustment of c.rgb can be achieved. If ltmratio is 0.5, color=half4(c.rgb*linear_scale), the larger the ambient brightness value, the smaller the first target value, so that when the ambient brightness is high, the brightness of the pixel can be increased by a large margin, and when the ambient brightness is low, the brightness of the pixel can be increased by a small margin, so that the brightness of the pixel in the target image matches the ambient brightness, further improving the display effect of the image.

[0076] In some embodiments of the present application, the target color parameter=min(half4(1.0, 1.0, 1.0, 1.0), color), wherein half4(1.0, 1.0, 1.0, 1.0) represents a specified threshold parameter.

[0077] In some embodiments of the present application, the ambient light parameter includes an ambient brightness value, and the ambient brightness coefficient is determined according to the ambient light parameter, such as Figure 4 As shown, the following steps are included:

[0078] Step S10411, determining a target ambient brightness value range corresponding to the ambient brightness value from multiple ambient brightness value ranges.

[0079] In this embodiment, a plurality of ambient brightness value ranges are pre-set, and after the ambient brightness value is determined, the ambient brightness value range to which the ambient brightness value belongs is determined from among the ambient brightness value ranges, and is determined as the target ambient brightness value range.

[0080] Step S10412: determining a target ambient brightness reference value from a plurality of ambient brightness reference values ​​according to the target ambient brightness value range, each of the ambient brightness reference values ​​corresponding to one of the ambient brightness value ranges.

[0081] In this embodiment, each ambient brightness value range corresponds to an ambient brightness reference value, and an ambient brightness reference value corresponding to the target ambient brightness value range is determined from the multiple ambient brightness reference values ​​and determined as the target ambient brightness reference value.

[0082] Step S10413, determining the ambient brightness coefficient according to the target ambient brightness reference value.

[0083] In this embodiment, the target environment brightness reference value may be used as the environment brightness coefficient, or the target environment brightness reference value may be multiplied by a specified coefficient to determine the environment brightness coefficient.

[0084] By setting multiple ambient brightness reference values, the ambient brightness coefficient can be determined efficiently and accurately.

[0085] In some embodiments of the present application, the value of the ambient brightness coefficient includes any one of 0.1, 0.2, 0.3, 0.4 and 0.5, and the ambient brightness coefficient corresponding to the high ambient brightness value is higher than the ambient brightness coefficient corresponding to the low ambient brightness value.

[0086] In some embodiments of the present application, the ambient brightness coefficient ltmratio=0.1*in_ratio, where in_ratio is an ambient brightness reference value, and the ambient brightness reference value includes any one of 1, 2, 3, 4, and 5. Optionally, as an alternative, ltmratio=in_ratio, where in_ratio is an ambient brightness reference value, and the ambient brightness reference value includes any one of 0.1, 0.2, 0.3, 0.4, and 0.5.

[0087] In some embodiments of the present application, the target adjustment ratio is determined according to the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed, such as Figure 5 As shown, the following steps are included:

[0088] Step S1031 , determining an initial scale adjustment parameter according to the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed.

[0089] In this embodiment, the saturation of each pixel may include the saturation of the pixel in the R, G, and B channels respectively, and the initial ratio adjustment parameter is determined according to the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed.

[0090] Step S1032: determining a second value range according to the initial adjustment ratio.

[0091] The maximum value in the second value range is determined according to the initial adjustment ratio, and 0 is determined as the minimum value in the second value range, thereby determining the second value range.

[0092] Step S1033: determining a second target value according to the initial ratio adjustment parameter and the second value range.

[0093] In this embodiment, the initial ratio adjustment parameter is compared with the second value range. If the initial ratio adjustment parameter is within the second value range, the initial ratio adjustment parameter is used as the second target value; if the initial ratio adjustment parameter is less than the minimum value of the second value range, the minimum value of the second value range is used as the second target value; if the initial ratio adjustment parameter is greater than the maximum value of the second value range, the maximum value of the second value range is used as the second target value.

[0094] Step S1034: adjusting the initial adjustment ratio according to the second target value to determine the target adjustment ratio.

[0095] The initial adjustment ratio is adjusted according to the second target value to determine the target adjustment ratio.

[0096] The second value range is determined by the initial adjustment ratio, and the second target value is determined according to the initial ratio adjustment parameter and the second value range, so as to limit the initial ratio adjustment parameter to the second value range corresponding to the initial adjustment ratio, thereby achieving a more reasonable adjustment of the initial adjustment ratio and improving the accuracy of the target adjustment ratio.

[0097] In some embodiments of the present application, the target adjustment ratio is determined by Formula 3, which is specifically:

[0098] linear_scale=scale-clamp(1.5*red*red*sat+g*g*sat+b*b*sat+0.05*lum_ratio*lum_ratio,0,scale-1.0);

[0099] Among them, linear_scale is the target adjustment ratio, scale is the initial adjustment ratio, sat represents saturation, red, g and b represent R, G and B channels respectively, and lum_ratio represents the target brightness adjustment coefficient. It can be seen from formula 3 that the minimum value of the second value range is 0, the maximum value is scale-1.0, the initial ratio adjustment parameter is 1.5*red*red*sat+g*g*sat+b*b*sat+0.05*lum_ratio*lum_ratio, and the second target value is clamp(1.5*red*red*sat+g*g*sat+b*b*sat+0.05*lum_ratio*lum_ratio,0,scale-1.0). In addition, since the human eye is more sensitive to changes in red, the accuracy of the initial ratio adjustment parameter can be improved by multiplying red*red*sat by 1.5. The value of scale is generally greater than 1. If scale=1, then linear_scale=scale. Formula 3 can ensure that linear_scale meets the saturation and target brightness adjustment coefficients and is within a reasonable range, thereby improving the accuracy of the target adjustment ratio.

[0100] In some embodiments of the present application, before determining the target adjustment ratio according to the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed, as follows: Figure 6 As shown, the following steps are also included:

[0101] Step S201, determining the brightness of each pixel in the image to be processed.

[0102] In this embodiment, the brightness of a pixel refers to the brightness of the pixel, and the brightness of the pixel can be determined by the maximum value of the pixel in the R, G, and B channels, or by calculating the average value of the maximum and minimum values ​​in the R, G, and B channels.

[0103] Step S202, determining the target brightness adjustment coefficient according to the brightness, the target brightness adjustment coefficient is positively correlated with the brightness when the brightness is lower than a first brightness threshold, and the target brightness adjustment coefficient is negatively correlated with the brightness when the brightness is higher than a second brightness threshold, and the first brightness threshold is less than the second brightness threshold.

[0104] In this embodiment, the target brightness adjustment coefficient is determined according to the brightness, so that the target brightness adjustment coefficient is positively correlated with the brightness when the brightness is lower than the first brightness threshold, and is negatively correlated with the brightness when the brightness is higher than the second brightness threshold, so that when the brightness of the pixel point is small, the brightness is increased by a large margin; when the brightness of the pixel point is large, the brightness is increased by a small margin, so as to adjust the brightness increase degree according to the brightness of different pixels, avoid the problem of overexposure of the image, and thus improve the display effect of the target image. For example, if the image to be processed includes an illuminated area and a shadow area, the brightness of the illuminated area is higher than the second brightness threshold, and the brightness of the shadow area is lower than the first brightness threshold, then a smaller target brightness adjustment coefficient can be used to increase the brightness of the illuminated area by a smaller margin, and a larger target brightness adjustment coefficient can be used to increase the brightness of the shadow area by a larger margin, so as to avoid overexposure of the illuminated area of ​​the image to be processed.

[0105] In some embodiments of the present application, the target brightness adjustment coefficient is determined according to Formula 4, which is specifically:

[0106] lum_ratio=step(1-luma,0.8)*(0.2-luma)+step(1-luma,0.9)*(0.1-luma);

[0107] Among them, lum_ratio is the target brightness adjustment coefficient, luma represents brightness, step(edge,x), edge represents the threshold, x represents the input value, and returns 0 when the input value is less than the threshold, otherwise returns 1. It can be seen that lum_ratio is positively correlated with luma when luma is lower than 0.2, and lum_ratio is negatively correlated with luma when luma is higher than 0.9, so that when the brightness of the pixel point is less than 0.2, the brightness is increased by a large margin; when the brightness of the pixel point is greater than 0.9, the brightness is increased by a small margin, and the brightness increase degree is adjusted according to the brightness of different pixels, avoiding the problem of overexposure of the image, thereby improving the display effect of the target image. For example, if the image to be processed includes a first area with a brightness higher than 0.9 and a second area with a brightness lower than 0.2, the target brightness adjustment coefficient corresponding to the first area can be reduced as the brightness increases, and the target brightness adjustment coefficient corresponding to the second area can be increased as the brightness increases, so that the first area is increased by a small margin, and the second area is increased by a large margin, avoiding overexposure of the first area.

[0108] The present application also provides an image processing device, such as Figure 7As shown, it includes: a first acquisition module, used to acquire an image to be processed; a second acquisition module, used to obtain an initial adjustment ratio corresponding to the image to be processed, wherein the initial adjustment ratio is determined by the original brightness data of each pixel in the image to be processed and a target filtering algorithm; a determination module, used to determine a target adjustment ratio according to the initial adjustment ratio, a target brightness adjustment coefficient and the saturation of each pixel in the image to be processed; and a generation module, used to adjust the pixel value of each pixel in the image to be processed according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image.

[0109] The image processing device of the embodiment of the present application takes into account the brightness and saturation of each pixel in the process of determining the target adjustment ratio, thereby adjusting the pixel according to the brightness and saturation of the pixel, thereby improving the display effect of the image.

[0110] In some embodiments of the present application, the image processing device further includes:

[0111] A display module is used to compare and display the target image and a comparison image, wherein the comparison image includes at least one of the image to be processed and an initial adjustment image, and the initial adjustment image is generated after adjusting the pixel value of each pixel point in the image to be processed according to the initial adjustment ratio.

[0112] In this embodiment, after determining the initial adjustment ratio, the pixel value of each pixel point in the image to be processed can be adjusted according to the initial adjustment ratio to generate an initial adjustment image. After the target image is generated, the target image and the comparison image are compared and displayed by the display module, and the comparison image includes at least one of the image to be processed and the initial adjustment image. The comparison display method may include displaying the target image and the comparison image in different areas, windows, and layers, so that the difference in display effect between the target image and the comparison image can be intuitively displayed, thereby improving the user experience.

[0113] In some implementations of the present application, the image processing device further includes:

[0114] The interaction module is used to adjust the target parameters corresponding to the adjustment instruction in the target image in response to the adjustment instruction for the target image.

[0115] In this embodiment, the user can input an adjustment instruction for the target image in the interactive module, and in response to the adjustment instruction, adjust the target parameters corresponding to the adjustment instruction in the target image, and the target parameters include, for example, brightness, contrast, size, saturation, hue, and color channels. One or more of the target parameters can be used to adjust the target image according to user needs, thereby improving the user experience. For example, the interactive module responds to the user's instruction to adjust the size of the target image, and adjusts the size of the target image so that the size of the target image reaches the target size corresponding to the size adjustment instruction; the interactive module responds to the user's instruction to adjust the contrast of the target image, and adjusts the contrast of the target image so that the contrast of the target image reaches the target contrast corresponding to the contrast adjustment instruction; the interactive module responds to the display effect adjustment instruction of the target image, and adjusts the contrast, saturation, hue and color channel of the target image, so that the display effect of the target image meets the target display effect corresponding to the display effect adjustment instruction (such as portrait effect, landscape effect, food effect, montage effect, retro effect, etc.). Specifically, the user's input can be one or more of gestures, keyboard and mouse operations, pressing operations, etc., and this application does not limit this.

[0116] In a specific application scenario, the generation module is specifically used to: obtain ambient light parameters, and determine the ambient brightness coefficient based on the ambient light parameters; determine the target color parameters based on the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient; adjust the pixel value of each pixel in the image to be processed according to the target color parameters to generate the target image.

[0117] In a specific application scenario, the generation module is also specifically used to: determine the initial color parameters according to the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient; when the initial color parameters are less than the specified threshold parameters, determine the initial color parameters as the target color parameters; when the initial color parameters are not less than the specified threshold parameters, determine the specified threshold parameters as the target color parameters.

[0118] In a specific application scenario, the generation module is also specifically used to: determine a first value range based on the ambient brightness coefficient; determine a first target value based on the target brightness adjustment coefficient and the first value range; determine the initial color parameter based on the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the first target value.

[0119] In a specific application scenario, the ambient light parameters include an ambient brightness value, and the generation module is also specifically used to: determine a target ambient brightness value range corresponding to the ambient brightness value from multiple ambient brightness value ranges; determine a target ambient brightness reference value from multiple ambient brightness reference values ​​according to the target ambient brightness value range, each ambient brightness reference value corresponds to one of the ambient brightness value ranges; determine the ambient brightness coefficient according to the target ambient brightness reference value.

[0120] In a specific application scenario, the determination module is specifically used to: determine an initial ratio adjustment parameter based on the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed; determine a second value range based on the initial adjustment ratio; determine a second target value based on the initial ratio adjustment parameter and the second value range; adjust the initial adjustment ratio according to the second target value to determine the target adjustment ratio.

[0121] In a specific application scenario, the determination module is also used to: determine the brightness of each pixel in the image to be processed; determine the target brightness adjustment coefficient based on the brightness, the target brightness adjustment coefficient is positively correlated with the brightness when the brightness is lower than a first brightness threshold, and the target brightness adjustment coefficient is negatively correlated with the brightness when the brightness is higher than a second brightness threshold, and the first brightness threshold is less than the second brightness threshold.

[0122] The electronic device in the embodiment of the present application may be a terminal, or may be other devices other than a terminal. For example, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and may also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present disclosure.

[0123] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.

[0124] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.

Claims

1. An image processing method, comprising: Obtaining an image to be processed; Obtaining an initial adjustment ratio corresponding to the image to be processed, wherein the initial adjustment ratio is determined by original brightness data of each pixel in the image to be processed and a target filtering algorithm; Determining a target adjustment ratio according to the initial adjustment ratio, the target brightness adjustment coefficient, and the saturation of each pixel in the image to be processed; The pixel value of each pixel in the image to be processed is adjusted according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image.

2. The image processing method according to claim 1, wherein the pixel value of each pixel in the image to be processed is adjusted according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image, comprising: Acquire ambient light parameters, and determine an ambient brightness coefficient according to the ambient light parameters; Determine a target color parameter according to the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient; The pixel value of each pixel in the image to be processed is adjusted according to the target color parameter to generate the target image.

3. The image processing method according to claim 2, wherein determining the target color parameter according to the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient comprises: Determine the initial color parameter according to the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient; In a case where the initial color parameter is less than a specified threshold parameter, determining the initial color parameter as the target color parameter; In a case where the initial color parameter is not less than the specified threshold parameter, the specified threshold parameter is determined as the target color parameter.

4. The image processing method according to claim 2, wherein the initial color parameters are determined according to the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the target brightness adjustment coefficient, comprising: Determine a first value range according to the ambient brightness coefficient; Determine a first target value according to the target brightness adjustment coefficient and the first value range; The initial color parameter is determined according to the pixel value of each pixel in the image to be processed, the ambient brightness coefficient, the target adjustment ratio and the first target value.

5. The image processing method according to claim 2, wherein the ambient light parameter comprises an ambient brightness value, and determining the ambient brightness coefficient according to the ambient light parameter comprises: Determine a target ambient brightness value range corresponding to the ambient brightness value from a plurality of ambient brightness value ranges; Determine a target ambient brightness reference value from a plurality of ambient brightness reference values ​​according to the target ambient brightness value range, each of the ambient brightness reference values ​​corresponding to one of the ambient brightness value ranges; The ambient brightness coefficient is determined according to the target ambient brightness reference value.

6. The image processing method according to claim 1, wherein the target adjustment ratio is determined according to the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed, comprising: Determining an initial scale adjustment parameter according to the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed; Determine a second value range according to the initial adjustment ratio; Determining a second target value according to the initial ratio adjustment parameter and the second value range; The initial adjustment ratio is adjusted according to the second target value to determine the target adjustment ratio.

7. The image processing method according to claim 1, before determining the target adjustment ratio according to the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed, further comprising: Determine the brightness of each pixel in the image to be processed; The target brightness adjustment coefficient is determined according to the brightness, the target brightness adjustment coefficient is positively correlated with the brightness when the brightness is lower than a first brightness threshold, and the target brightness adjustment coefficient is negatively correlated with the brightness when the brightness is higher than a second brightness threshold, and the first brightness threshold is less than the second brightness threshold.

8. An image processing device, comprising: A first acquisition module is used to acquire an image to be processed; A second obtaining module is used to obtain an initial adjustment ratio corresponding to the image to be processed, wherein the initial adjustment ratio is determined by original brightness data of each pixel in the image to be processed and a target filtering algorithm; A determination module, used to determine a target adjustment ratio according to the initial adjustment ratio, the target brightness adjustment coefficient and the saturation of each pixel in the image to be processed; A generating module is used to adjust the pixel value of each pixel point in the image to be processed according to the target adjustment ratio and the target brightness adjustment coefficient to generate a target image.

9. The image processing apparatus according to claim 8, further comprising: A display module is used to compare and display the target image and a comparison image, wherein the comparison image includes at least one of the image to be processed and an initial adjustment image, and the initial adjustment image is generated after adjusting the pixel value of each pixel point in the image to be processed according to the initial adjustment ratio.

10. The image processing apparatus according to claim 8, further comprising: The interaction module is used to adjust the target parameters corresponding to the adjustment instruction in the target image in response to the adjustment instruction for the target image.