CN109729280B - Image processing method and mobile terminal - Google Patents

Image processing method and mobile terminal Download PDF

Info

Publication number
CN109729280B
CN109729280B CN201811627050.7A CN201811627050A CN109729280B CN 109729280 B CN109729280 B CN 109729280B CN 201811627050 A CN201811627050 A CN 201811627050A CN 109729280 B CN109729280 B CN 109729280B
Authority
CN
China
Prior art keywords
brightness
area
saturation
overexposure
pixel point
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
CN201811627050.7A
Other languages
Chinese (zh)
Other versions
CN109729280A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201811627050.7A priority Critical patent/CN109729280B/en
Publication of CN109729280A publication Critical patent/CN109729280A/en
Application granted granted Critical
Publication of CN109729280B publication Critical patent/CN109729280B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

The invention provides an image processing method and a mobile terminal, wherein the method comprises the following steps: determining an overexposure area in an image to be processed; carrying out color level correction on the image to be processed with the overexposure area; and respectively adjusting the brightness, the chromaticity and the saturation of the overexposed area according to the brightness, the chromaticity and the saturation of the overexposed area and the non-overexposed area, wherein the non-overexposed area is an area outside the overexposed area in the image to be processed. According to the invention, the brightness value of each pixel point is adjusted according to the relation between the brightness of the overexposure area and the brightness of the non-overexposure area, so that the adjusted image can keep the brightness difference between the original pixels and the brightness level cannot be weakened.

Description

Image processing method and mobile terminal
Technical Field
The invention relates to the technical field of mobile terminals, in particular to an image processing method and a mobile terminal.
Background
In the process of taking a picture, the light problem can cause the partial area of the picture to present the phenomenon that the brightness is too large, namely, the overexposed area, so that the picture effect is poor, and the user experience is poor.
In the prior art, due to the debugging limitation of the camera and the reason of the sensor, the brightness equalization scheme is generally adopted for processing the overexposed area. Specifically, firstly, determining an overexposure area and a standard brightness value; then, the brightness value of the overexposed area is adjusted to the standard brightness value.
It can be seen that, the above scheme directly adjusts the brightness value of the overexposure area to the standard brightness value, which results in that the brightness value difference of each pixel point in the overexposure area is small and the brightness level is weakened.
Disclosure of Invention
The embodiment of the invention provides an image processing method and a mobile terminal, and aims to solve the problem that the brightness level of a photo is weakened due to overexposure processing in the prior art.
On one hand, the embodiment of the invention discloses an image processing method which is applied to a mobile terminal and comprises the following steps:
determining an overexposure area in an image to be processed;
carrying out color level correction on the image to be processed with the overexposure area;
and respectively adjusting the brightness, the chromaticity and the saturation of the overexposed area according to the brightness, the chromaticity and the saturation of the overexposed area and the non-overexposed area, wherein the non-overexposed area is an area outside the overexposed area in the image to be processed.
On the other hand, the embodiment of the invention also discloses a mobile terminal, which comprises:
the overexposure area determining module is used for determining an overexposure area in the image to be processed;
the color level correction module is used for performing color level correction on the image to be processed with the overexposure area;
and the overexposure processing module is used for respectively adjusting the brightness, the chromaticity and the saturation of the overexposure area according to the brightness, the chromaticity and the saturation of the overexposure area and the non-overexposure area, wherein the non-overexposure area is an area outside the overexposure area in the image to be processed.
In still another aspect, an embodiment of the present invention further discloses a mobile terminal, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the image processing method according to any one of the above.
In a final aspect, the embodiment of the present invention further discloses a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the image processing method according to any one of the above.
In the embodiment of the invention, an overexposure area in an image to be processed is determined; carrying out color level correction on the image to be processed with the overexposure area; and respectively adjusting the brightness, the chromaticity and the saturation of the overexposed area according to the brightness, the chromaticity and the saturation of the overexposed area and the non-overexposed area, wherein the non-overexposed area is an area outside the overexposed area in the image to be processed. The functional relation can be established according to the brightness of the overexposure area and the brightness of the non-overexposure area so as to adjust the brightness value of each pixel point, the brightness difference between the original pixels can be kept, and the brightness level cannot be weakened.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a flow chart illustrating steps of an image processing method according to a first embodiment of the present invention;
FIG. 2(A, B) is a schematic diagram showing the tone scale correction before and after an embodiment of the present invention;
FIG. 3 is a flow chart illustrating steps of an image processing method according to a second embodiment of the present invention;
fig. 4 is a block diagram illustrating a mobile terminal according to a third embodiment of the present invention;
fig. 5 is a block diagram illustrating a mobile terminal according to a fourth embodiment of the present invention;
fig. 6 is a diagram illustrating a hardware structure of a mobile terminal implementing various embodiments of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following describes an image processing method and a mobile terminal according to the present invention in detail by taking several specific embodiments.
Referring to fig. 1, a flowchart illustrating steps of an image processing method according to a first embodiment of the present invention is shown, which may specifically include the following steps:
step 101, determining an overexposed area in an image to be processed.
The image to be processed may be an image in various formats, a photo taken through the current mobile terminal, or an image downloaded through a network or an application.
The overexposure area comprises a plurality of overexposed pixel points, and overexposure means that the brightness values of the pixel points are too high due to too large aperture or too slow shutter, and the photo is whitened.
Specifically, pixel points with brightness values higher than a certain threshold value in the image to be processed can be identified, and the area formed by the pixel points is an overexposure area.
And 102, carrying out color level correction on the image to be processed with the overexposure area.
In the embodiment of the invention, when an overexposure area exists in the image to be processed, the overexposure area needs to be processed, and color level correction is firstly carried out before processing, so that the image to be processed presents more uniform light and shade tone; when the overexposure area does not exist in the image to be processed or the determination of the overexposure area fails due to other reasons, the overexposure processing and the tone scale correction are not carried out on the image to be processed.
Specifically, the step of tone scale correction mainly includes: firstly, for pixel points with excessively small brightness values, the brightness values are improved; then, for the pixel point with the overlarge brightness value, the brightness value is properly reduced. As shown in fig. 2(a), the gradation of an image is schematically shown, the luminance value at the leftmost end is too small, the luminance value at the rightmost end is too large, and the overflow phenomenon has occurred; as shown in fig. 2(B), which is a schematic diagram of the color levels of the image after the color level correction, the luminance value at the leftmost end is appropriately increased, and the luminance value at the rightmost end is appropriately decreased, so that the overall color level of the image is in an appropriate range.
103, respectively adjusting the brightness, the chromaticity and the saturation of the overexposed area according to the brightness, the chromaticity and the saturation of the overexposed area and the non-overexposed area, wherein the non-overexposed area is an area outside the overexposed area in the image to be processed.
Wherein, the brightness is the brightness degree of the pixel point, and the value is 0 to 255.
The chroma is an expression of the degree of color, and takes a value of 0 to 255.
The saturation is the degree of color deviation from the same brightness gray, and is 0 to 255.
Specifically, a functional relationship between the luminance of an overexposed area and the luminance of a non-overexposed area is established for the luminance, so that the luminance in the overexposed area is converted by the functional relationship to obtain a proper chrominance value; aiming at the chromaticity, establishing a functional relation between the chromaticities of the overexposed area and the non-overexposed area, so that the chromaticity in the overexposed area is converted by the functional relation to obtain a proper chromaticity value; and aiming at the saturation, establishing a functional relation between the saturations of the overexposed area and the non-overexposed area, so that the proper saturation value is obtained after the saturation in the overexposed area is converted by the functional relation.
Optionally, in another embodiment of the present invention, the step 103 includes sub-steps 1031 to 1032:
and a substep 1031 of establishing a first functional relationship for luminance, a second functional relationship for chrominance and a third functional relationship for saturation, respectively.
It is understood that the first functional relationship is used to represent a functional relationship between the luminance of the overexposed area and the luminance of the non-overexposed area; the second functional relationship is used for embodying the functional relationship between the chromaticity of the overexposed area and the chromaticity of the non-overexposed area, and the third functional relationship is used for embodying the functional relationship between the saturation of the overexposed area and the saturation of the non-overexposed area.
Specifically, when the functional relationship is established, a suitable functional model, preferably a linear model, may be selected, for example, y ═ ax + b, where a coefficient may be determined according to a luminance ratio of an overexposed region and a non-overexposed region, b may be set according to a value and an actual application scenario of a, x is an input value of the functional relationship, in the embodiment of the present invention, it is the original luminance, the chromaticity, and the saturation, respectively, y is an output value of the functional relationship, and in the embodiment of the present invention, it is the luminance, the chromaticity, and the saturation after adjustment, respectively.
And a substep 1032 of adjusting the brightness, the chromaticity and the saturation of the overexposed region according to the first functional relationship, the second functional relationship and the third functional relationship, respectively.
Specifically, for each pixel point in the overexposure area, inputting the original brightness value of each pixel point into a first functional relation, and replacing the original brightness value with the adjusted brightness value as the obtained output; inputting the primary color value into a second function relation, obtaining an output which is an adjusted chromatic value, and replacing the primary color value; and inputting the original saturation value into the third function relation to obtain an adjusted saturation value, and replacing the original saturation value.
The embodiment of the invention can adjust the brightness, the chroma and the saturation according to the relation between the brightness, the chroma and the saturation of the overexposure area and the non-overexposure area, thereby ensuring that the brightness, the chroma and the saturation of the adjusted image are hierarchical.
In the embodiment of the invention, an overexposure area in an image to be processed is determined; carrying out color level correction on the image to be processed with the overexposure area; and respectively adjusting the brightness, the chromaticity and the saturation of the overexposure area according to the brightness, the chromaticity and the saturation of the overexposure area and the non-overexposure area, wherein the non-overexposure area is an area outside the overexposure area in the image to be processed, so that the brightness value of each pixel point can be adjusted according to the relation between the brightness of the overexposure area and the brightness of the non-overexposure area, the brightness difference between original pixels can be kept, and the brightness level cannot be weakened.
Referring to fig. 3, a flowchart illustrating steps of an image processing method according to a second embodiment of the present invention is shown, which may specifically include the following steps:
step 201, moving a preset bright and dark mask in an image to be processed, wherein the region covered by the mask is a candidate region.
The light and dark mask may be specified as a fixed size, and the light and dark mask is a generally rectangular area, and may be represented by the number of pixels contained in the length and the width, for example, 20 × 30, where 20 is the number of pixels contained in the length, and 30 is the number of pixels contained in the width.
Specifically, the light and shade mask may be moved in the image to be processed by a certain step size, and the overlap region may be included before and after each movement.
It can be understood that the size of the mask and the step size of the movement can be set according to the actual application scenario, which is not limited by the embodiment of the present invention.
Step 202, calculating an average value of the brightness of each pixel point in the candidate region to obtain a candidate brightness value.
Specifically, the calculation formula of the candidate luminance value LUC is as follows:
Figure BDA0001928199820000051
wherein, I and J are the number of pixels contained in the length and width of the mask (i.e. the candidate region), LUCi,jAnd the brightness of the ith row and the ith column of pixel points in the candidate area is obtained.
Step 203, determining the candidate area as an overexposure area when the candidate brightness value is greater than a preset third brightness threshold.
The third brightness threshold can be set according to an actual application scene, the third brightness threshold is used for judging the overexposure area, and if the third brightness threshold is too large, the overexposure area cannot be identified; if the third luminance threshold is too small, the identified overexposed region is too large, and there is a possibility that the non-overexposed region is identified as an overexposed region.
And 204, under the condition that the candidate brightness value is smaller than or equal to a preset third brightness threshold value, determining that the candidate area is not an overexposure area, and continuously moving the bright and dark mask.
In practical applications, no matter whether the candidate brightness value is greater than or less than or equal to the third brightness threshold, at this time, the bright-dark mask may be continuously moved, and when the candidate brightness value is greater than the third brightness threshold, other overexposed areas are searched until the bright-dark mask traverses the entire image.
The embodiment of the invention can adopt the light and shade mask to identify the overexposure area, and can adjust the identification accuracy by adjusting the size and the moving step length of the light and shade mask.
Step 205, establishing a color gradation adjustment function, and adjusting the brightness value of each pixel point in the image to be processed by using the color gradation adjustment function to obtain the adjusted brightness value of each pixel point; if the brightness value of the pixel point is smaller than a preset first brightness threshold value, the adjusted brightness value of the pixel point is larger than the brightness value of the pixel point; if the brightness value of the pixel point is greater than a preset second brightness threshold, the brightness value of the pixel point after adjustment is smaller than the brightness value of the pixel point, and the second brightness threshold is greater than the first brightness threshold.
The first brightness threshold is used for judging whether the brightness value is too small, and when the brightness value is too small, the brightness is improved, so that the phenomenon of too dark is avoided.
The second brightness threshold may be set according to an actual application scenario, which is not limited in the embodiment of the present invention, and is used to determine whether the brightness value is too large, and when the brightness value is too small, the brightness is reduced to avoid too bright.
In practical applications, the difference between the first luminance threshold and the second luminance threshold is usually large.
Specifically, as shown in fig. 2(a), the tone scale adjustment function may shift the overall tone scale of the image to the left, increase the dark portion, and decrease the bright portion, so as to obtain the tone scale map after being corrected as shown in fig. 2 (B).
It can be understood that the tone scale adjustment function may be set according to an actual application scenario on the premise of implementing the above conversion, and the specific formula of the tone scale correction function is not limited in the embodiment of the present invention.
According to the embodiment of the invention, the color level correction can be firstly carried out on the overexposed area, so that the phenomenon that the image is too dark or excessive is avoided.
And step 206, respectively calculating the average value of the brightness of the overexposed area and the brightness of the non-overexposed area to obtain a first brightness average value and a second brightness average value, wherein the non-overexposed area is an area outside the overexposed area in the image to be processed.
Specifically, the calculation formula of the first luminance mean value LU1 is as follows:
Figure BDA0001928199820000071
wherein, LU (PX 1)i,j) Is a pixel PX1 in the jth row and ith column in the overexposure area OEAi,jM is the number of pixel points of the overexposed region.
The second mean value LU2 is calculated as follows:
Figure BDA0001928199820000072
wherein, LU (PX 2)i,j) Is a pixel PX2 in the jth row and ith column in the non-overexposure area UOEAi,jAnd N is the number of pixel points in the non-overexposure area.
Step 207, a first functional relationship between the first luminance mean value and the second luminance mean value is established.
Specifically, the following first functional relationship may be established:
Figure BDA0001928199820000073
wherein, x1 is the original brightness value of each pixel point in the overexposure area which needs to be input, y1 is the output target brightness value, wherein b1 is a constant and can be adjusted according to the actual application scene.
And 208, respectively calculating the average value of the chroma of the overexposed area and the average value of the chroma of the non-overexposed area to obtain a first chroma average value and a second chroma average value.
Specifically, the calculation formula of the first chrominance mean CH1 is as follows:
Figure BDA0001928199820000074
wherein, CH (PX 1)i,j) Is a pixel PX1 in the jth row and ith column in the overexposure area OEAi,jThe chromaticity value of (a).
The second color mean CH2 is calculated as follows:
Figure BDA0001928199820000081
wherein, CH (PX 2)i,j) Is a pixel PX2 in the jth row and ith column in the non-overexposure area UOEAi,jThe chromaticity value of (a).
Step 209, a second functional relationship between the first chrominance mean value and the second chrominance mean value is established.
Specifically, the following second functional relationship may be established:
Figure BDA0001928199820000082
wherein, x2 is the primary color value of each pixel point in the overexposure area which needs to be input, y2 is the output target color value, wherein b2 is a constant, and can be adjusted according to the actual application scene.
And step 210, respectively calculating the average value of the saturation of the overexposed area and the saturation of the non-overexposed area to obtain a first saturation average value and a second saturation average value.
Specifically, the calculation formula of the first saturation mean SA1 is as follows:
Figure BDA0001928199820000083
wherein SA (PX 1)i,j) Is a pixel PX1 in the jth row and ith column in the overexposure area OEAi,jThe saturation value of (a).
The second saturation mean SA2 is calculated as follows:
Figure BDA0001928199820000084
wherein SA (PX 2)i,j) Is a pixel PX2 in the jth row and ith column in the non-overexposure area UOEAi,jThe saturation value of (a).
Step 211, establishing a third functional relationship between the first saturation mean value and the second saturation mean value.
Specifically, the following third functional relationship may be established:
Figure BDA0001928199820000085
wherein, x3 is the original saturation value of each pixel point in the overexposure area which needs to be input, y3 is the output target saturation value, wherein b3 is a constant and can be adjusted according to the actual application scene.
According to the embodiment of the invention, the functional relation aiming at the brightness, the chroma and the saturation can be respectively established according to the brightness mean value, the chroma mean value and the saturation mean value of the overexposed area and the non-overexposed area, so that more accurate adjustment of the brightness, the chroma and the saturation can be realized.
Step 212, for each pixel point of the overexposure area, inputting the brightness of the pixel point into the first functional relation to obtain the target brightness.
Specifically, when the input of the first functional relationship is the original brightness value, the output is the target brightness, that is, the adjusted brightness.
Step 213, for each pixel point of the overexposure area, adjusting the brightness of the pixel point to the target brightness.
Specifically, the brightness of the pixel point in the overexposure area is replaced with the target brightness.
Step 214, for each pixel point of the overexposure area, inputting the chromaticity of the pixel point into the second function relation to obtain a target chromaticity.
Specifically, when the input of the second functional relationship is the primary chromaticity value, the output is the target chromaticity, that is, the adjusted chromaticity.
Step 215, for each pixel point of the overexposure area, adjusting the color of the pixel point to the target chromaticity.
Specifically, the chromaticity of the pixel point in the overexposure area is replaced by the target chromaticity.
Step 216, for each pixel point of the overexposure area, inputting the saturation of the pixel point into the third function relation to obtain a target saturation.
Specifically, when the input of the third functional relationship is the original saturation value, the output is the target saturation, that is, the adjusted saturation.
Step 217, for each pixel point of the overexposure area, adjusting the saturation of the pixel point to the target saturation.
Specifically, the saturation of the pixel point in the overexposure area is replaced by the target saturation.
The embodiment of the invention can determine the target saturation through the third function relation representing the saturation relation.
In practical application, detail information such as skin texture between an overexposed area and a non-overexposed area can be identified and filled in the overexposed area, so that consistency of skin detail is improved.
The embodiment of the invention can adjust the brightness, the chroma and the saturation based on the original brightness, the chroma and the saturation of each pixel point in the overexposure area, so that the hierarchy among the pixel points is unchanged after adjustment.
In the embodiment of the invention, the overexposure area in the image to be processed is determined; carrying out color level correction on the image to be processed with the overexposure area; and respectively adjusting the brightness, the chromaticity and the saturation of the overexposure area according to the brightness, the chromaticity and the saturation of the overexposure area and the non-overexposure area, wherein the non-overexposure area is an area outside the overexposure area in the image to be processed, so that the brightness value of each pixel point can be adjusted according to the relation between the brightness of the overexposure area and the brightness of the non-overexposure area, the brightness difference between original pixels can be kept, and the brightness level cannot be weakened.
Referring to fig. 4, a block diagram of a mobile terminal according to a third embodiment of the present invention is shown.
The mobile terminal 300 includes: an overexposure area determining module 301, a tone scale correcting module 302 and an overexposure processing module 303.
The functions of the modules and the interaction relationship between the modules are described in detail below.
An overexposure area determining module 301, configured to determine an overexposure area in the image to be processed;
and the color level correction module 302 is configured to perform color level correction on the image to be processed in which the overexposed area exists.
An overexposure processing module 303, configured to adjust the luminance, the chrominance, and the saturation of the overexposure region respectively according to the luminance, the chrominance, and the saturation of the overexposure region and the non-overexposure region, where the non-overexposure region is a region outside the overexposure region in the image to be processed.
In the embodiment of the invention, the overexposure area in the image to be processed is determined; carrying out color level correction on the image to be processed with the overexposure area; and respectively adjusting the brightness, the chromaticity and the saturation of the overexposure area according to the brightness, the chromaticity and the saturation of the overexposure area and the non-overexposure area, wherein the non-overexposure area is an area outside the overexposure area in the image to be processed, so that the brightness value of each pixel point can be adjusted according to the relation between the brightness of the overexposure area and the brightness of the non-overexposure area, the brightness difference between original pixels can be kept, and the brightness level cannot be weakened.
The third embodiment is a corresponding apparatus embodiment to the first embodiment, and details thereof are not repeated herein.
Referring to fig. 5, a block diagram of a mobile terminal according to a fourth embodiment of the present invention is shown.
The mobile terminal 400 includes: an overexposure area determining module 401, a tone scale correcting module 402 and an overexposure processing module 403.
The functions of the modules and the interaction relationship between the modules are described in detail below.
An overexposure region determining module 401, configured to determine an overexposure region in the image to be processed; optionally, in an embodiment of the present invention, the overexposure area determining module 401 includes:
the candidate region determining sub-module 4011 is configured to move a preset light and dark mask in the image to be processed, where a region covered by the mask is a candidate region.
And the candidate brightness value calculation submodule 4012 is configured to calculate an average value of the brightness of each pixel point in the candidate region, so as to obtain a candidate brightness value.
The overexposure region determining sub-module 4013 is configured to determine, when the candidate luminance value is greater than a preset third luminance threshold, that the candidate region is an overexposure region.
The overexposure region continuous determination sub-module 4014 is configured to determine that the candidate region is not an overexposure region when the candidate luminance value is smaller than or equal to a preset third luminance threshold, and continuously move the bright and dark mask.
A color level correction module 402, configured to perform color level correction on the image to be processed in which the overexposure region exists; optionally, in an embodiment of the present invention, the color gradation correcting module 402 includes:
the color level correction submodule 4021 is configured to establish a color level adjustment function, and adjust the brightness value of each pixel point in the image to be processed by using the color level adjustment function to obtain an adjusted brightness value of each pixel point; if the brightness value of the pixel point is smaller than a preset first brightness threshold value, the adjusted brightness value of the pixel point is larger than the brightness value of the pixel point; if the brightness value of the pixel point is greater than a preset second brightness threshold, the brightness value of the pixel point after adjustment is smaller than the brightness value of the pixel point, and the second brightness threshold is greater than the first brightness threshold.
An overexposure processing module 403, configured to adjust the luminance, the chrominance, and the saturation of the overexposure region respectively according to the luminance, the chrominance, and the saturation of the overexposure region and a non-overexposure region, where the non-overexposure region is a region outside the overexposure region in the image to be processed; optionally, in an embodiment of the present invention, the overexposure processing module 403 includes:
a functional relationship establishing submodule 4031, configured to respectively establish a first functional relationship for luminance, a second functional relationship for chrominance, and a third functional relationship for saturation, where the non-overexposed region is a region in the image to be processed other than the overexposed region; optionally, in this embodiment of the present invention, the function relationship establishing sub-module 4031 includes:
a luminance mean value calculating unit 40311, configured to calculate mean values of the luminances of the overexposed area and the non-overexposed area, respectively, to obtain a first luminance mean value and a second luminance mean value.
A first functional relation establishing unit 40312, configured to establish a first functional relation between the first luminance mean value and the second luminance mean value.
A chromaticity mean value calculating unit 40313, configured to calculate mean values of the chromaticities of the overexposed area and the non-overexposed area, respectively, to obtain a first chromaticity mean value and a second chromaticity mean value.
The second functional relationship establishing unit 40314 is configured to establish a second functional relationship between the first chrominance mean value and the second chrominance mean value.
A saturation mean value calculating unit 40315, configured to calculate mean values of the saturations of the overexposed region and the non-overexposed region, respectively, to obtain a first saturation mean value and a second saturation mean value.
A third functional relationship establishing unit 40316, configured to establish a third functional relationship between the first saturation mean value and the second saturation mean value.
An overexposure processing sub-module 4032, configured to respectively adjust the luminance, the chromaticity, and the saturation of the overexposure area according to the first functional relationship, the second functional relationship, and the third functional relationship; optionally, in an embodiment of the present invention, the overexposure processing sub-module 4032 includes:
and a target brightness calculation unit 40321, configured to, for each pixel point of the overexposure region, input the brightness of the pixel point into the first function relationship to obtain target brightness.
A brightness adjusting unit 40322, configured to, for each pixel point in the overexposure region, adjust the brightness of the pixel point to the target brightness.
And a target chromaticity calculation unit 40323, configured to, for each pixel point in the overexposure region, input the chromaticity of the pixel point into the second function relation to obtain a target chromaticity.
A chromaticity adjusting unit 40324, configured to, for each pixel point in the overexposure region, adjust the chromaticity of the pixel point to the target chromaticity.
And the target saturation calculation unit 40325 is configured to, for each pixel point of the overexposure region, input the saturation of the pixel point into the third function relation to obtain a target saturation.
A saturation adjusting unit 40326, configured to adjust, for each pixel point of the overexposure region, the saturation of the pixel point to be the target saturation.
In the embodiment of the invention, the overexposure area in the image to be processed is determined; carrying out color level correction on the image to be processed with the overexposure area; and respectively adjusting the brightness, the chromaticity and the saturation of the overexposure area according to the brightness, the chromaticity and the saturation of the overexposure area and the non-overexposure area, wherein the non-overexposure area is an area outside the overexposure area in the image to be processed, so that the brightness value of each pixel point can be adjusted according to the relation between the brightness of the overexposure area and the brightness of the non-overexposure area, the brightness difference between original pixels can be kept, and the brightness level cannot be weakened.
The fourth embodiment is a device embodiment corresponding to the second embodiment, and details can be found in reference to the second embodiment, which are not described herein again.
Fig. 6 is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, where the mobile terminal 500 includes, but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 6 is not intended to be limiting of mobile terminals, and that a mobile terminal may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the mobile terminal includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
A processor 510 for determining an overexposed region in an image to be processed; carrying out color level correction on the image to be processed with the overexposure area; and respectively adjusting the brightness, the chromaticity and the saturation of the overexposed area according to the brightness, the chromaticity and the saturation of the overexposed area and the non-overexposed area, wherein the non-overexposed area is an area outside the overexposed area in the image to be processed.
In the embodiment of the invention, the overexposure area in the image to be processed is determined; carrying out color level correction on the image to be processed with the overexposure area; and respectively adjusting the brightness, the chromaticity and the saturation of the overexposure area according to the brightness, the chromaticity and the saturation of the overexposure area and the non-overexposure area, wherein the non-overexposure area is an area outside the overexposure area in the image to be processed, so that the brightness value of each pixel point can be adjusted according to the relation between the brightness of the overexposure area and the brightness of the non-overexposure area, the brightness difference between original pixels can be kept, and the brightness level cannot be weakened.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 501 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 510; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 501 can also communicate with a network and other devices through a wireless communication system.
The mobile terminal provides the user with wireless broadband internet access through the network module 502, such as helping the user send and receive e-mails, browse webpages, access streaming media, and the like.
The audio output unit 503 may convert audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output as sound. Also, the audio output unit 503 may also provide audio output related to a specific function performed by the mobile terminal 500 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, and the like.
The input unit 504 is used to receive an audio or video signal. The input Unit 504 may include a Graphics Processing Unit (GPU) 5041 and a microphone 5042, and the Graphics processor 5041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 506. The image frames processed by the graphic processor 5041 may be stored in the memory 509 (or other storage medium) or transmitted via the radio frequency unit 501 or the network module 502. The microphone 5042 may receive sounds and may be capable of processing such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 501 in case of the phone call mode.
The mobile terminal 500 also includes at least one sensor 505, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 5061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 5061 and/or a backlight when the mobile terminal 500 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 505 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 506 is used to display information input by the user or information provided to the user. The Display unit 506 may include a Display panel 5061, and the Display panel 5061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 507 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. Touch panel 5071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 5071 using a finger, stylus, or any suitable object or attachment). The touch panel 5071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 510, and receives and executes commands sent by the processor 510. In addition, the touch panel 5071 may be implemented in various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 5071, the user input unit 507 may include other input devices 5072. In particular, other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 5071 may be overlaid on the display panel 5061, and when the touch panel 5071 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 510 to determine the type of the touch event, and then the processor 510 provides a corresponding visual output on the display panel 5061 according to the type of the touch event. Although in fig. 6, the touch panel 5071 and the display panel 5061 are two independent components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 5071 and the display panel 5061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 508 is an interface through which an external device is connected to the mobile terminal 500. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 508 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 500 or may be used to transmit data between the mobile terminal 500 and external devices.
The memory 509 may be used to store software programs as well as various data. The memory 509 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 509 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 510 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 509 and calling data stored in the memory 509, thereby performing overall monitoring of the mobile terminal. Processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 510.
The mobile terminal 500 may further include a power supply 511 (e.g., a battery) for supplying power to various components, and preferably, the power supply 511 may be logically connected to the processor 510 via a power management system, so that functions of managing charging, discharging, and power consumption are performed via the power management system.
In addition, the mobile terminal 500 includes some functional modules that are not shown, and thus, are not described in detail herein.
Preferably, an embodiment of the present invention further provides a mobile terminal, which includes a processor 510, a memory 509, and a computer program stored in the memory 509 and capable of running on the processor 510, where the computer program, when executed by the processor 510, implements each process of the above-mentioned image processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the embodiment of the image processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (5)

1. An image processing method, characterized in that the method comprises:
determining an overexposure area in an image to be processed;
carrying out color level correction on the image to be processed with the overexposure area;
respectively adjusting the brightness, the chromaticity and the saturation of the overexposed area according to the brightness, the chromaticity and the saturation of the overexposed area and the non-overexposed area, wherein the non-overexposed area is an area outside the overexposed area in the image to be processed;
wherein, the step of adjusting the brightness, the chroma and the saturation of the overexposed area respectively according to the brightness, the chroma and the saturation of the overexposed area and the non-overexposed area comprises the following steps:
respectively establishing a first functional relation aiming at brightness, a second functional relation aiming at chroma and a third functional relation aiming at saturation;
adjusting the brightness, the chroma and the saturation of the overexposed area respectively according to the first functional relation, the second functional relation and the third functional relation;
the step of establishing a first functional relationship for luminance, a second functional relationship for chrominance, and a third functional relationship for saturation, respectively, includes:
respectively calculating the average value of the brightness of the overexposed area and the brightness of the non-overexposed area to obtain a first brightness average value and a second brightness average value;
establishing a first functional relation between the first brightness mean value and the second brightness mean value;
respectively calculating the average value of the chromaticity of the overexposed area and the average value of the chromaticity of the non-overexposed area to obtain a first chromaticity mean value and a second chromaticity mean value;
establishing a second functional relation between the first chrominance mean value and the second chrominance mean value;
respectively calculating the average value of the saturation of the overexposure area and the saturation of the non-overexposure area to obtain a first saturation average value and a second saturation average value;
establishing a third functional relation between the first saturation mean value and the second saturation mean value;
the step of determining the overexposed region in the image to be processed comprises the following steps:
moving a preset light and shade mask in an image to be processed, wherein the area covered by the mask is a candidate area;
calculating the average value of the brightness of each pixel point in the candidate region to obtain a candidate brightness value;
determining the candidate area as an overexposure area under the condition that the candidate brightness value is greater than a preset third brightness threshold value;
and under the condition that the candidate brightness value is smaller than or equal to a preset third brightness threshold value, determining that the candidate area is not an overexposure area, and continuously moving the bright and dark mask.
2. The method according to claim 1, wherein the step of adjusting the luminance, the chrominance and the saturation of the overexposed region according to the first functional relationship, the second functional relationship and the third functional relationship respectively comprises:
for each pixel point of the overexposure area, inputting the brightness of the pixel point into the first functional relation to obtain target brightness;
for each pixel point of the overexposure area, adjusting the brightness of the pixel point to the target brightness;
for each pixel point of the overexposure area, inputting the chromaticity of the pixel point into the second function relation to obtain target chromaticity;
for each pixel point of the overexposure area, adjusting the chromaticity of the pixel point to the target chromaticity;
for each pixel point of the overexposure area, inputting the saturation of the pixel point into the third function relation to obtain a target saturation;
and for each pixel point of the overexposure area, adjusting the saturation of the pixel point to be the target saturation.
3. The method according to claim 1, wherein the step of performing tone scale correction on the image to be processed in which the overexposed region exists specifically comprises:
establishing a color gradation adjusting function, and adjusting the brightness value of each pixel point in the image to be processed by using the color gradation adjusting function to obtain the adjusted brightness value of each pixel point;
if the brightness value of the pixel point is smaller than a preset first brightness threshold value, the adjusted brightness value of the pixel point is larger than the brightness value of the pixel point;
if the brightness value of the pixel point is greater than a preset second brightness threshold, the brightness value of the pixel point after adjustment is smaller than the brightness value of the pixel point, and the second brightness threshold is greater than the first brightness threshold.
4. A mobile terminal, characterized in that the mobile terminal comprises:
the overexposure area determining module is used for determining an overexposure area in the image to be processed;
the color level correction module is used for performing color level correction on the image to be processed with the overexposure area;
an overexposure processing module, configured to adjust the luminance, the chrominance, and the saturation of the overexposure area according to the luminance, the chrominance, and the saturation of the overexposure area and a non-overexposure area, where the non-overexposure area is an area outside the overexposure area in the image to be processed;
wherein, the overexposure processing module comprises:
the functional relation establishing submodule is used for respectively establishing a first functional relation aiming at the brightness, a second functional relation aiming at the chroma and a third functional relation aiming at the saturation;
the overexposure processing submodule is used for respectively adjusting the brightness, the chroma and the saturation of the overexposure area according to the first functional relation, the second functional relation and the third functional relation;
the functional relationship establishing submodule comprises:
the brightness mean value calculating unit is used for calculating the mean value of the brightness of the overexposed area and the non-overexposed area respectively to obtain a first brightness mean value and a second brightness mean value;
the first functional relation establishing unit is used for establishing a first functional relation between the first brightness mean value and the second brightness mean value;
the chrominance mean value calculating unit is used for calculating the mean values of the chrominance of the overexposure area and the non-overexposure area respectively to obtain a first chrominance mean value and a second chrominance mean value;
the second functional relation establishing unit is used for establishing a second functional relation of the first chrominance mean value and the second chrominance mean value;
the saturation mean value calculating unit is used for calculating the mean value of the saturation of the overexposure area and the saturation of the non-overexposure area respectively to obtain a first saturation mean value and a second saturation mean value;
a third functional relation establishing unit, configured to establish a third functional relation between the first saturation mean value and the second saturation mean value;
the overexposure area determining module is specifically used for moving a preset bright and dark mask in the image to be processed, wherein the area covered by the mask is a candidate area;
calculating the average value of the brightness of each pixel point in the candidate region to obtain a candidate brightness value;
determining the candidate area as an overexposure area under the condition that the candidate brightness value is greater than a preset third brightness threshold value;
and under the condition that the candidate brightness value is smaller than or equal to a preset third brightness threshold value, determining that the candidate area is not an overexposure area, and continuously moving the bright and dark mask.
5. The mobile terminal of claim 4, wherein the overexposure processing sub-module comprises:
the target brightness calculation unit is used for inputting the brightness of each pixel point of the overexposure area into the first functional relation to obtain target brightness;
the brightness adjusting unit is used for adjusting the brightness of each pixel point of the overexposure area to the target brightness;
the target chromaticity calculation unit is used for inputting the chromaticity of each pixel point of the overexposure area into the second function relation to obtain target chromaticity;
the chromaticity adjusting unit is used for adjusting the chromaticity of each pixel point of the overexposure area to the target chromaticity;
the target saturation calculation unit is used for inputting the saturation of each pixel point of the overexposure area into the third function relation to obtain a target saturation;
and the saturation adjusting unit is used for adjusting the saturation of each pixel point of the overexposure area to the target saturation.
CN201811627050.7A 2018-12-28 2018-12-28 Image processing method and mobile terminal Active CN109729280B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811627050.7A CN109729280B (en) 2018-12-28 2018-12-28 Image processing method and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811627050.7A CN109729280B (en) 2018-12-28 2018-12-28 Image processing method and mobile terminal

Publications (2)

Publication Number Publication Date
CN109729280A CN109729280A (en) 2019-05-07
CN109729280B true CN109729280B (en) 2021-08-06

Family

ID=66297546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811627050.7A Active CN109729280B (en) 2018-12-28 2018-12-28 Image processing method and mobile terminal

Country Status (1)

Country Link
CN (1) CN109729280B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110706168A (en) * 2019-09-25 2020-01-17 中国图片社有限责任公司 Image brightness adjusting method
CN110930335B (en) * 2019-11-27 2023-03-31 维沃移动通信有限公司 Image processing method and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101049012A (en) * 2004-08-31 2007-10-03 卡西欧计算机株式会社 Image pickup apparatus, exposure control method, and computer program installed in the image pickup apparatus
CN101971612A (en) * 2007-12-04 2011-02-09 索尼公司 Image processing device and method, program, and recording medium
CN102006421A (en) * 2009-09-01 2011-04-06 华晶科技股份有限公司 Processing method for image with face
CN102497490A (en) * 2011-12-16 2012-06-13 上海富瀚微电子有限公司 System and method for realizing image high dynamic range compression
CN105184748A (en) * 2015-09-17 2015-12-23 电子科技大学 Image bit depth enhancing method
CN105915811A (en) * 2016-04-08 2016-08-31 深圳英飞拓科技股份有限公司 Image strong light inhibition adaptation control method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3952989B2 (en) * 2003-04-30 2007-08-01 住友電気工業株式会社 Method and apparatus for controlling exposure of camera-type vehicle detector
US7916897B2 (en) * 2006-08-11 2011-03-29 Tessera Technologies Ireland Limited Face tracking for controlling imaging parameters
CN104091176B (en) * 2014-07-18 2015-10-14 吴建忠 Portrait comparison application technology in video

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101049012A (en) * 2004-08-31 2007-10-03 卡西欧计算机株式会社 Image pickup apparatus, exposure control method, and computer program installed in the image pickup apparatus
CN101971612A (en) * 2007-12-04 2011-02-09 索尼公司 Image processing device and method, program, and recording medium
CN102006421A (en) * 2009-09-01 2011-04-06 华晶科技股份有限公司 Processing method for image with face
CN102497490A (en) * 2011-12-16 2012-06-13 上海富瀚微电子有限公司 System and method for realizing image high dynamic range compression
CN105184748A (en) * 2015-09-17 2015-12-23 电子科技大学 Image bit depth enhancing method
CN105915811A (en) * 2016-04-08 2016-08-31 深圳英飞拓科技股份有限公司 Image strong light inhibition adaptation control method and device

Also Published As

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

Similar Documents

Publication Publication Date Title
CN110602473B (en) White balance calibration method and device
CN107908383B (en) Screen color adjusting method and device and mobile terminal
CN109688322B (en) Method and device for generating high dynamic range image and mobile terminal
CN107846583B (en) Image shadow compensation method and mobile terminal
CN108234894B (en) Exposure adjusting method and terminal equipment
CN109462745B (en) White balance processing method and mobile terminal
CN108040209B (en) Shooting method and mobile terminal
CN110969981A (en) Screen display parameter adjusting method and electronic equipment
CN109727212B (en) Image processing method and mobile terminal
CN110069311B (en) Application window display method and device, mobile terminal and readable storage medium
CN107153500B (en) Method and equipment for realizing image display
CN109819166B (en) Image processing method and electronic equipment
CN109474784B (en) Preview image processing method and terminal equipment
CN109104578B (en) Image processing method and mobile terminal
CN111459233A (en) Display method, electronic device, and storage medium
CN111899695A (en) Backlight adjusting method, terminal device and readable storage medium
CN108494936B (en) Light intensity detection method and mobile terminal
CN111443765A (en) Electronic equipment and screen display method
CN109729280B (en) Image processing method and mobile terminal
CN109639981B (en) Image shooting method and mobile terminal
CN113888447A (en) Image processing method, terminal and storage medium
CN111475238B (en) Page processing method and device, electronic equipment and storage medium
CN111083386B (en) Image processing method and electronic device
CN110602384B (en) Exposure control method and electronic device
CN109348212B (en) Image noise determination method and terminal equipment

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