CN109982012B - Image processing method and device, storage medium and terminal - Google Patents

Image processing method and device, storage medium and terminal Download PDF

Info

Publication number
CN109982012B
CN109982012B CN201711467019.7A CN201711467019A CN109982012B CN 109982012 B CN109982012 B CN 109982012B CN 201711467019 A CN201711467019 A CN 201711467019A CN 109982012 B CN109982012 B CN 109982012B
Authority
CN
China
Prior art keywords
value
brightness
pixel
image
adjusting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711467019.7A
Other languages
Chinese (zh)
Other versions
CN109982012A (en
Inventor
吴冠林
韦虎
张夙
沈珈立
林福辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN201711467019.7A priority Critical patent/CN109982012B/en
Publication of CN109982012A publication Critical patent/CN109982012A/en
Application granted granted Critical
Publication of CN109982012B publication Critical patent/CN109982012B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/60Noise processing, e.g. detecting, correcting, reducing or removing noise
    • H04N25/63Noise processing, e.g. detecting, correcting, reducing or removing noise applied to dark current

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

An image processing method and device, a storage medium and a terminal are provided, and the image processing method comprises the following steps: collecting the intensity of ambient light; acquiring an image to be processed, and extracting an initial brightness value of each pixel in the image to be processed; analyzing the image to be processed according to the initial brightness value of each pixel to obtain an analysis result, wherein the analysis result comprises the brightness classification of the image to be processed; determining an adjustment parameter for an initial brightness value of each pixel according to the ambient light intensity and the analysis result; and adjusting the initial brightness value of each pixel at least by using the adjusting parameter. The technical scheme of the invention can improve the effect of enhancing the image brightness.

Description

Image processing method and device, storage medium and terminal
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method and apparatus, a storage medium, and a terminal.
Background
In order to present a high quality image, the image is typically processed in brightness.
In the prior art, an original image is processed by a low-pass filter and then is computed with the original image to divide the original image into a brightness layer and a contrast layer. In the adjustment of the brightness, the conversion equation can be used to perform more brightness enhancement at the place with low average brightness. In contrast enhancement, contrast enhancement is performed according to the brightness enhancement ratio. And finally, obtaining the final brightness output according to the processed brightness and the contrast value.
However, in the prior art, the conversion equation used for brightness adjustment does not consider the intensity of the current ambient light, and cannot make different responses to different ambient lights. Similarly, the contrast adjustment cannot be adjusted according to the intensity of the ambient light. Furthermore, the prior art divides the conversion equation into three different conversion equations depending on the average intensity of the pixel to be processed, on the conversion equation for the luminance adjustment. The pixel values processed by the three equations are not continuous, and the image has conversion distortion. For example, at the intersection between pixels with average intensities 79 and 80, the magnitude of the luminance enhancement is significantly different due to the different transformation equations used, resulting in distortion phenomena that are easily perceived in the image. Similarly, since the contrast is also adjusted according to the brightness enhancement amplitude, the contrast enhancement is also indirectly affected, and distortion in the contrast enhancement is caused. In contrast adjustment, the equation also uses division operation, which results in increased complexity of hardware design.
Disclosure of Invention
The technical problem solved by the invention is how to improve the effect of enhancing the image brightness.
In order to solve the foregoing technical problem, an embodiment of the present invention provides an image processing method, where the image processing method includes: collecting the intensity of ambient light; acquiring an image to be processed, and extracting an initial brightness value of each pixel in the image to be processed; analyzing the image to be processed according to the initial brightness value of each pixel to obtain an analysis result, wherein the analysis result comprises the brightness classification of the image to be processed; determining an adjustment parameter for an initial brightness value of each pixel according to the ambient light intensity and the analysis result; and adjusting the initial brightness value of each pixel at least by using the adjusting parameter.
Optionally, the adjusting the initial brightness value of each pixel at least by using the adjustment parameter includes: and adding a brightness increase value to the initial brightness value of each pixel according to the adjusting parameter, wherein the brightness increase value is positively correlated with the value of the adjusting parameter, and the higher the ambient light intensity is, the larger the value of the adjusting parameter is, the higher the brightness indicated by the brightness classification in the analysis result is, and the smaller the value of the adjusting parameter is.
Optionally, the determining, according to the ambient light intensity and the analysis result, an adjustment parameter for an initial brightness value of each pixel includes: and for the value ranges of the initial brightness values, respectively determining a plurality of sub-adjustment parameters according to the ambient light intensity and the analysis result, wherein the adjustment parameters are a set of the sub-adjustment parameters.
Optionally, the adjusting the initial brightness value of each pixel at least by using the adjustment parameter includes: and adding a brightness increase value to the initial brightness value of each pixel according to the adjustment parameter, wherein the brightness increase value is positively correlated with the value of the sub-adjustment parameter, and the larger the initial brightness value in the value range is, the smaller the value of the sub-adjustment parameter is.
Optionally, the analyzing the image to be processed according to the initial brightness value of each pixel includes: dividing the initial brightness value with the value smaller than a first set threshold into a plurality of continuous sections; calculating the ratio of the total number of pixels in each section to the total number of pixels of the image to be processed; comparing the ratio with a second set threshold, and determining whether the brightness is dark or bright according to the comparison result; or comparing the ratio with a plurality of set value ranges, and determining the brightness classification according to the set value range in which the ratio falls.
Optionally, analyzing the image to be processed according to the initial brightness value of each pixel further includes: and taking the ratio of the total number of pixels in the set section to the total number of pixels of the image to be processed as a dark pixel proportion, and adding the analysis result, wherein the maximum value of the initial brightness value in the set section is smaller than the first set threshold value.
Optionally, the determining, according to the ambient light intensity and the analysis result, an adjustment parameter for an initial brightness value of each pixel includes: determining a first adjusting parameter according to the ambient light intensity and the brightness classification; determining a second adjusting parameter according to the dark pixel proportion; the adjusting the initial brightness value of each pixel by using at least the adjustment parameter includes: performing primary adjustment on the initial brightness value of each pixel by using the first adjustment parameter; and adjusting the initial brightness value of each pixel for the second time by using the second adjusting parameter.
Optionally, the adjusting the initial brightness value of each pixel at least by using the adjustment parameter includes: adjusting the initial brightness value of each pixel by using the adjusting parameters; calculating a first brightness value and a second brightness value of each adjusted pixel under different contrasts; and fusing the first brightness value and the second brightness value according to the brightness of the background image of the image to be processed to obtain a final brightness value of each pixel.
Optionally, before the adjusting the initial brightness value of each pixel at least by using the adjustment parameter, the method further includes: and if the ambient light intensity is greater than a third set threshold value, adjusting the backlight brightness of a display screen displaying the image to be processed according to the ambient light intensity, wherein the ambient light intensity is positively correlated with the backlight brightness.
In order to solve the above technical problem, an embodiment of the present invention further discloses an image processing apparatus, including: the ambient light intensity acquisition module is suitable for acquiring ambient light intensity; the brightness extraction module is suitable for acquiring an image to be processed and extracting an initial brightness value of each pixel in the image to be processed; the analysis module is suitable for analyzing the image to be processed according to the initial brightness value of each pixel to obtain an analysis result, and the analysis result comprises the brightness classification of the image to be processed; an adjustment parameter determination module adapted to determine an adjustment parameter for an initial luminance value of each pixel according to the ambient light intensity and the analysis result; and the adjusting module is suitable for adjusting the initial brightness value of each pixel at least by using the adjusting parameter.
Optionally, the adjusting module adds a brightness increase value to the initial brightness value of each pixel according to the adjusting parameter, where the brightness increase value is positively correlated with the value of the adjusting parameter, and the higher the ambient light intensity is, the larger the value of the adjusting parameter is, the higher the brightness indicated by the brightness classification in the analysis result is, and the smaller the value of the adjusting parameter is.
Optionally, the adjusting parameter determining module includes: and the sub-adjustment parameter determining unit is suitable for determining a plurality of sub-adjustment parameters according to the ambient light intensity and the analysis result for the value ranges of the plurality of initial brightness values, wherein the adjustment parameters are a set of the plurality of sub-adjustment parameters.
Optionally, the adjusting module adds a brightness increase value to the initial brightness value of each pixel according to the adjusting parameter, where the brightness increase value is positively correlated with the value of the sub-adjusting parameter, and the larger the initial brightness value in the value range is, the smaller the value of the sub-adjusting parameter is.
Optionally, the analysis module includes: the section dividing unit is suitable for dividing the initial brightness value with the value smaller than a first set threshold into a plurality of continuous sections; the ratio calculation unit is suitable for calculating the ratio of the total number of pixels in each section to the total number of pixels of the image to be processed; the comparison unit is suitable for comparing the ratio with a second set threshold value and determining that the brightness is classified as dark or bright according to the comparison result; and the brightness classification determining unit is suitable for comparing the ratio with a plurality of set value ranges and determining the brightness classification according to the set value range in which the ratio falls.
Optionally, the analysis module further includes: and the dark pixel ratio determining unit is suitable for taking the ratio of the total number of pixels in a set section to the total number of pixels of the image to be processed as the dark pixel ratio and adding the analysis result, wherein the maximum value of the initial brightness value in the set section is smaller than the first set threshold value.
Optionally, the adjusting parameter determining module includes: a first adjustment parameter determination unit adapted to determine a first adjustment parameter according to the ambient light intensity and the brightness classification; the second adjusting parameter determining unit is suitable for determining a second adjusting parameter according to the dark pixel proportion; the adjustment module includes: the primary adjustment unit is suitable for carrying out primary adjustment on the initial brightness value of each pixel by using the first adjustment parameter; and the secondary adjusting unit is suitable for performing secondary adjustment on the initial brightness value of each pixel by using the second adjusting parameter.
Optionally, the adjusting module includes: the adjusting unit is suitable for adjusting the initial brightness value of each pixel by using the adjusting parameter; the brightness value calculation unit is suitable for calculating a first brightness value and a second brightness value of each adjusted pixel under different contrasts; and the fusion unit is suitable for fusing the first brightness value and the second brightness value according to the brightness of the background image of the image to be processed so as to obtain the final brightness value of each pixel.
Optionally, the image processing apparatus further includes: and the backlight brightness adjusting module is suitable for adjusting the backlight brightness of the display screen displaying the image to be processed according to the ambient light intensity when the ambient light intensity is greater than a third set threshold value, wherein the ambient light intensity is positively correlated with the backlight brightness.
The embodiment of the invention also discloses a storage medium, wherein computer instructions are stored on the storage medium, and the steps of the image processing method are executed when the computer instructions are executed.
The embodiment of the invention also discloses a terminal which comprises a memory and a processor, wherein the memory is stored with a computer instruction capable of running on the processor, and the processor executes the steps of the image processing method when running the computer instruction.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
the technical scheme of the invention collects the ambient light intensity; acquiring an image to be processed, and extracting an initial brightness value of each pixel in the image to be processed; analyzing the image to be processed according to the initial brightness value of each pixel to obtain an analysis result, wherein the analysis result comprises the brightness classification of the image to be processed; determining an adjustment parameter for an initial brightness value of each pixel according to the ambient light intensity and the analysis result; and adjusting the initial brightness value of each pixel at least by using the adjusting parameter. According to the technical scheme, when the brightness of the image to be processed is adjusted, the brightness classification and the ambient light intensity are combined, so that the pixel brightness of the image to be processed is considered, and the ambient light is also considered to be adjusted, so that the image brightness enhancement effect is improved; and further, when the image to be processed is presented, the image presenting effect is improved.
Further, for the value ranges of the initial brightness values, determining a plurality of sub-adjustment parameters according to the ambient light intensity and the analysis result, wherein the adjustment parameters are a set of the sub-adjustment parameters. The adjusting the initial brightness value of each pixel by using at least the adjustment parameter includes: and adding a brightness increase value to the initial brightness value of each pixel according to the adjustment parameter, wherein the brightness increase value is positively correlated with the value of the sub-adjustment parameter, and the larger the initial brightness value in the value range is, the smaller the value of the sub-adjustment parameter is. According to the technical scheme, the initial brightness value of the image to be processed is divided into a plurality of value ranges, and the value ranges are processed respectively, so that the distortion phenomenon of the image can be avoided, and the balance of processing effects is ensured. In addition, the larger the initial brightness value in the value range is, the smaller the value of the sub-adjustment parameter is; that is, for the pixels with larger initial brightness values, the sub-adjustment parameters used for adjusting the pixels are smaller, so that the balance and smoothness of each pixel on the brightness level are further ensured.
Drawings
FIG. 1 is a flow chart of a method of image processing according to an embodiment of the invention;
FIG. 2 is a diagram illustrating an exemplary application scenario of the present invention;
FIG. 3 is a flowchart of one embodiment of step S103 shown in FIG. 1;
FIG. 4 is a flowchart of one embodiment of step S105 shown in FIG. 1;
FIG. 5 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of one embodiment of the analysis module 503 of FIG. 5;
fig. 7 is a schematic structural diagram of an embodiment of the adjusting module 505 shown in fig. 5.
Detailed Description
As described in the background art, the conversion equation used in the brightness adjustment in the prior art does not consider the intensity of the current ambient light, and cannot make different responses for different ambient lights. Similarly, the contrast adjustment cannot be adjusted according to the intensity of the ambient light. Furthermore, the prior art divides the conversion equation into three different conversion equations depending on the average intensity of the pixel to be processed, on the conversion equation for the luminance adjustment. The pixel values processed by the three equations are not continuous, and the image has conversion distortion. Similarly, since the contrast is also adjusted according to the brightness enhancement amplitude, the contrast enhancement is also indirectly affected, and distortion in the contrast enhancement is caused. In contrast adjustment, the equation also uses division operation, which results in increased complexity of hardware design.
According to the technical scheme, when the brightness of the image to be processed is adjusted, the brightness classification and the ambient light intensity are combined, so that the pixel brightness of the image to be processed is considered, and the ambient light is also considered to be adjusted, so that the image brightness enhancement effect is improved; and further, when the image to be processed is presented, the image presenting effect is improved.
Furthermore, the technical scheme of the invention can avoid the distortion phenomenon of the image and ensure the balance of the processing effect by dividing the initial brightness value of the image to be processed into a plurality of value ranges and respectively processing the value ranges. In addition, the larger the initial brightness value in the value range is, the smaller the value of the sub-adjustment parameter is; that is, for the pixels with larger initial brightness values, the sub-adjustment parameters used for adjusting the pixels are smaller, so that the balance and smoothness of each pixel on the brightness level are further ensured.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present invention.
The image processing method shown in fig. 1 may include the steps of:
step S101: collecting the intensity of ambient light;
step S102: acquiring an image to be processed, and extracting an initial brightness value of each pixel in the image to be processed;
step S103: analyzing the image to be processed according to the initial brightness value of each pixel to obtain an analysis result, wherein the analysis result comprises the brightness classification of the image to be processed;
step S104: determining an adjustment parameter for an initial brightness value of each pixel according to the ambient light intensity and the analysis result;
step S105: and adjusting the initial brightness value of each pixel at least by using the adjusting parameter.
In a specific implementation of step S101, ambient light intensity may be acquired with a sensor. The ambient light intensity refers to the light intensity of the environment in which the device presenting the image to be processed is located. The sensor may be any sensing device that can be implemented in the prior art, and the embodiment of the present invention is not limited thereto.
The image to be processed can be a single image or a frame image in a video. In the implementation of step S102, an initial luminance value, which may also be referred to as an original luminance value, of each pixel (pixel) in the image to be processed may be extracted. Specifically, if the image to be processed is a color space image, for example, a YUV image or a YCbCr image, the initial luminance values of the respective pixels can be directly extracted at the luminance level. If the image to be processed is an RGB image, the RGB image needs to be converted into a YUV image or a YCbCr image, and then the initial brightness value of each pixel is extracted at the brightness level.
In the specific implementation of step S103, based on the initial brightness values of the pixels in the image to be processed, the brightness classification of the image to be processed can be analyzed. The brightness classification may characterize the overall brightness of the image to be processed. For example, the brightness classification may include a dark bias and a light bias, and the brightness classification may further include a light, a medium, and a dark.
In the specific implementation of step S104, since the ambient light intensity may represent the light intensity of the environment where the device presenting the image to be processed is located, and the brightness classification in the analysis result may represent the overall brightness of the image to be processed, the adjustment parameter may be determined according to the ambient light intensity and the analysis result, and the adjustment parameter may be used to adjust the brightness of the image to be processed. Therefore, the brightness of the image to be processed and the ambient light intensity are considered in the adjustment parameters, and the effect of image brightness processing can be improved when the initial brightness value of each pixel is adjusted by using the adjustment parameters in step S105.
When the brightness of the image to be processed is adjusted, the brightness classification and the ambient light intensity are combined, so that the pixel brightness of the image to be processed is considered, and the ambient light is also considered to be adjusted, so that the brightness enhancement effect of the image is improved; and further, when the image to be processed is presented, the image presenting effect is improved.
Further, after the initial brightness value of each pixel in the image to be processed is adjusted, the processed brightness and the chromaticity of the image to be processed are combined and output. The combined image can also be converted into an RGB image for output.
In a preferred embodiment of the present invention, step S105 shown in fig. 1 may be preceded by the following steps: and if the ambient light intensity is greater than a third set threshold value, adjusting the backlight brightness of a display screen displaying the image to be processed according to the ambient light intensity, wherein the ambient light intensity is positively correlated with the backlight brightness.
In this embodiment, when the intensity of the ambient light is greater than the third set threshold, it indicates that the ambient light ratio is relatively strong, and in this case, the effect of adjusting the brightness of each pixel of the image to be processed is only insignificant. Therefore, the backlight brightness of the display screen displaying the image to be processed can be adjusted according to the ambient light intensity. In particular, the backlight source of the display screen may be adjusted by the ambient light intensity. The adjustment mode is that the stronger the ambient light is, the more the backlight source is turned on. Therefore, after the image to be processed is processed, the image quality more suitable for being watched by human eyes can be presented on the display screen under the current ambient light intensity.
It should be noted that the third set threshold may be preset according to an actual application scenario, and the embodiment of the present invention is not limited to this.
In one embodiment of the present invention, step S105 shown in fig. 1 may include the following steps: and adding a brightness increase value on the basis of the initial brightness value of each pixel according to the adjusting parameter. The brightness increase value is positively correlated with the value of the adjustment parameter, and the higher the ambient light intensity is, the larger the value of the adjustment parameter is, the higher the brightness indicated by the brightness classification in the analysis result is, and the smaller the value of the adjustment parameter is.
That is, the value of the adjustment parameter is positively correlated with the ambient light intensity, and the higher the ambient light intensity is, the more the initial brightness value of the pixel is increased, that is, the greater the brightness increase value is. The value of the adjustment parameter is inversely related to the brightness of the brightness classification indication, and the higher the brightness of the brightness classification indication is, the less the initial brightness value of the pixel is increased, i.e. the smaller the brightness increase value is.
In a preferred embodiment of the present invention, step S104 shown in fig. 1 may include the following steps: and for the value ranges of the initial brightness values, respectively determining a plurality of sub-adjustment parameters according to the ambient light intensity and the analysis result, wherein the adjustment parameters are a set of the sub-adjustment parameters.
In this embodiment, the sub-adjustment parameters may be respectively used to adjust the brightness of the pixel values within the value ranges of the initial brightness values. The initial brightness value of the image to be processed is divided into a plurality of value ranges, and the value ranges are processed respectively, so that the distortion phenomenon of the image can be avoided, and the balance of the processing effect is ensured.
Further, step S105 shown in fig. 1 may include the following steps: and adding a brightness increase value on the basis of the initial brightness value of each pixel according to the adjusting parameter. The brightness increase value is positively correlated with the value of the sub-adjustment parameter, and the larger the initial brightness value in the value range is, the smaller the value of the sub-adjustment parameter is.
In this embodiment, the larger the initial brightness value in the value range is, the smaller the value of the sub-adjustment parameter is; that is, for a pixel having a larger initial luminance value, the smaller the increase of the initial luminance value, the smaller the value of the sub-adjustment parameter used for adjusting the pixel.
In other words, in the adjusted image to be processed, the following effects can be achieved: the increased brightness in darker areas will be greater than the increased brightness in brighter areas. Thereby further ensuring the uniformity and smoothness of each pixel at the luminance level.
Fig. 2 shows a specific application scenario of the present invention. As shown in fig. 2, the abscissa represents the initial luminance value of each pixel in the image to be processed, and the ordinate represents the adjusted output luminance. For the value ranges (a, b), (b, c) and (c, d) of the plurality of initial luminance values, luminance adjustment is performed using the correspondence relationships shown by the curves L1, L2 and L3, respectively.
The slope of the curve corresponding to the range with the lower initial brightness value is generally larger than the slope of the curve corresponding to the range with the higher initial brightness value. Specifically, the slope of the curve L1 is greater than the slope of the curve L2, and the slope of the curve L2 is greater than the slope of the curve L3.
More specifically, let the initial luminance value corresponding to the pixel position (x, y) be P ' (x, y), the relationship between the output luminance P ″ (x, y) corresponding to the pixel position (x, y) and the initial luminance value P ' (x, y) may be P ' (x, y)
Figure BDA0001529609290000091
Wherein S is1、S2And S3The slopes of the curves L1, L2, L3, respectively, and the slope S1 may be determined according to the ambient light intensity and brightness classification, S2=S1+ k1, k1 set values, a, b and c set initial pixel values, d1, d2 and d3 can be calculated.
Since the pixel point a (a,0) is located on the curve L1 and S1 is known, d1 can be obtained through calculation; further, the expression of the curve L1 is obtainedThen the output brightness of pixel B can be calculated. According to the pixel point B and the slope S2D2 can be obtained by calculation, and an expression of the curve L2 can be obtained. The output brightness of the pixel point C can be calculated by using the expression of the curve L2, and D3 can be obtained by using the pixel point C and the pixel point D (255 ), so that the expression of the curve L3 is obtained.
It should be noted that, in practical application, a greater number of curves can be configured according to different requirements; the expression of the curve may refer to the above process, and the embodiment of the present invention is not limited thereto.
In another preferred embodiment of the present invention, as shown in fig. 3, step S103 shown in fig. 1 may include step S301, step S302 and step S303, or step S301, step S302 and step S304.
Step S301: dividing the initial brightness value with the value smaller than a first set threshold into a plurality of continuous sections;
step S302: calculating the ratio of the total number of pixels in each section to the total number of pixels of the image to be processed;
step S303: and comparing the ratio with a second set threshold value, and determining whether the brightness is dark or bright according to the comparison result.
In this embodiment, the first set threshold may be a small value, such as 69, 49, etc. For example, if the first set threshold is 69, the number of pixels whose initial brightness values are in the ranges of (0,24), (0,39), (0,49) and (0,69) may be counted; and calculating the ratio of the total number of pixels in each section to the total number of pixels of the image to be processed. The number of pixels whose initial brightness values are in the ranges of (0,24), (24,39), (39,49) and (49,69) can also be counted; and calculating the ratio of the total number of pixels in each section to the total number of pixels of the image to be processed.
In a specific implementation of step S303, a plurality of ratios may be used to determine the brightness classification. The ratio may be a proportion of pixels having initial luminance values smaller than a first set threshold to the total number of pixels of the image to be processed.
For example, if the cumulative luminance information pixel number ratio from 0 to 69 is smaller than the second set threshold, it indicates that the image to be processed is a brighter image, and the luminance classification may be a brighter image; otherwise, the brightness is classified as dark.
Step S304: and comparing the ratio with a plurality of set value ranges, and determining the brightness classification according to the set value range in which the ratio falls.
In this embodiment, in order to improve the accuracy of classifying the brightness of the image, the ratio may be compared with a plurality of set value ranges. Each value unit corresponds to one brightness classification, and the brightness classification corresponding to the value range in which the ratio falls can be used as the brightness classification of the image to be processed. For example, the value ranges are respectively classified into bright, medium and dark according to brightness.
In a specific application, a histogram (histogram) method may be used to determine the brightness classification of the image to be processed.
The following steps may also be included after step S303 or step S304 shown in fig. 3: and taking the ratio of the total number of pixels in the set section to the total number of pixels of the image to be processed as a dark pixel proportion, and adding the analysis result. The maximum value of the initial brightness value in the set section is smaller than the first set threshold.
For example, when the first set threshold is 69, the set segment may be (0, 24). The proportion of the number of pixels with the initial brightness value in the range of (0,24) to the total number of pixels of the whole image, that is, the dark pixel proportion, can indicate how much the area with lower brightness in the image to be processed occupies.
It can be understood that the setting section may be adaptively configured according to an actual application scenario, and the embodiment of the present invention is not limited thereto.
In still another preferred embodiment of the present invention, the step S104 may include the steps of: determining a first adjusting parameter according to the ambient light intensity and the brightness classification; and determining a second adjusting parameter according to the dark pixel proportion.
Further, step S105 may include the steps of: performing primary adjustment on the initial brightness value of each pixel by using the first adjustment parameter; and adjusting the initial brightness value of each pixel for the second time by using the second adjusting parameter.
In this embodiment, a two-time global tone adjustment mechanism is adopted. The first global brightness adjustment is to give a first adjustment parameter to perform global brightness adjustment according to the current ambient light intensity and brightness classification, and the second global brightness adjustment is to give a second adjustment parameter to perform global brightness adjustment for the second time according to the dark pixel proportion. When the dark pixel proportion of the image to be processed is larger than the set value, the second adjustment can be carried out, so that a larger brightness enhancement effect can be achieved, and the image processing effect is further improved.
As shown in fig. 4, step S105 shown in fig. 1 may further include the following steps:
step S401: adjusting the initial brightness value of each pixel by using the adjusting parameters;
step S402: calculating a first brightness value and a second brightness value of each adjusted pixel under different contrasts;
step S403: and fusing the first brightness value and the second brightness value according to the brightness of the background image of the image to be processed to obtain a final brightness value of each pixel.
The specific implementation of step S401 can refer to the foregoing embodiments, and is not described herein again.
In the specific implementation of step S402, for each adjusted pixel in the image to be processed, a first luminance value and a second luminance value with different contrast ratios can be calculated. More specifically, a first luminance value and a second luminance value having a higher contrast and a lower contrast can be calculated.
In the implementation of step S403, the first luminance value and the second luminance value are fused (composition) to obtain a final luminance value output. The fusion mode of the first brightness value and the second brightness value is determined according to the brightness of the background image of the pixel. Specifically, the brightness of the background image (background image) is obtained by passing the image to be processed through a low-pass filter.
The finally output luminance value Lout can be expressed by the following formula: lout ═ w1×Phigh+(1-w1)×Plow(ii) a Wherein, PhighTo have a first luminance value of higher contrast, PlowTo have a second luminance value of lower contrast, w1Is a weight value determined according to the brightness of the background image.
Specifically, the higher the brightness of the background image, the higher the weight value w1The larger.
In a specific application, the steps S402 and S403 may be performed by using a Contrast-limited adaptive histogram equalization (CLAHE) algorithm.
As shown in fig. 5, the image processing apparatus 50 may include an ambient light intensity acquisition module 501, a brightness extraction module 502, an analysis module 503, an adjustment parameter determination module 504, and an adjustment module 505.
The ambient light intensity acquisition module 501 is adapted to acquire ambient light intensity;
the brightness extraction module 502 is adapted to obtain an image to be processed and extract an initial brightness value of each pixel in the image to be processed;
the analysis module 503 is adapted to analyze the to-be-processed image according to the initial brightness value of each pixel to obtain an analysis result, where the analysis result includes a brightness classification of the to-be-processed image;
the adjustment parameter determination module 504 is adapted to determine an adjustment parameter for an initial luminance value of each pixel from the ambient light intensity and the analysis result;
the adjusting module 505 is adapted to adjust the initial brightness value of each pixel at least by using the adjusting parameter.
When the brightness of the image to be processed is adjusted, the brightness classification and the ambient light intensity are combined, so that the pixel brightness of the image to be processed is considered, and the ambient light is also considered to be adjusted, so that the brightness enhancement effect of the image is improved; and further, when the image to be processed is presented, the image presenting effect is improved.
In an embodiment of the present invention, the adjusting module 505 adds a brightness increase value to the initial brightness value of each pixel according to the adjusting parameter, where the brightness increase value is positively correlated to the value of the adjusting parameter, and the higher the ambient light intensity is, the larger the value of the adjusting parameter is, the higher the brightness indicated by the brightness classification in the analysis result is, the smaller the value of the adjusting parameter is.
In a preferred embodiment of the present invention, the adjustment parameter determining module 504 may include a sub-adjustment parameter determining unit, where the sub-adjustment parameter determining unit is adapted to determine, for the value ranges of the multiple initial luminance values, multiple sub-adjustment parameters according to the ambient light intensity and the analysis result, where the adjustment parameter is a set of the multiple sub-adjustment parameters.
Further, the adjusting module 505 adds a brightness increase value to the initial brightness value of each pixel according to the adjusting parameter, wherein the brightness increase value is positively correlated to the value of the sub-adjusting parameter, and the larger the initial brightness value in the value range is, the smaller the value of the sub-adjusting parameter is.
As shown in fig. 6, the analyzing module 503 may include a segment dividing unit 5031 adapted to divide the initial brightness value whose value is smaller than a first set threshold into a plurality of continuous segments;
a ratio calculation unit 5032 adapted to calculate a ratio of the total number of pixels in each segment to the total number of pixels of the image to be processed;
a comparing unit 5033 adapted to compare the ratio with a second set threshold and determine that the brightness is classified as dark or bright according to the comparison result;
a brightness classification determining unit 5034, adapted to compare the ratio with a plurality of set value ranges, and determine the brightness classification according to the set value range in which the ratio falls.
The analysis module 503 may further include a dark pixel ratio determination unit 5035 adapted to use the ratio of the total number of pixels in a set segment to the total number of pixels of the image to be processed as a dark pixel ratio, and add the analysis result, wherein the maximum value of the initial brightness value in the set segment is smaller than the first set threshold.
In another preferred embodiment of the present invention, the adjustment parameter determining module 504 comprises a first adjustment parameter determining unit adapted to determine a first adjustment parameter based on the ambient light intensity and the brightness classification; and the second adjusting parameter determining unit is suitable for determining a second adjusting parameter according to the dark pixel proportion.
Furthermore, the adjusting module 505 may include a first adjusting unit adapted to perform a first adjustment on the initial brightness value of each pixel by using the first adjusting parameter; and the secondary adjusting unit is suitable for performing secondary adjustment on the initial brightness value of each pixel by using the second adjusting parameter.
In still another preferred embodiment of the present invention, as shown in fig. 7, the adjusting module 505 may include an adjusting unit 5051 adapted to adjust the initial brightness value of each pixel by using the adjusting parameter;
a luminance value calculation unit 5052 adapted to calculate a first luminance value and a second luminance value of each adjusted pixel at different contrasts;
the fusing unit 5053 is adapted to fuse the first luminance value and the second luminance value according to the luminance of the background image of the to-be-processed image to obtain a final luminance value of each pixel.
In still another preferred embodiment of the present invention, the image processing apparatus 50 shown in fig. 5 may further include a backlight brightness adjusting module, adapted to adjust the backlight brightness of the display screen displaying the image to be processed according to the ambient light intensity when the ambient light intensity is greater than a third set threshold, where the ambient light intensity is positively correlated to the backlight brightness.
For more details of the operation principle and the operation mode of the image processing apparatus 50, reference may be made to the description in fig. 1 to 4, which is not repeated here.
The embodiment of the invention also discloses a storage medium, wherein computer instructions are stored on the storage medium, and when the computer instructions are operated, the steps of the image processing method shown in the figure 1, the figure 3 or the figure 4 can be executed. The storage medium may include ROM, RAM, magnetic or optical disks, etc. The storage medium may further include a non-volatile memory (non-volatile) or a non-transitory memory (non-transient), and the like.
The embodiment of the invention also discloses a terminal which can comprise a memory and a processor, wherein the memory is stored with computer instructions capable of running on the processor. The processor, when executing the computer instructions, may perform the steps of the image processing method shown in fig. 1, 3 or 4. The terminal includes, but is not limited to, a mobile phone, a computer, a tablet computer and other terminal devices.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (18)

1. An image processing method, comprising:
collecting the intensity of ambient light;
acquiring an image to be processed, and extracting an initial brightness value of each pixel in the image to be processed;
analyzing the image to be processed according to the initial brightness value of each pixel to obtain an analysis result, wherein the analysis result comprises the brightness classification of the image to be processed;
determining an adjustment parameter for an initial brightness value of each pixel according to the ambient light intensity and the analysis result;
adjusting the initial brightness value of each pixel by using at least the adjusting parameter;
the analyzing the image to be processed according to the initial brightness value of each pixel comprises:
dividing the initial brightness value with the value smaller than a first set threshold into a plurality of continuous sections;
calculating the ratio of the total number of pixels in each section to the total number of pixels of the image to be processed;
comparing the ratio with a second set threshold, and determining whether the brightness is dark or bright according to the comparison result;
or comparing the ratio with a plurality of set value ranges, and determining the brightness classification according to the set value range in which the ratio falls.
2. The method according to claim 1, wherein said adjusting the initial luminance value of each pixel using at least the adjustment parameter comprises:
and adding a brightness increase value to the initial brightness value of each pixel according to the adjusting parameter, wherein the brightness increase value is positively correlated with the value of the adjusting parameter, and the higher the ambient light intensity is, the larger the value of the adjusting parameter is, the higher the brightness indicated by the brightness classification in the analysis result is, and the smaller the value of the adjusting parameter is.
3. The method according to claim 1, wherein the determining an adjustment parameter for an initial luminance value for each pixel according to the ambient light intensity and the analysis result comprises:
and for the value ranges of the initial brightness values, respectively determining a plurality of sub-adjustment parameters according to the ambient light intensity and the analysis result, wherein the adjustment parameters are a set of the sub-adjustment parameters.
4. The method according to claim 3, wherein said adjusting the initial luminance value of each pixel using at least the adjustment parameter comprises: and adding a brightness increase value to the initial brightness value of each pixel according to the adjustment parameter, wherein the brightness increase value is positively correlated with the value of the sub-adjustment parameter, and the larger the initial brightness value in the value range is, the smaller the value of the sub-adjustment parameter is.
5. The image processing method according to claim 1, wherein the analyzing the image to be processed according to the initial brightness value of each pixel further comprises:
and taking the ratio of the total number of pixels in the set section to the total number of pixels of the image to be processed as a dark pixel proportion, and adding the analysis result, wherein the maximum value of the initial brightness value in the set section is smaller than the first set threshold value.
6. The method according to claim 5, wherein the determining an adjustment parameter for an initial brightness value for each pixel according to the ambient light intensity and the analysis result comprises:
determining a first adjusting parameter according to the ambient light intensity and the brightness classification;
determining a second adjusting parameter according to the dark pixel proportion;
the adjusting the initial brightness value of each pixel by using at least the adjustment parameter includes:
performing primary adjustment on the initial brightness value of each pixel by using the first adjustment parameter;
and adjusting the initial brightness value of each pixel for the second time by using the second adjusting parameter.
7. The method according to claim 1, wherein said adjusting the initial luminance value of each pixel using at least the adjustment parameter comprises:
adjusting the initial brightness value of each pixel by using the adjusting parameters;
calculating a first brightness value and a second brightness value of each adjusted pixel under different contrasts;
and fusing the first brightness value and the second brightness value according to the brightness of the background image of the image to be processed to obtain a final brightness value of each pixel.
8. The method according to claim 1, wherein said adjusting the initial luminance value of each pixel using at least the adjustment parameter further comprises:
and if the ambient light intensity is greater than a third set threshold value, adjusting the backlight brightness of a display screen displaying the image to be processed according to the ambient light intensity, wherein the ambient light intensity is positively correlated with the backlight brightness.
9. An image processing apparatus characterized by comprising:
the ambient light intensity acquisition module is suitable for acquiring ambient light intensity;
the brightness extraction module is suitable for acquiring an image to be processed and extracting an initial brightness value of each pixel in the image to be processed;
the analysis module is suitable for analyzing the image to be processed according to the initial brightness value of each pixel to obtain an analysis result, and the analysis result comprises the brightness classification of the image to be processed;
an adjustment parameter determination module adapted to determine an adjustment parameter for an initial luminance value of each pixel according to the ambient light intensity and the analysis result;
the adjusting module is suitable for adjusting the initial brightness value of each pixel at least by using the adjusting parameter; the analysis module includes:
the section dividing unit is suitable for dividing the initial brightness value with the value smaller than a first set threshold into a plurality of continuous sections;
the ratio calculation unit is suitable for calculating the ratio of the total number of pixels in each section to the total number of pixels of the image to be processed;
the comparison unit is suitable for comparing the ratio with a second set threshold value and determining that the brightness is classified as dark or bright according to the comparison result;
and the brightness classification determining unit is suitable for comparing the ratio with a plurality of set value ranges and determining the brightness classification according to the set value range in which the ratio falls.
10. The apparatus according to claim 9, wherein the adjusting module adds a brightness increase value to the initial brightness value of each pixel according to the adjusting parameter, wherein the brightness increase value is positively correlated with the value of the adjusting parameter, and the higher the ambient light intensity is, the larger the value of the adjusting parameter is, the higher the brightness indicated by the brightness classification in the analysis result is, and the smaller the value of the adjusting parameter is.
11. The image processing apparatus according to claim 9, wherein the adjustment parameter determination module includes:
and the sub-adjustment parameter determining unit is suitable for determining a plurality of sub-adjustment parameters according to the ambient light intensity and the analysis result for the value ranges of the plurality of initial brightness values, wherein the adjustment parameters are a set of the plurality of sub-adjustment parameters.
12. The apparatus according to claim 11, wherein the adjusting module adds a brightness increase value to the initial brightness value of each pixel according to the adjusting parameter, wherein the brightness increase value is positively correlated to the value of the sub-adjusting parameter, and the larger the initial brightness value in the range of values is, the smaller the value of the sub-adjusting parameter is.
13. The image processing apparatus of claim 9, wherein the analysis module further comprises: and the dark pixel ratio determining unit is suitable for taking the ratio of the total number of pixels in a set section to the total number of pixels of the image to be processed as the dark pixel ratio and adding the analysis result, wherein the maximum value of the initial brightness value in the set section is smaller than the first set threshold value.
14. The image processing apparatus according to claim 13, wherein the adjustment parameter determination module includes:
a first adjustment parameter determination unit adapted to determine a first adjustment parameter according to the ambient light intensity and the brightness classification;
the second adjusting parameter determining unit is suitable for determining a second adjusting parameter according to the dark pixel proportion;
the adjustment module includes:
the primary adjustment unit is suitable for carrying out primary adjustment on the initial brightness value of each pixel by using the first adjustment parameter;
and the secondary adjusting unit is suitable for performing secondary adjustment on the initial brightness value of each pixel by using the second adjusting parameter.
15. The image processing apparatus according to claim 9, wherein the adjusting module includes: the adjusting unit is suitable for adjusting the initial brightness value of each pixel by using the adjusting parameter;
the brightness value calculation unit is suitable for calculating a first brightness value and a second brightness value of each adjusted pixel under different contrasts;
and the fusion unit is suitable for fusing the first brightness value and the second brightness value according to the brightness of the background image of the image to be processed so as to obtain the final brightness value of each pixel.
16. The image processing apparatus according to claim 9, further comprising:
and the backlight brightness adjusting module is suitable for adjusting the backlight brightness of the display screen displaying the image to be processed according to the ambient light intensity when the ambient light intensity is greater than a third set threshold value, wherein the ambient light intensity is positively correlated with the backlight brightness.
17. A storage medium having stored thereon computer instructions, wherein the computer instructions are operable to perform the steps of the image processing method of any one of claims 1 to 8.
18. A terminal comprising a memory and a processor, the memory having stored thereon computer instructions executable on the processor, wherein the processor, when executing the computer instructions, performs the steps of the image processing method according to any one of claims 1 to 8.
CN201711467019.7A 2017-12-28 2017-12-28 Image processing method and device, storage medium and terminal Active CN109982012B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711467019.7A CN109982012B (en) 2017-12-28 2017-12-28 Image processing method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711467019.7A CN109982012B (en) 2017-12-28 2017-12-28 Image processing method and device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN109982012A CN109982012A (en) 2019-07-05
CN109982012B true CN109982012B (en) 2021-06-25

Family

ID=67075414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711467019.7A Active CN109982012B (en) 2017-12-28 2017-12-28 Image processing method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN109982012B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268745A (en) * 2020-09-16 2022-04-01 北京小米移动软件有限公司 Brightness adjusting method, device, equipment and storage medium
CN112581394A (en) * 2020-12-16 2021-03-30 维沃移动通信有限公司 Image processing method, apparatus, device and medium
CN114119432A (en) * 2021-11-09 2022-03-01 深圳Tcl数字技术有限公司 Image processing method, image processing device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1873714A2 (en) * 2006-06-27 2008-01-02 Samsung Electronics Co., Ltd. Image processing apparatus and method of enhancing visibility of displayed image
CN101324722A (en) * 2007-06-13 2008-12-17 深圳Tcl新技术有限公司 Method for adjusting liquid crystal display device backlight lightness and contrast
CN102137178A (en) * 2011-04-07 2011-07-27 广东欧珀移动通信有限公司 Mobile phone backlight control method
CN104581345A (en) * 2014-12-29 2015-04-29 广东欧珀移动通信有限公司 Method and device for adjusting displayed frames
CN105592254A (en) * 2014-10-21 2016-05-18 宏碁股份有限公司 Image display method and electronic device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7164397B2 (en) * 2003-09-30 2007-01-16 Texas Instruments Incorporated Discrete light color processor
CN1856028A (en) * 2005-04-28 2006-11-01 明基电通股份有限公司 Camera and method for taking picture compensation
US8026908B2 (en) * 2007-02-05 2011-09-27 Dreamworks Animation Llc Illuminated surround and method for operating same for video and other displays
JP5053724B2 (en) * 2007-06-19 2012-10-17 オリンパスイメージング株式会社 Image display apparatus, imaging apparatus, image reproduction apparatus, and image display method
CN101231169B (en) * 2008-01-31 2010-06-09 北京控制工程研究所 Method for regulating self-determination integral time of ultraviolet moon sensor
CN101620819B (en) * 2009-06-25 2013-10-16 北京中星微电子有限公司 Dynamic regulation method and dynamic regulation device for displaying image back light brightness, and moving display device
CN103826066B (en) * 2014-02-26 2017-05-03 芯原微电子(上海)有限公司 Automatic exposure adjusting method and system
CN104869332B (en) * 2015-05-19 2017-09-29 北京空间机电研究所 A kind of adaptive multiple slope integration adjusting method
JP6574270B2 (en) * 2015-06-05 2019-09-11 アップル インコーポレイテッドApple Inc. Rendering and display of high dynamic range content

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1873714A2 (en) * 2006-06-27 2008-01-02 Samsung Electronics Co., Ltd. Image processing apparatus and method of enhancing visibility of displayed image
CN101324722A (en) * 2007-06-13 2008-12-17 深圳Tcl新技术有限公司 Method for adjusting liquid crystal display device backlight lightness and contrast
CN102137178A (en) * 2011-04-07 2011-07-27 广东欧珀移动通信有限公司 Mobile phone backlight control method
CN105592254A (en) * 2014-10-21 2016-05-18 宏碁股份有限公司 Image display method and electronic device
CN104581345A (en) * 2014-12-29 2015-04-29 广东欧珀移动通信有限公司 Method and device for adjusting displayed frames

Also Published As

Publication number Publication date
CN109982012A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
US10157451B2 (en) Image processing system and computer-readable recording medium
US10565742B1 (en) Image processing method and apparatus
US20150170389A1 (en) Automatic selection of optimum algorithms for high dynamic range image processing based on scene classification
US20160110846A1 (en) Automatic display image enhancement based on user's visual perception model
EP3379822B1 (en) Video enhancement method, terminal, and nonvolatile computer readable storage medium
CN106981054B (en) Image processing method and electronic equipment
CN109982012B (en) Image processing method and device, storage medium and terminal
CN104200431A (en) Processing method and processing device of image graying
CN111738966B (en) Image processing method and device, storage medium and terminal
CN109478316B (en) Real-time adaptive shadow and highlight enhancement
CN113240608A (en) Image denoising method and device, electronic equipment and readable storage medium
EP3363193B1 (en) Device and method for reducing the set of exposure times for high dynamic range video imaging
US11310440B2 (en) Image processing apparatus, surveillance camera system, and image processing method
JP2012028937A (en) Video signal correction apparatus and video signal correction program
Hussain et al. Max-RGB based colour constancy using the sub-blocks of the image
WO2023000868A1 (en) Image processing method and apparatus, device, and storage medium
CN112561906A (en) Image processing method, device, equipment and medium
Lee et al. A back lighting color image enhancement method using color saturation and image fusion
CN107545555B (en) Image processing method and device
US9135684B2 (en) Systems and methods for image enhancement by local tone curve mapping
CN118101854A (en) Image processing method, apparatus, electronic device, and computer-readable storage medium
CN117376716A (en) Fine-granularity scene-aware dynamic AE control method
Nakamura Assessing scene brightness and glare by an imaging system possibility of appearance-based lighting evaluation
MISUMI et al. Correction of Color Cast Images using Histogram Equalization of Local Area
Ghimire et al. Enhancement of Color Images with Blue Sky Using Different Method for Sky and Non-Sky Regions

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant