CN105513024A - Method and terminal for processing image - Google Patents

Method and terminal for processing image Download PDF

Info

Publication number
CN105513024A
CN105513024A CN201510896282.2A CN201510896282A CN105513024A CN 105513024 A CN105513024 A CN 105513024A CN 201510896282 A CN201510896282 A CN 201510896282A CN 105513024 A CN105513024 A CN 105513024A
Authority
CN
China
Prior art keywords
formula
image
propagation coefficient
sigma
pixel
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.)
Pending
Application number
CN201510896282.2A
Other languages
Chinese (zh)
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.)
Meizu Technology China Co Ltd
Original Assignee
Meizu Technology China 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 Meizu Technology China Co Ltd filed Critical Meizu Technology China Co Ltd
Priority to CN201510896282.2A priority Critical patent/CN105513024A/en
Publication of CN105513024A publication Critical patent/CN105513024A/en
Pending legal-status Critical Current

Links

Classifications

    • G06T5/73

Abstract

The embodiment of the invention discloses an image processing method, and the method comprises the following steps: determining a preset area-sized brightest area in a gray level image corresponding to a to-be-processed image; calculating the atmospheric light value according to the brightest area; calculating a first atmospheric propagation coefficient through a preset calculation mode; adjusting the first atmospheric propagation coefficient throught the preset mode to obtain M second atmospheric propagation coefficients, wherein the M is an integer more than or equal to 1; performing an enhancement process to the to-be-processed image according to the atmospheric light value and the M second atmospheric propagation coefficients to obtain M enhanced images; evaluating the M enhanced images by a preset evaluation index, and determining a target enhanced image according to an evaluation result. The embodiment of the invention also discloses a terminal. According to the invention, the image effect of the to-be-processed image can be finely adjusted by using the method to obtain a better image effect than before.

Description

A kind of method of image procossing and terminal
Technical field
The embodiment of the present invention relates to technical field of image processing, refers more particularly to a kind of method and terminal of image procossing.
Background technology
Along with the fast development of infotech, the function of terminal is more and more perfect, and the requirement of people to terminal is also more and more higher, and with regard to by taking pictures, under greasy weather or haze weather environment, the effect of the image obtained is poor.In prior art, in terminal (as mobile phone, panel computer), image procossing or image are gone to process often all mechanization process of haze, thus, Graphical User after the image procossing obtained or image remove haze is often difficult to finely tune, thus, be difficult to obtain making customer satisfaction system enhancing image.
Summary of the invention
Embodiments provide a kind of method and terminal of image procossing, to finely tuning the image effect of pending image, to obtain good image effect.
The invention process first aspect provides a kind of method of image procossing, comprises step:
Determine the brightest area of the predeterminable area size in the gray level image that pending image is corresponding;
Air light value is calculated according to described brightest area;
The first air propagation coefficient is calculated according to default account form;
Regulate described first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer;
According to described air light value and described M the second air propagation coefficient, enhancing process is carried out to described pending image, strengthen image to obtain M;
Adopt preset evaluation index to strengthen image to described M to evaluate, with the result determination target enhance image according to described evaluation.
In conjunction with the first aspect of the embodiment of the present invention, in the first possible embodiment of first aspect, described pending image is containing mist image, containing haze image, containing at least one in sleet image or iridescent image.
In conjunction with the first aspect of the embodiment of the present invention or the first possible embodiment of first aspect, in the embodiment that the second of first aspect is possible, the described step according to described brightest area calculating air light value specifically comprises:
Calculate the average of pixel value corresponding to the pixel of described brightest area, described average is air light value.
In conjunction with the first aspect of the embodiment of the present invention or the first possible embodiment of first aspect, in the third possible embodiment of first aspect, the described step calculating the first air propagation coefficient according to default account form specifically comprises:
According to formula (1) structure contrast function:
F c o n t r a s t ( t ) = - Σ c ∈ G r a y Σ p ∈ B ( I ( p ) - I ‾ ) 2 t 2 N B - - - ( 1 )
Wherein, in formula (1), t represents atmospheric propagation coefficient, and c ∈ Gray represents calculate contrast function, F on the gray level image that described pending image is corresponding contrastt () represents the contrast function about t, p represents pixel, I (p) is the gray-scale value of any point p point in described pending image, I represents the average of pixel gray-scale value in moving window B, the i.e. mean flow rate of pixel in described moving window B, described B is the first default moving window, N bfor the number of pixel comprised at described moving window B, p ∈ B represents and constructs contrast function for described moving window B;
According to formula (2) tectonic information loss function:
F l o s s ( t ) = Σ c ∈ G r a y { Σ i = 0 α ( i - A t + A ) 2 h ( i ) + Σ i = β 255 ( i - A t + A - 255 ) h ( i ) } - - - ( 2 )
Wherein, in formula (2), F losst () is about the information loss function of t, α is first threshold, and β is Second Threshold, and α < β, h (i) represents that the pixel number of gray-scale value i accounts for the number percent of total pixel number of pending image, and A is air light value;
Described contrast function and described information loss function are substituted into formula (3) to calculate described atmospheric propagation coefficient t:
V min t F ( t ) = min t ( F c o n t r a s t ( t ) + &lambda;F l o s s ( t ) ) - - - ( 3 )
Wherein, in formula (3), about the minimization objective optimization function of t, λ is constant balance factor, and λ ∈ (0,1);
Set up objective optimization function, as formula (4):
V min ( s , &psi; ) ( F ( t ) ) = min ( s , &psi; ) &Sigma; p &Element; W ( t ( p ) - t ^ ( p ) ) 2 = min ( s , &psi; ) &Sigma; p &Element; W ( ( s ( p ) * I ( p ) + &psi; ( p ) - t ( p ) ) 2 + &epsiv; * ( s ( p ) 2 ) ) - - - ( 4 )
Wherein, in formula (4), p represents pixel, s (p) is the change of scale factor of p point, and ψ (p) is the offset component of p point, and I (p) is the gray-scale value of p point in pending image, W is the second size presetting moving window, ε is weight factor, ε > 0 represent the atmospheric propagation coefficient after optimizing, represent the atmospheric propagation coefficient after the optimization of p point, account form as shown in formula (5):
t ^ ( p ) = s ( p ) * I ( p ) + &psi; ( p ) - - - ( 5 )
Formula (6) and formula (7) can be released by formula (4):
s = 1 N &Sigma; p &Element; W I ( p ) t ( p ) - 1 N &mu; &Sigma; p &Element; W t ( p ) &sigma; 2 + &epsiv; - - - ( 6 )
&psi; = 1 N &Sigma; p &Element; W t ( p ) - s * &mu; - - - ( 7 )
Wherein, in formula (6) and formula (7), μ and σ 2be respectively average and the variance of grey scale pixel value in corresponding W window, N is the described second number presetting pixel in moving window;
The result of calculation of formula (6) and formula (7) is substituted in formula (8) and formula (9) and calculates described pending image mid point p change of scale Summing Factor offset component respectively:
s ( p ) = 1 N &Sigma; k &Element; W P s k - - - ( 8 )
&psi; ( p ) = 1 N &Sigma; k &Element; W P &psi; k - - - ( 9 )
Wherein, in formula (8) and formula (9), W pfor comprising the moving window of pixel p, s kfor kth moving window passes through some p by the intermediate result calculated in formula (6), ψ kfor kth moving window passes through some p by the intermediate result calculated in formula (7); S (p) for all window filtering operation complete after the change of scale factor of corresponding pixel points p position, ψ (p) for all window filtering operation complete after the offset component of corresponding pixel points p position;
Described pending image mid point p change of scale Summing Factor offset component formula (8) and formula (9) determined substitutes in formula (5) and calculates first gas propagation coefficient
In conjunction with the first aspect of the embodiment of the present invention or the first possible embodiment of first aspect, in the 4th kind of possible embodiment of first aspect, described according to the described first air propagation coefficient of predetermined manner adjustment, to obtain M the second air propagation coefficient, comprising:
Introduce weight factor M λ, a described M λ corresponding to M paths coefficient in different depth of field scene;
Described M λ is substituted into formula (10) and calculates described M the second air propagation coefficient:
t * = t ^ &lambda; - - - ( 10 )
Wherein, in formula (10), represent the first air propagation coefficient, t *represent the second air propagation coefficient.
In conjunction with the first aspect of the embodiment of the present invention or the first possible embodiment of first aspect, in the 5th kind of possible embodiment of first aspect, describedly according to described air light value and described M the second air propagation coefficient, enhancings process is carried out to described pending image, specifically comprises with the step obtaining M enhancing image:
Formula (11) R, G, B tri-passages corresponding to described pending image are respectively adopted to carry out enhancing process:
J c ( p ) = 1 t i * ( p ) ( I c ( p ) - A ) + A - - - ( 11 )
Wherein, in formula (11), A is air light value, represent the value of i-th the second air propagation coefficient in described M the second air propagation coefficient at p point, i is the integer being greater than 0 and being less than or equal to M, and c represents R, G, B tri-passages, J cp () is the enhancing image after passage c enhancing process, I cp () is described pending image.
Correspondingly, embodiment of the present invention second aspect provides a kind of terminal, comprising:
First determining unit, for determining the brightest area of the predeterminable area size in the gray level image that pending image is corresponding;
First computing unit, calculates air light value for the brightest area determined according to described first determining unit;
Second computing unit, for calculating the first air propagation coefficient according to default account form;
Regulon, for regulating the first air propagation coefficient of calculating of described second computing unit according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer;
Enhancement unit, M the second air propagation coefficient calculated for the air light value that calculates according to described first computing unit and described second computing unit carries out enhancings process to described pending image, to obtain M enhancing image;
Second determining unit, strengthens image for adopting preset evaluation index to M that obtains after described enhancement unit process and evaluates, with the result determination target enhance image according to described evaluation.
In conjunction with the second aspect of the embodiment of the present invention, in the first possible embodiment of second aspect, described pending image is containing mist image, containing haze image, containing at least one in sleet image or iridescent image.
In conjunction with the second aspect of the embodiment of the present invention or the first possible embodiment of second aspect, in the embodiment that the second of second aspect is possible, described first computing unit specifically for:
Calculate the average of pixel value corresponding to the pixel of described brightest area, described average is air light value.
In conjunction with the second aspect of the embodiment of the present invention or the first possible embodiment of second aspect, in the third possible embodiment of second aspect, described second computing unit comprises:
First tectonic element, for constructing contrast function according to formula (12):
F c o n t r a s t ( &iota; ) = - &Sigma; c &Element; G r a y &Sigma; p &Subset; B ( I ( p ) - I &OverBar; ) 2 t 2 N B - - - ( 12 )
Wherein, in formula (12), t represents atmospheric propagation coefficient, and c ∈ Gray represents calculate contrast function, F on the gray level image that described pending image is corresponding contrastt () represents the contrast function about t, p represents pixel, and I (p) is the gray-scale value of any point p point in described pending image, represent the average of pixel gray-scale value in moving window B, i.e. the mean flow rate of pixel in described moving window B, described B first presets moving window, N bfor the number of pixel comprised at described moving window B, p ∈ B represents and constructs contrast function for described moving window B;
Second tectonic element, for according to formula (13) tectonic information loss function:
F l o s s ( t ) = &Sigma; c &Element; G r a y { &Sigma; i = 0 &alpha; ( i - A t + A ) 2 h ( i ) + &Sigma; i = &beta; 255 ( i - A t + A - 255 ) h ( i ) } - - - ( 13 )
Wherein, in formula (13), F losst () is about the information loss function of t, α is first threshold, and β is Second Threshold, and α < β, h (i) represents that the pixel number of gray-scale value i accounts for the number percent of total pixel number of pending image, and A is air light value;
First computation subunit, for described contrast function and described information loss function are substituted into formula (14) to calculate described atmospheric propagation coefficient t:
V min t F ( t ) = min t ( F c o n t r a s t ( t ) + &lambda;F l o s s ( t ) ) - - - ( 14 )
Wherein, in formula (14), about the minimization objective optimization function of t, λ is constant balance factor, and λ ∈ (0,1);
Set up objective optimization function, as formula (15):
V min ( s , &psi; ) ( F ( t ) ) = min ( s , &psi; ) &Sigma; p &Element; W ( t ( p ) - t ^ ( p ) ) 2 = min ( s , &psi; ) &Sigma; p &Element; W ( ( s ( p ) * I ( p ) + &psi; ( p ) - t ( p ) ) 2 + &epsiv; * ( s ( p ) 2 ) ) - - - ( 15 )
Wherein, in formula (15), p represents pixel, s (p) is the change of scale factor of p point, and ψ (p) is the offset component of p point, and I (p) is the gray-scale value of p point in pending image, W is the second size presetting moving window, ε is weight factor, ε > 0 represent the atmospheric propagation coefficient after optimizing, represent the atmospheric propagation coefficient after the optimization of p point, account form as shown in formula (16):
t ^ ( p ) = s ( p ) * I ( p ) + &psi; ( p ) - - - ( 16 )
Formula (17) and formula (18) can be released by formula (15):
s = 1 N &Sigma; p &Element; W I ( p ) t ( p ) - 1 N &mu; &Sigma; p &Element; W t ( p ) &sigma; 2 + &epsiv; - - - ( 17 )
&psi; = 1 N &Sigma; p &Element; W t ( p ) - s * &mu; - - - ( 18 )
Wherein, in formula (17) and formula (18), μ and σ 2be respectively average and the variance of grey scale pixel value in corresponding W window, N is the described second number presetting pixel in moving window;
Second computation subunit, calculates described pending image mid point p change of scale Summing Factor offset component respectively for the result of calculation of formula (17) and formula (18) being substituted in formula (19) and formula (20):
s ( p ) = 1 N &Sigma; k &Element; W P s k - - - ( 19 )
&psi; ( p ) = 1 N &Sigma; k &Element; W P &psi; k - - - ( 20 )
Wherein, in formula (19) and formula (20), W pfor comprising the moving window of pixel p, s kfor kth moving window passes through some p by the intermediate result calculated in formula (17), ψ kfor kth moving window passes through some p by the intermediate result calculated in formula (18); S (p) for all window filtering operation complete after the change of scale factor of corresponding pixel points p position, ψ (p) for all window filtering operation complete after the offset component of corresponding pixel points p position;
3rd computation subunit, the described pending image mid point p change of scale Summing Factor offset component for formula (19) and formula (20) being determined substitutes in formula (16) and calculates first gas propagation coefficient
In conjunction with the second aspect of the embodiment of the present invention or the first possible embodiment of second aspect, in the 4th kind of possible embodiment of second aspect, described regulon comprises:
Introduce unit, for introducing weight factor M λ, a described M λ corresponds to M paths coefficient in different depth of field scene;
3rd computing unit, calculates described M the second air propagation coefficient for described M λ being substituted into formula (21):
t * = t ^ &lambda; - - - ( 21 )
Wherein, formula (21), represent the first air propagation coefficient, t *represent the second air propagation coefficient.
In conjunction with the second aspect of the embodiment of the present invention or the first possible embodiment of second aspect, in the 5th kind of possible embodiment of second aspect, described enhancement unit specifically for:
Formula (22) R, G, B tri-passages corresponding to described pending image are respectively adopted to carry out enhancing process:
J c ( p ) = 1 t i * ( p ) ( I c ( p ) - A ) + A - - - ( 22 )
Wherein, in formula (22), A is air light value, represent the value of i-th the second air propagation coefficient in described M the second air propagation coefficient at p point, i is the integer being greater than 0 and being less than or equal to M, and c represents R, G, B tri-passages, J cp () is the enhancing image after passage c enhancing process, I cp () is described pending image.
Implement the embodiment of the present invention, there is following beneficial effect:
The embodiment of the present invention determines the brightest area of the predeterminable area size in the gray level image that pending image is corresponding; Air light value is calculated according to described brightest area; The first air propagation coefficient is calculated according to default account form; Regulate described first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer; According to described air light value and described M the second air propagation coefficient, enhancing process is carried out to described pending image, strengthen image to obtain M; Adopt preset evaluation index to strengthen image to described M to evaluate, with the result determination target enhance image according to described evaluation.Adopt the embodiment of the present invention by Gas regulation propagation coefficient, to obtain different enhancing images, by evaluating multiple enhancing image, the good image of image effect is gone out as target enhance image using decision-making, thus, realize finely tuning and obtain good image effect to the image effect of pending image.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, be briefly described to the accompanying drawing used required in embodiment, description below, apparently, accompanying drawing in the following describes is only some embodiments of the embodiment of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The schematic flow sheet of the embodiment of the method for a kind of image procossing that Fig. 1 provides for the embodiment of the present invention;
The structural representation of the first embodiment of a kind of terminal that Fig. 2 a provides for the embodiment of the present invention;
The another structural representation of the first embodiment of a kind of terminal that Fig. 2 b provides for the embodiment of the present invention;
The another structural representation of the first embodiment of a kind of terminal that Fig. 2 c provides for the embodiment of the present invention;
The structural representation of the second embodiment of a kind of terminal that Fig. 3 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only embodiment of the present invention part embodiment, instead of whole embodiments.Based on the embodiment in the embodiment of the present invention, those of ordinary skill in the art are not making the every other embodiment obtained under creative work prerequisite, all belong to the scope of embodiment of the present invention protection.
In realization, in the embodiment of the present invention, terminal can include but not limited to: notebook computer, mobile phone, panel computer, intelligent wearable device etc.The system of terminal refers to the operating system of equipment, can include but not limited to: android system, Saipan system, Windows system, IOS (Mobile operating system of Apple's exploitation) etc.It should be noted that, Android terminal refers to the terminal of android system, and Saipan terminal refers to the terminal of Saipan system, etc.Above-mentioned terminal is only citing, and non exhaustive, including but not limited to above-mentioned terminal.
Embodiment of the present invention composition graphs 1 to Fig. 3 is described the method for a kind of image procossing that the embodiment of the present invention provides and terminal.
Refer to Fig. 1, Fig. 1 is the schematic flow sheet of the first embodiment of the method for a kind of image procossing that the embodiment of the present invention provides.The method of the image procossing described in the present embodiment, only go haze to be illustrated with image mist elimination or image, comprise step:
S101, determine the brightest area of the predeterminable area size in the gray level image that pending image is corresponding.
Wherein, terminal can determine the brightest area of the predeterminable area size in the gray level image that pending image is corresponding, and the large I of predeterminable area includes but are not limited to: 3 × 3,5 × 5,7 × 7,9 × 9,11 × 11 etc.
Alternatively, pending image can include but are not limited to: containing mist image, containing haze image, containing sleet image or iridescent image etc., wherein, the image that greasy weather camera photographs is can be containing mist image, the mist that this mist produces under can be physical environment, or, the smog produced in burning objects process.Containing mist image, can be the image that haze weather photographs, haze can be the aerial dust granule of a kind of small suspension, such as, at the aerial a kind of solid granulates of suspension that specific work environments (the generation factory (cement mill, flour mill etc.) of building ground, powdery type) produces, or due to the dust scene produced under the environment that wind is larger, haze also can be in classroom, chalk dust particle that the word that writes with chalk descends slowly and lightly etc.Can be in image containing raindrop or snow shape crystal grain containing sleet image, iridescent image to can be in image containing reflective material or vitrina and causes reflective effect on the surface of reflective material or vitrina, thus, affect image effect, such as, reflective glass, performance in the picture, is then that retroreflective regions is very bright, or, user is when taking pictures facing to window-glass, because glass reflecting can make a part of image not affect, or, user to shooting water in time, due to light, a part of region in image is caused to there will be fuzzy.
As a kind of possible embodiment, terminal can adopt quartern method to determine the brightest area of the predeterminable area size of the gray level image that pending image is corresponding, and key step is:
Step1, determine the center of the gray level image that pending image is corresponding, and according to described center, described gray level image is divided into quartern region;
Step2, calculate described quartern region corresponding pixel value average u and standard deviation sd respectively, and build score coefficient score:score=u-sd respectively.
The region that the maximal value of Step3, the score coefficient determined in Stpe2 is corresponding, goes to Step1;
Repeat above-mentioned steps, when the subregional size of the fourth class is less than predetermined threshold value, region corresponding for the maximal value of score coefficient in the Step2 determined in Step3 is defined as brightest area.
S102, calculate air light value according to described brightest area.
Wherein, terminal can calculate air light value according to brightest area, can using max pixel value corresponding for pixel in brightest area as air light value.
As a kind of possible embodiment, ask for the average of pixel value corresponding to the pixel of brightest area, this average is air light value.
S103, calculate the first air propagation coefficient according to default account form.
Wherein, terminal can calculate the first air propagation coefficient according to default account form, and preset algorithm can be as follows:
According to formula (1) structure contrast function:
F c o n t r a s t ( t ) = - &Sigma; c &Element; G r a y &Sigma; p &Element; B ( I ( p ) - I &OverBar; ) 2 t 2 N B - - - ( 1 )
Wherein, in formula (1), t represents atmospheric propagation coefficient, and c ∈ Gray represents calculate contrast function, F on the gray level image that pending image is corresponding contrastt () represents the contrast function about t, p represents pixel, and I (p) is the gray-scale value of any point p point in pending image, represent the average of pixel gray-scale value in moving window B, i.e. the mean flow rate of pixel in moving window B, B first presets moving window, N bfor the number of pixel comprised at moving window B, p ∈ B represents and constructs contrast function for moving window B;
According to formula (2) tectonic information loss function:
F l o s s ( t ) = &Sigma; c &Element; G r a y { &Sigma; i = 0 &alpha; ( i - A t + A ) 2 h ( i ) + &Sigma; i = &beta; 255 ( i - A t + A - 255 ) h ( i ) } - - - ( 2 )
Wherein, in formula (2), F losst () is about the information loss function of t, α is first threshold, and β is Second Threshold, and α < β, h (i) represents that the pixel number of gray-scale value i accounts for the number percent of total pixel number of pending image, and A is air light value;
Described contrast function and described information loss function are substituted into formula (3) to calculate described atmospheric propagation coefficient t:
V min t F ( t ) = min t ( F c o n t r a s t ( t ) + &lambda;F l o s s ( t ) ) - - - ( 3 )
Wherein, in formula (3), about the minimization objective optimization function of t, λ is constant balance factor, and λ ∈ (0,1);
Set up objective optimization function, as formula (4):
V min ( s , &psi; ) ( F ( t ) ) = min ( s , &psi; ) &Sigma; p &Element; W ( t ( p ) - t ^ ( p ) ) 2 = min ( s , &psi; ) &Sigma; p &Element; W ( ( s ( p ) * I ( p ) + &psi; ( p ) - t ( p ) ) 2 + &epsiv; * ( s ( p ) 2 ) ) - - - ( 4 )
Wherein, in formula (4), p represents pixel, s (p) is the change of scale factor of p point, and ψ (p) is the offset component of p point, and I (p) is the gray-scale value of p point in pending image, W is the second size presetting moving window, ε is weight factor, ε > 0 represent the atmospheric propagation coefficient after optimizing, represent the atmospheric propagation coefficient after the optimization of p point, account form as shown in formula (5):
t ^ ( p ) = s ( p ) * I ( p ) + &psi; ( p ) - - - ( 5 )
Formula (6) and formula (7) can be released by formula (4):
s = 1 N &Sigma; p &Element; W I ( p ) t ( p ) - 1 N &mu; &Sigma; p &Element; W t ( p ) &sigma; 2 + &epsiv; - - - ( 6 )
&psi; = 1 N &Sigma; p &Element; W t ( p ) - s * &mu; - - - ( 7 )
Wherein, in formula (6) and formula (7), μ and σ 2be respectively average and the variance of grey scale pixel value in corresponding W window, N is the described second number presetting pixel in moving window;
The result of calculation of formula (6) and formula (7) is substituted in formula (8) and formula (9) and calculates described pending image mid point p change of scale Summing Factor offset component respectively:
s ( p ) = 1 N &Sigma; k &Element; W P s k - - - ( 8 )
&psi; ( p ) = 1 N &Sigma; k &Element; W P &psi; k - - - ( 9 )
Wherein, in formula (8) and formula (9), W pfor comprising the moving window of pixel p, s kfor kth moving window passes through some p by the intermediate result calculated in formula (6), ψ kfor kth moving window passes through some p by the intermediate result calculated in formula (7); S (p) for all window filtering operation complete after the change of scale factor of corresponding pixel points p position, ψ (p) for all window filtering operation complete after the offset component of corresponding pixel points p position;
Described pending image mid point p change of scale Summing Factor offset component formula (8) and formula (9) determined substitutes in formula (5) and calculates first gas propagation coefficient
S104, regulate described first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer.
Wherein, terminal can regulate the first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer, concrete steps are as follows:
(1) weight factor M λ, a described M λ is introduced corresponding to M paths coefficient in different depth of field scene;
(2) described M λ is substituted into formula (10) and calculates described M the second air propagation coefficient:
t * = t ^ &lambda; - - - ( 10 )
Wherein, formula (10), represent the first air propagation coefficient, t *represent the second air propagation coefficient.
S105, according to described air light value and described M the second air propagation coefficient, enhancings process is carried out to described pending image, to obtain M enhancing image.
Wherein, terminal carries out enhancing process according to air light value and M the second air propagation coefficient to described pending image, strengthens image to obtain M.
Formula (11) R, G, B tri-passages corresponding to described pending image are respectively adopted to carry out enhancing process:
J c ( p ) = 1 t i * ( p ) ( I c ( p ) - A ) + A - - - ( 11 )
Wherein, in formula (11), A is air light value, represent the value of i-th the second air propagation coefficient in described M the second air propagation coefficient at p point, i is the integer being greater than 0 and being less than or equal to M, and c represents R, G, B tri-passages, J cp () is the enhancing image after passage c enhancing process, I cp () is pending image.
S106, employing preset evaluation index strengthen image to described M and evaluate, with the result determination target enhance image according to described evaluation.
Wherein, terminal can adopt preset evaluation index to evaluate M enhancing image, and preset evaluation index can include but are not limited to: mean flow rate, complete black rate, complete white rate, contrast etc.
The anti-extent of contrast piece image gray scale, account form is as formula (12); Complete white rate represent brightness close to 255 the ratio of pixel, account form is as formula (13); Complete black rate represent brightness close to 0 the ratio of pixel, computing formula is as formula (14).
&sigma; = &Sigma; P = 0 N ( J ( p ) - J &OverBar; ) 2 N - - - ( 12 )
Wherein, in formula (12)-formula (14), J (p) strengthens image at p point pixel value, for pixel intensity mean value, N is total number of image pixels, n wrepresent the number of full white pixel point, wherein, the point that pixel value in image can be greater than the first predetermined threshold value is defined as full white point, and preferably, the first predetermined threshold value can be 250; n brepresent the number of complete black pixel, the point that pixel value in image can be less than the second predetermined threshold value is defined as full stain, and preferably, the second predetermined threshold value can be 5.Contrast σ is higher, represents that the image effect after strengthening process is better; The ratio shared by point entirely white or entirely black in gray-scale map less, represent that the image effect after strengthening process is better.
Further, when practical operation, in order to avoid the impact of the accidentalia such as the random noise of image, generally first will strengthen the advanced column hisgram statistics of image, then calculate on the basis of statistical value σ, with three index parameters.
In specific implementation, the target enhance image of the embodiment of the present invention is M the image strengthening that in image, preset evaluation index is all optimum.
Alternatively, the embodiment of the present invention, not only at pending image for until mist elimination image or in time removing haze image, can carry out mist elimination to this pending image, at pending image for containing sleet image or iridescent image, can also carry out enhancings process this image.
The embodiment of the present invention determines the brightest area of the predeterminable area size in the gray level image that pending image is corresponding; Air light value is calculated according to described brightest area; The first air propagation coefficient is calculated according to default account form; Regulate described first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer; According to described air light value and described M the second air propagation coefficient, enhancing process is carried out to described pending image, strengthen image to obtain M; Adopt preset evaluation index to strengthen image to described M to evaluate, with the result determination target enhance image according to described evaluation.Adopt the embodiment of the present invention by Gas regulation propagation coefficient, to obtain different enhancing images, by evaluating multiple enhancing image, the good image of image effect is gone out as target enhance image using decision-making, thus, realize finely tuning and obtain good image effect to the image effect of pending image.
Refer to Fig. 2 a, Fig. 2 a is the structural representation of the first embodiment of a kind of terminal that the embodiment of the present invention provides.Terminal described in the embodiment of the present invention can comprise: the first determining unit 201, first computing unit 202, second computing unit 203, regulon 204, enhancement unit 205 and the second determining unit 206, specific as follows:
First determining unit 201, for determining the brightest area of the predeterminable area size in the gray level image that pending image is corresponding.
Wherein, the first determining unit 201 can determine the brightest area of the predeterminable area size in the gray level image that pending image is corresponding, and the large I of predeterminable area includes but are not limited to: 3 × 3,5 × 5,7 × 7,9 × 9,11 × 11 etc.
As a kind of possible embodiment, the first determining unit 201 can adopt quartern method to determine the brightest area of the predeterminable area size of the gray level image that pending image is corresponding, and key step is:
Step1, determine the center of the gray level image that pending image is corresponding, and according to described center, described gray level image is divided into quartern region;
Step2, calculate described quartern region corresponding pixel value average u and standard deviation sd respectively, and build score coefficient score:score=u-sd respectively.
The region that the maximal value of Step3, the score coefficient determined in Stpe2 is corresponding, goes to Step1;
Repeat above-mentioned steps, when the subregional size of the fourth class is less than predetermined threshold value, region corresponding for the maximal value of score coefficient in the Step2 determined in Step3 is defined as brightest area.
First computing unit 202, calculates air light value for the brightest area determined according to described first determining unit 201.
Wherein, the first computing unit 202 can calculate air light value according to brightest area, can using max pixel value corresponding for pixel in brightest area as air light value.
As a kind of possible embodiment, the first computing unit 202 can ask for the average of pixel value corresponding to the pixel of brightest area, and this average is air light value.
Second computing unit 203, for calculating the first air propagation coefficient according to default account form.
Wherein, the second computing unit 203 can calculate the first air propagation coefficient according to default account form.
As a kind of possible embodiment, as shown in Figure 2 b, the second computing unit 203 described in Fig. 2 a can further include: the first tectonic element 2031, second tectonic element 2032, first computation subunit 2033, second computation subunit 2034 and the 3rd computation subunit 2035, specific as follows:
First tectonic element 2031, for constructing contrast function according to formula (1):
F c o n t r a s t ( t ) = - &Sigma; c &Element; G r a y &Sigma; p &Element; B ( I ( p ) - I &OverBar; ) 2 t 2 N B - - - ( 12 )
Wherein, in formula (12), t represents atmospheric propagation coefficient, and c ∈ Gray represents and calculates contrast function, F stating on gray level image corresponding to pending image contrastt () represents the contrast function about t, p represents pixel, and I (p) is the gray-scale value of any point p point in pending image, I represents the average of pixel gray-scale value in moving window B, the i.e. mean flow rate of pixel in moving window B, B first presets moving window, N bfor the number of pixel comprised at moving window B, p ∈ B represents and constructs contrast function for moving window B.
Second tectonic element 2032, for according to formula (13) tectonic information loss function:
F l o s s ( t ) = &Sigma; c &Element; G r a y { &Sigma; i = 0 &alpha; ( i - A t + A ) 2 h ( i ) + &Sigma; i = &beta; 255 ( i - A t + A - 255 ) h ( i ) } - - - ( 13 )
Wherein, in formula (13), F losst () is about the information loss function of t, α is first threshold, and β is Second Threshold, and α < β, h (i) represents that the pixel number of gray-scale value i accounts for the number percent of total pixel number of pending image, and A is air light value;
First computation subunit 2033, for described contrast function and described information loss function are substituted into formula (14) to calculate described atmospheric propagation coefficient t:
V min t F ( t ) = min t ( F c o n t r a s t ( t ) + &lambda;F l o s s ( t ) ) - - - ( 14 )
Wherein, in formula (14), about the minimization objective optimization function of t, λ is constant balance factor, and λ ∈ (0,1);
Set up objective optimization function, as formula (15):
V min ( s , &psi; ) ( F ( t ) ) = min ( s , &psi; ) &Sigma; p &Element; W ( t ( p ) - t ^ ( p ) ) 2 = min ( s , &psi; ) &Sigma; p &Element; W ( ( s ( p ) * I ( p ) + &psi; ( p ) - t ( p ) ) 2 + &epsiv; * ( s ( p ) 2 ) ) - - - ( 15 )
Wherein, in formula (15), p represents pixel, s (p) is the change of scale factor of p point, and ψ (p) is the offset component of p point, and I (p) is the gray-scale value of p point in pending image, W is the second size presetting moving window, ε is weight factor, ε > 0 represent the atmospheric propagation coefficient after optimizing, represent the atmospheric propagation coefficient after the optimization of p point, account form as shown in formula (16):
t ^ ( p ) = s ( p ) * I ( p ) + &psi; ( p ) - - - ( 16 )
Formula (17) and formula (18) can be released by formula (15):
s = 1 N &Sigma; p &Element; W I ( p ) t ( p ) - 1 N &mu; &Sigma; p &Element; W t ( p ) &sigma; 2 + &epsiv; - - - ( 17 )
&psi; = 1 N &Sigma; p &Element; W t ( p ) - s * &mu; - - - ( 18 )
Wherein, in formula (17) and formula (18), μ and σ 2be respectively average and the variance of grey scale pixel value in corresponding W window, N is the described second number presetting pixel in moving window;
Second computation subunit 2034, calculates described pending image mid point p change of scale Summing Factor offset component respectively for the result of calculation of formula (17) and formula (18) being substituted in formula (19) and formula (20):
s ( p ) = 1 N &Sigma; k &Element; W P s k - - - ( 19 )
&psi; ( p ) = 1 N &Sigma; k &Element; W P &psi; k - - - ( 20 )
Wherein, in formula (19) and formula (20), W pfor comprising the moving window of pixel p, s kfor kth moving window passes through some p by the intermediate result calculated in formula (17), ψ kfor kth moving window passes through some p by the intermediate result calculated in formula (18); S (p) for all window filtering operation complete after the change of scale factor of corresponding pixel points p position, ψ (p) for all window filtering operation complete after the offset component of corresponding pixel points p position;
3rd computation subunit 2035, the described pending image mid point p change of scale Summing Factor offset component for formula (19) and formula (20) being determined substitutes in formula (16) and calculates first gas propagation coefficient
Regulon 204, for regulating the first air propagation coefficient of calculating of described second computing unit 203 according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer.
Wherein, regulon 204 can regulate the first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer, concrete steps are as follows:
As a kind of possible embodiment, as shown in Figure 2 c, Fig. 2 a or the regulon described in Fig. 2 b 204 can further include: introduce unit 2041 and the 3rd computing unit 2042, specific as follows:
Introduce unit 2041, for introducing weight factor M λ, a described M λ corresponds to M paths coefficient in different depth of field scene;
3rd computing unit 2042, calculates described M the second air propagation coefficient for described M λ being substituted into formula (21):
t * = t ^ &lambda; - - - ( 21 )
Wherein, formula (21), represent the first air propagation coefficient, t *represent the second air propagation coefficient.
Enhancement unit 205, M the second air propagation coefficient calculated for the air light value that calculates according to described first computing unit and described second computing unit carries out enhancings process to described pending image, to obtain M enhancing image.
Wherein, enhancement unit 205 carries out enhancing process according to air light value and M the second air propagation coefficient to described pending image, strengthens image to obtain M.
Enhancement unit 205 can adopt formula (22) R, G, B tri-passages corresponding to described pending image respectively to carry out enhancing process:
J c ( p ) = 1 t i * ( p ) ( I c ( p ) - A ) + A - - - ( 22 )
Wherein, in formula (22), A is air light value, represent the value of i-th the second air propagation coefficient in described M the second air propagation coefficient at p point, i is the integer being greater than 0 and being less than or equal to M, and c represents R, G, B tri-passages, J cp () is the enhancing image after passage c enhancing process, I cp () is mist elimination or the image before removing haze.
Second determining unit 206, strengthens image for adopting preset evaluation index to M that obtains after described enhancement unit process and evaluates, with the result determination target enhance image according to described evaluation.
Wherein, the second determining unit 206 can adopt preset evaluation index to evaluate M enhancing image, and preset evaluation index can include but are not limited to: mean flow rate, complete black rate, complete white rate, contrast etc.
The anti-extent of contrast piece image gray scale, account form is as formula (23); Complete white rate represent brightness close to 255 the ratio of pixel, account form is as formula (24); Complete black rate represent brightness close to 0 the ratio of pixel, computing formula is as formula (25).
&sigma; = &Sigma; p = 0 N ( J ( p ) - J &OverBar; ) 2 N - - - ( 23 )
Wherein, in formula (23)-formula (25), J (p) strengthens image at p point pixel value, for pixel intensity mean value, N is total number of image pixels, n wrepresent the number of full white pixel point, wherein, the point that pixel value in image can be greater than the first predetermined threshold value is defined as full white point, and preferably, the first predetermined threshold value can be 250; n brepresent the number of complete black pixel, the point that pixel value in image can be less than the second predetermined threshold value is defined as full stain, and preferably, the second predetermined threshold value can be 5.Contrast σ is higher, represents that image processing effect is better; The ratio shared by point entirely white or entirely black in gray-scale map less, represent that image processing effect is better.
In specific implementation, the target enhance image of the embodiment of the present invention is M the image strengthening that in image, preset evaluation index is all optimum.
Terminal described by the embodiment of the present invention determines the brightest area of the predeterminable area size in the gray level image that pending image is corresponding; Air light value is calculated according to described brightest area; The first air propagation coefficient is calculated according to default account form; Regulate described first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer; According to described air light value and described M the second air propagation coefficient, enhancing process is carried out to described pending image, strengthen image to obtain M; Adopt preset evaluation index to strengthen image to described M to evaluate, with the result determination target enhance image according to described evaluation.Adopt the embodiment of the present invention by Gas regulation propagation coefficient, to obtain different enhancing images, by evaluating multiple enhancing image, the good image of image effect is gone out as target enhance image using decision-making, thus, realize finely tuning and obtain good image effect to the image effect of pending image.
Refer to Fig. 3, the structural representation of the second embodiment of a kind of terminal that Fig. 3 provides for the embodiment of the present invention.Terminal described in the present embodiment comprises: at least one input equipment 1000; At least one output device 2000; At least one processor 3000, such as CPU; With storer 4000, above-mentioned input equipment 1000, output device 2000, processor 3000 are connected by bus 5000 with storer 4000.
Wherein, above-mentioned input equipment 1000 can be contact panel, common PC, liquid crystal display, touch screen, push button etc.
Above-mentioned storer 4000 can be high-speed RAM storer, also can be non-labile storer (non-volatilememory), such as magnetic disk memory.Above-mentioned storer 4000 is for storing batch processing code, and above-mentioned input equipment 1000, output device 2000 and processor 3000, for calling the program code stored in storer 4000, perform and operate as follows:
Above-mentioned processor 3000, for: the brightest area determining the predeterminable area size in the gray level image that pending image is corresponding;
Above-mentioned processor 3000, also specifically for:
Also specifically for: calculate air light value according to described brightest area;
As a kind of possible embodiment, above-mentioned processor 3000 calculates air light value according to described brightest area, is specially:
Calculate the average of pixel value corresponding to the pixel of described brightest area, described average is air light value.
Above-mentioned processor 3000, also specifically for:
The first air propagation coefficient is calculated according to default account form;
As a kind of possible embodiment, above-mentioned processor 3000 calculates the first air propagation coefficient according to default account form, is specially:
According to formula (26) structure contrast function:
F c o n t r a s t ( t ) = - &Sigma; c &Element; G r a y &Sigma; p &Element; B ( I ( p ) - I &OverBar; ) 2 t 2 N B - - - ( 26 )
Wherein, in formula (26), t represents atmospheric propagation coefficient, and c ∈ Gray represents calculate contrast function, F on the gray level image that described pending image is corresponding contrastt () represents the contrast function about t, p represents pixel, and I (p) is the gray-scale value of any point p point in described pending image, represent the average of pixel gray-scale value in moving window B, i.e. the mean flow rate of pixel in described moving window B, described B first presets moving window, N bfor the number of pixel comprised at described moving window B, p ∈ B represents and constructs contrast function for described moving window B;
According to formula (27) tectonic information loss function:
F l o s s ( t ) = &Sigma; c &Element; G r a y { &Sigma; i = 0 &alpha; ( i - A t + A ) 2 h ( i ) + &Sigma; i = &beta; 255 ( i - A t + A - 255 ) h ( i ) } - - - ( 27 )
Wherein, in formula (27), F losst () is about the information loss function of t, α is first threshold, and β is Second Threshold, and α < β, h (i) represents that the pixel number of gray-scale value i accounts for the number percent of total pixel number of pending image, and A is air light value;
Described contrast function and described information loss function are substituted into formula (28) to calculate described atmospheric propagation coefficient t:
V min t F ( t ) = min t ( F c o n t r a s t ( t ) + &lambda;F l o s s ( t ) ) - - - ( 28 )
Wherein, in formula (28), about the minimization objective optimization function of t, λ is constant balance factor, and λ ∈ (0,1);
Set up objective optimization function, as formula (29):
V min ( s , &psi; ) ( F ( t ) ) = min ( s , &psi; ) &Sigma; p &Element; W ( t ( p ) - t ^ ( p ) ) 2 = min ( s , &psi; ) &Sigma; p &Element; W ( ( s ( p ) * I ( p ) + &psi; ( p ) - t ( p ) ) 2 + &epsiv; * ( s ( p ) 2 ) ) - - - ( 29 )
Wherein, in formula (29), p represents pixel, s (p) is the change of scale factor of p point, and ψ (p) is the offset component of p point, and I (p) is the gray-scale value of p point in pending image, W is the second size presetting moving window, ε is weight factor, ε > 0 represent the atmospheric propagation coefficient after optimizing, represent the atmospheric propagation coefficient after the optimization of p point, account form as shown in formula (30):
t ^ ( p ) = s ( p ) * I ( p ) + &psi; ( p ) - - - ( 30 )
Formula (31) and formula (32) can be released by formula (29):
s = 1 N &Sigma; p &Element; W I ( p ) t ( p ) - 1 N &mu; &Sigma; p &Element; W t ( p ) &sigma; 2 + &epsiv; - - - ( 31 )
&psi; = 1 N &Sigma; p &Element; W t ( p ) - s * &mu; - - - ( 32 )
Wherein, in formula (31) and formula (32), μ and σ 2be respectively average and the variance of grey scale pixel value in corresponding W window, N is the described second number presetting pixel in moving window;
The result of calculation of formula (31) and formula (32) is substituted in formula (33) and formula (34) and calculates described pending image mid point p change of scale Summing Factor offset component respectively:
s ( p ) = 1 N &Sigma; k &Element; W P s k - - - ( 33 )
&psi; ( p ) = 1 N &Sigma; k &Element; W P &psi; k - - - ( 34 )
Wherein, in formula (33) and formula (34), W pfor comprising the moving window of pixel p, s kfor kth moving window passes through some p by the intermediate result calculated in formula (31), ψ kfor kth moving window passes through some p by the intermediate result calculated in formula (32); S (p) for all window filtering operation complete after the change of scale factor of corresponding pixel points p position, ψ (p) for all window filtering operation complete after the offset component of corresponding pixel points p position;
Described pending image mid point p change of scale Summing Factor offset component formula (33) and formula (34) determined substitutes in formula (30) and calculates first gas propagation coefficient
Above-mentioned processor 3000, also specifically for:
Regulate described first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer;
As a kind of possible embodiment, above-mentioned processor 3000 regulates described first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, is specially:
Introduce weight factor M λ, a described M λ corresponding to M paths coefficient in different depth of field scene;
Described M λ is substituted into formula (35) and calculates described M the second air propagation coefficient:
t * = t ^ &lambda; - - - ( 35 )
Wherein, formula (35), represent the first air propagation coefficient, t *represent the second air propagation coefficient.
Above-mentioned processor 3000, also specifically for:
According to described air light value and described M the second air propagation coefficient, enhancing process is carried out to described pending image, strengthen image to obtain M;
As a kind of possible embodiment, above-mentioned processor 3000 carries out enhancing process according to described air light value and described M the second air propagation coefficient to described pending image, is specially:
Formula (36) R, G, B tri-passages corresponding to described pending image are respectively adopted to carry out enhancing process:
J c ( p ) = 1 t i * ( p ) ( I c ( p ) - A ) + A - - - ( 36 )
Wherein, in formula (11), A is air light value, represent the value of i-th the second air propagation coefficient in described M the second air propagation coefficient at p point, i is the integer being greater than 0 and being less than or equal to M, and c represents R, G, B tri-passages, J cp () is the enhancing image after passage c enhancing process, I cp () is pending image.
Above-mentioned processor 3000, also specifically for:
Adopt preset evaluation index to strengthen image to described M to evaluate, with the result determination target enhance image according to described evaluation.
Terminal described by the embodiment of the present invention determines the brightest area of the predeterminable area size in the gray level image that pending image is corresponding; Air light value is calculated according to described brightest area; The first air propagation coefficient is calculated according to default account form; Regulate described first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer; According to described air light value and described M the second air propagation coefficient, enhancing process is carried out to described pending image, strengthen image to obtain M; Adopt preset evaluation index to strengthen image to described M to evaluate, with the result determination target enhance image according to described evaluation.Adopt the embodiment of the present invention by Gas regulation propagation coefficient, to obtain different enhancing images, by evaluating multiple enhancing image, the good image of image effect is gone out as target enhance image using decision-making, thus, realize finely tuning and obtain good image effect to the image effect of pending image.
The embodiment of the present invention also provides a kind of computer-readable storage medium, and wherein, this computer-readable storage medium can have program stored therein, and comprises the part or all of step of any one signal processing method recorded in said method embodiment when this program performs.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
It should be noted that, for aforesaid each embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not by the restriction of described sequence of movement, because according to the present invention, some step may can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and involved action and module might not be that the present invention is necessary.
In several embodiments that the application provides, should be understood that, disclosed device, the mode by other realizes.Such as, device embodiment described above is only schematic, the division of such as said units, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical or other form.
The above-mentioned unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in various embodiments of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
If above-mentioned integrated unit using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprise all or part of step of some instructions in order to make a computer equipment (can be personal computer, server or the network equipment etc., can be specifically the processor in computer equipment) perform each embodiment said method of the present invention.Wherein, and aforesaid storage medium can comprise: USB flash disk, portable hard drive, magnetic disc, CD, ROM (read-only memory) are (English: Read-OnlyMemory, abbreviation: ROM) or random access memory (English: RandomAccessMemory, abbreviation: RAM) etc. various can be program code stored medium.
The above, above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (12)

1. a method for image procossing, is characterized in that, described method comprises:
Determine the brightest area of the predeterminable area size in the gray level image that pending image is corresponding;
Air light value is calculated according to described brightest area;
The first air propagation coefficient is calculated according to default account form;
Regulate described first air propagation coefficient according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer;
According to described air light value and described M the second air propagation coefficient, enhancing process is carried out to described pending image, strengthen image to obtain M;
Adopt preset evaluation index to strengthen image to described M to evaluate, with the result determination target enhance image according to described evaluation.
2. the method for claim 1, is characterized in that, described pending image is containing mist image, containing haze image, containing at least one in sleet image or iridescent image.
3. the method as described in any one of claim 1 or 2, is characterized in that, the described step according to described brightest area calculating air light value specifically comprises:
Calculate the average of pixel value corresponding to the pixel of described brightest area, described average is air light value.
4. the method as described in any one of claim 1 or 2, is characterized in that, the described step calculating the first air propagation coefficient according to default account form specifically comprises:
According to formula (1) structure contrast function:
F c o n t r a s t ( t ) = - &Sigma; c &Element; G r a y &Sigma; p &Element; B ( I ( p ) - I &OverBar; ) 2 t 2 N B - - - ( 1 )
Wherein, in formula (1), t represents atmospheric propagation coefficient, and c ∈ Gray represents calculate contrast function, F on the gray level image that described pending image is corresponding contrastt () represents the contrast function about t, p represents pixel, and I (p) is the gray-scale value of any point p point in described pending image, represent the average of pixel gray-scale value in moving window B, i.e. the mean flow rate of pixel in described moving window B, described B first presets moving window, N bfor the number of pixel comprised at described moving window B, p ∈ B represents and constructs contrast function for described moving window B;
According to formula (2) tectonic information loss function:
F l o s s ( t ) = &Sigma; c &Element; G r a y { &Sigma; i = 0 &alpha; ( i - A t + A ) 2 h ( i ) + &Sigma; i = &beta; 255 ( i - A t + A - 255 ) h ( i ) } - - - ( 2 )
Wherein, in formula (2), F losst () is about the information loss function of t, α is first threshold, and β is Second Threshold, and α < β, h (i) represents that the pixel number of gray-scale value i accounts for the number percent of total pixel number of pending image, and A is air light value;
Described contrast function and described information loss function are substituted into formula (3) to calculate described atmospheric propagation coefficient t:
V min t F ( t ) = min t ( F c o n t r a s t ( t ) + &lambda;F l o s s ( t ) ) - - - ( 3 )
Wherein, in formula (3), about the minimization objective optimization function of t, λ is constant balance factor, and λ ∈ (0,1);
Set up objective optimization function, as formula (4):
V min ( s , &psi; ) ( F ( t ) ) = min ( s , &psi; ) &Sigma; p &Element; W ( t ( p ) - t ^ ( p ) ) 2 = min ( s , &psi; ) &Sigma; p &Element; W ( ( s ( p ) * I ( p ) + &psi; ( p ) - t ( p ) ) 2 + &epsiv; * ( s ( p ) 2 ) ) - - - ( 4 )
Wherein, in formula (4), p represents pixel, s (p) is the change of scale factor of p point, and ψ (p) is the offset component of p point, and I (p) is the gray-scale value of p point in pending image, W is the second size presetting moving window, ε is weight factor, ε > 0 represent the atmospheric propagation coefficient after optimizing, represent the atmospheric propagation coefficient after the optimization of p point, account form as shown in formula (5):
t ^ ( p ) = s ( p ) * I ( p ) + &psi; ( p ) - - - ( 5 )
Formula (6) and formula (7) can be released by formula (4):
s = 1 N &Sigma; p &Element; W I ( p ) t ( p ) - 1 N &mu; &Sigma; p &Element; W t ( p ) &sigma; 2 + &epsiv; - - - ( 6 )
&psi; = 1 N &Sigma; p &Element; W t ( p ) - s * &mu; - - - ( 7 )
Wherein, in formula (6) and formula (7), μ and σ 2be respectively average and the variance of grey scale pixel value in corresponding W window, N is the described second number presetting pixel in moving window;
The result of calculation of formula (6) and formula (7) is substituted in formula (8) and formula (9) and calculates described pending image mid point p change of scale Summing Factor offset component respectively:
s ( p ) = 1 N &Sigma; k &Element; W P s k - - - ( 8 )
&psi; ( p ) = 1 N &Sigma; k &Element; W P &psi; k - - - ( 9 )
Wherein, in formula (8) and formula (9), W pfor comprising the moving window of pixel p, s kfor kth moving window passes through some p by the intermediate result calculated in formula (6), ψ kfor kth moving window passes through some p by the intermediate result calculated in formula (7); S (p) for all window filtering operation complete after the change of scale factor of corresponding pixel points p position, ψ (p) for all window filtering operation complete after the offset component of corresponding pixel points p position;
Described pending image mid point p change of scale Summing Factor offset component formula (8) and formula (9) determined substitutes in formula (5) and calculates first gas propagation coefficient
5. the method as described in any one of claim 1 or 2, is characterized in that, described according to the described first air propagation coefficient of predetermined manner adjustment, to obtain M the second air propagation coefficient, comprising:
Introduce weight factor M λ, a described M λ corresponding to M paths coefficient in different depth of field scene;
Described M λ is substituted into formula (10) and calculates described M the second air propagation coefficient:
t * = t ^ &lambda; - - - ( 10 )
Wherein, in formula (10), represent the first air propagation coefficient, t *represent the second air propagation coefficient.
6. the method as described in any one of claim 1 or 2, is characterized in that, describedly carries out enhancings process according to described air light value and described M the second air propagation coefficient to described pending image, specifically comprises with the step obtaining M enhancing image:
Formula (11) R, G, B tri-passages corresponding to described pending image are respectively adopted to carry out enhancing process:
J c ( p ) = 1 t i * ( p ) ( I c ( p ) - A ) + A - - - ( 11 )
Wherein, in formula (11), A is air light value, represent the value of i-th the second air propagation coefficient in described M the second air propagation coefficient at p point, i is the integer being greater than 0 and being less than or equal to M, and c represents R, G, B tri-passages, J cp () is the enhancing image after passage c enhancing process, I cp () is described pending image.
7. a terminal, is characterized in that, described terminal comprises:
First determining unit, for determining the brightest area of the predeterminable area size in the gray level image that pending image is corresponding;
First computing unit, calculates air light value for the brightest area determined according to described first determining unit;
Second computing unit, for calculating the first air propagation coefficient according to default account form;
Regulon, for regulating the first air propagation coefficient of calculating of described second computing unit according to predetermined manner, to obtain M the second air propagation coefficient, wherein, M be more than or equal to 1 integer;
Enhancement unit, M the second air propagation coefficient calculated for the air light value that calculates according to described first computing unit and described second computing unit carries out enhancings process to described pending image, to obtain M enhancing image;
Second determining unit, strengthens image for adopting preset evaluation index to M that obtains after described enhancement unit process and evaluates, with the result determination target enhance image according to described evaluation.
8. terminal as claimed in claim 7, is characterized in that, described pending image is containing mist image, containing haze image, containing at least one in sleet image or iridescent image.
9. the terminal as described in any one of claim 7 or 8, is characterized in that, described first computing unit specifically for:
Calculate the average of pixel value corresponding to the pixel of described brightest area, described average is air light value.
10. the terminal as described in any one of claim 7 or 8, is characterized in that, described second computing unit comprises:
First tectonic element, for constructing contrast function according to formula (12):
F c o n t r a s t ( t ) = - &Sigma; c &Element; G r a y &Sigma; p &Element; B ( I ( p ) - I &OverBar; ) 2 t 2 N B - - - ( 12 )
Wherein, in formula (12), t represents atmospheric propagation coefficient, and c ∈ Gray represents calculate contrast function, F on the gray level image that described pending image is corresponding contrastt () represents the contrast function about t, p represents pixel, and I (p) is the gray-scale value of any point p point in described pending image, represent the average of pixel gray-scale value in moving window B, i.e. the mean flow rate of pixel in described moving window B, described B first presets moving window, N bfor the number of pixel comprised at described moving window B, p ∈ B represents and constructs contrast function for described moving window B;
Second tectonic element, for according to formula (13) tectonic information loss function:
F l o s s ( t ) = &Sigma; c &Element; G r a y { &Sigma; i = 0 &alpha; ( i - A t + A ) 2 h ( i ) + &Sigma; i = &beta; 255 ( i - A t + A - 255 ) h ( i ) } - - - ( 13 )
Wherein, in formula (13), F losst () is about the information loss function of t, α is first threshold, and β is Second Threshold, and α < β, h (i) represents that the pixel number of gray-scale value i accounts for the number percent of total pixel number of pending image, and A is air light value;
First computation subunit, for described contrast function and described information loss function are substituted into formula (14) to calculate described atmospheric propagation coefficient t:
V min t F ( t ) = min t ( F c o n t r a s t ( t ) + &lambda;F l o s s ( t ) ) - - - ( 14 )
Wherein, in formula (14), about the minimization objective optimization function of t, λ is constant balance factor, and λ ∈ (0,1);
Set up objective optimization function, as formula (15):
V min ( s , &psi; ) ( F ( t ) ) = min ( s , &psi; ) &Sigma; p &Element; W ( t ( p ) - t ^ ( p ) ) 2 = min ( s , &psi; ) &Sigma; p &Element; W ( ( s ( p ) * I ( p ) + &psi; ( p ) - t ( p ) ) 2 + &epsiv; * ( s ( p ) 2 ) ) - - - ( 15 )
Wherein, in formula (15), p represents pixel, s (p) is the change of scale factor of p point, and ψ (p) is the offset component of p point, and I (p) is the gray-scale value of p point in pending image, W is the second size presetting moving window, ε is weight factor, ε > 0 represent the atmospheric propagation coefficient after optimizing, represent the atmospheric propagation coefficient after the optimization of p point, account form as shown in formula (16):
t ^ ( p ) = s ( p ) * I ( p ) + &psi; ( p ) - - - ( 16 )
Formula (17) and formula (18) can be released by formula (15):
s = 1 N &Sigma; p &Element; W I ( p ) t ( p ) - 1 N &mu; &Sigma; p &Element; W t ( p ) &sigma; 2 + &epsiv; - - - ( 17 )
&psi; = 1 N &Sigma; p &Element; W t ( p ) - s * &mu; - - - ( 18 )
Wherein, in formula (17) and formula (18), μ and σ 2be respectively average and the variance of grey scale pixel value in corresponding W window, N is the described second number presetting pixel in moving window;
Second computation subunit, calculates described pending image mid point p change of scale Summing Factor offset component respectively for the result of calculation of formula (17) and formula (18) being substituted in formula (19) and formula (20):
s ( p ) = 1 N &Sigma; k &Element; W P s k - - - ( 19 )
&psi; ( p ) = 1 N &Sigma; k &Element; W P &psi; k - - - ( 20 )
Wherein, in formula (19) and formula (20), W pfor comprising the moving window of pixel p, s kfor kth moving window passes through some p by the intermediate result calculated in formula (17), ψ kfor kth moving window passes through some p by the intermediate result calculated in formula (18); S (p) for all window filtering operation complete after the change of scale factor of corresponding pixel points p position, ψ (p) for all window filtering operation complete after the offset component of corresponding pixel points p position;
3rd computation subunit, the described pending image mid point p change of scale Summing Factor offset component for formula (19) and formula (20) being determined substitutes in formula (16) and calculates first gas propagation coefficient
11. terminals as described in any one of claim 7 or 8, it is characterized in that, described regulon comprises:
Introduce unit, for introducing weight factor M λ, a described M λ corresponds to M paths coefficient in different depth of field scene;
3rd computing unit, calculates described M the second air propagation coefficient for described M λ being substituted into formula (21):
t * = t ^ &lambda; - - - ( 21 )
Wherein, formula (21), represent the first air propagation coefficient, t *represent the second air propagation coefficient.
12. terminals as described in any one of claim 7 or 8, is characterized in that, described enhancement unit specifically for:
Formula (22) R, G, B tri-passages corresponding to described pending image are respectively adopted to carry out enhancing process:
J c ( p ) = 1 t i * ( p ) ( I c ( p ) - A ) + A - - - ( 22 )
Wherein, in formula (22), A is air light value, represent the value of i-th the second air propagation coefficient in described M the second air propagation coefficient at p point, i is the integer being greater than 0 and being less than or equal to M, and c represents R, G, B tri-passages, J cp () is the enhancing image after passage c enhancing process, I cp () is described pending image.
CN201510896282.2A 2015-12-07 2015-12-07 Method and terminal for processing image Pending CN105513024A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510896282.2A CN105513024A (en) 2015-12-07 2015-12-07 Method and terminal for processing image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510896282.2A CN105513024A (en) 2015-12-07 2015-12-07 Method and terminal for processing image

Publications (1)

Publication Number Publication Date
CN105513024A true CN105513024A (en) 2016-04-20

Family

ID=55720982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510896282.2A Pending CN105513024A (en) 2015-12-07 2015-12-07 Method and terminal for processing image

Country Status (1)

Country Link
CN (1) CN105513024A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021653A (en) * 2017-12-01 2018-05-11 湖州师范学院 A kind of data screening method of safety defense monitoring system
CN108447037A (en) * 2018-03-26 2018-08-24 上海顺久电子科技有限公司 A kind of method and apparatus of dynamic range of images enhancing
CN109949250A (en) * 2019-03-29 2019-06-28 北京奇艺世纪科技有限公司 A kind of image processing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102938136A (en) * 2012-07-19 2013-02-20 中国人民解放军国防科学技术大学 Method for defogging single images based on Bayer formats rapidly
CN103413305A (en) * 2013-08-01 2013-11-27 北京航空航天大学 Single-image rapid defogging method and device and image processing system
CN104200445A (en) * 2014-09-26 2014-12-10 常熟理工学院 Image defogging method with optimal contrast ratio and minimal information loss
CN104318535A (en) * 2014-11-20 2015-01-28 广东欧珀移动通信有限公司 Image defogging method and device and mobile terminal
CN104331867A (en) * 2014-11-06 2015-02-04 广东欧珀移动通信有限公司 Image defogging method and device and mobile terminal
CN104766307A (en) * 2015-03-13 2015-07-08 青岛海信电器股份有限公司 Picture processing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102938136A (en) * 2012-07-19 2013-02-20 中国人民解放军国防科学技术大学 Method for defogging single images based on Bayer formats rapidly
CN103413305A (en) * 2013-08-01 2013-11-27 北京航空航天大学 Single-image rapid defogging method and device and image processing system
CN104200445A (en) * 2014-09-26 2014-12-10 常熟理工学院 Image defogging method with optimal contrast ratio and minimal information loss
CN104331867A (en) * 2014-11-06 2015-02-04 广东欧珀移动通信有限公司 Image defogging method and device and mobile terminal
CN104318535A (en) * 2014-11-20 2015-01-28 广东欧珀移动通信有限公司 Image defogging method and device and mobile terminal
CN104766307A (en) * 2015-03-13 2015-07-08 青岛海信电器股份有限公司 Picture processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
KAIMING HE ET AL.: "Single Image Haze Removal Using Dark Channel Prior", 《IEEE TRANSACTIONS ON PATTERN ANALYSIS & MACHINE INTELLIGENCE》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021653A (en) * 2017-12-01 2018-05-11 湖州师范学院 A kind of data screening method of safety defense monitoring system
CN108021653B (en) * 2017-12-01 2021-08-03 湖州师范学院 Data screening method of security monitoring system
CN108447037A (en) * 2018-03-26 2018-08-24 上海顺久电子科技有限公司 A kind of method and apparatus of dynamic range of images enhancing
CN108447037B (en) * 2018-03-26 2022-02-18 上海顺久电子科技有限公司 Method and device for enhancing dynamic range of image
CN109949250A (en) * 2019-03-29 2019-06-28 北京奇艺世纪科技有限公司 A kind of image processing method and device
CN109949250B (en) * 2019-03-29 2021-05-18 北京奇艺世纪科技有限公司 Image processing method and device

Similar Documents

Publication Publication Date Title
CN109712083B (en) Single image defogging method based on convolutional neural network
CN106910175B (en) Single image defogging algorithm based on deep learning
CN103198459B (en) Haze image rapid haze removal method
CN103150708B (en) Based on the image Quick demisting optimization method of black channel
CN103279931B (en) Mist elimination image denoising method based on absorbance
CN105513024A (en) Method and terminal for processing image
US8023760B1 (en) System and method for enhancing low-visibility imagery
CN110838131B (en) Method and device for realizing automatic cutout, electronic equipment and medium
CN102663694A (en) Digital fog effect filter method based on dark primary color channel prior principle
CN101883209B (en) Method for integrating background model and three-frame difference to detect video background
CN105913390B (en) A kind of image defogging method and system
CN110349093B (en) Single image defogging model construction and defogging method based on multi-stage hourglass structure
CN107527329A (en) A kind of image defogging method based on dark channel prior and Markov random field
CN103578083A (en) Single image defogging method based on joint mean shift
CN105447825A (en) Image defogging method and system
CN104346783A (en) Processing method and processing device for defogging image
CN104331867A (en) Image defogging method and device and mobile terminal
Qian et al. CIASM-Net: a novel convolutional neural network for dehazing image
CN104318528A (en) Foggy weather image restoration method based on multi-scale WLS filtering
CN110766640B (en) Image defogging method based on depth semantic segmentation
CN113393468A (en) Image processing method, model training device and electronic equipment
CN107085830B (en) Single image defogging method based on propagation filtering
CN111598793A (en) Method and system for defogging image of power transmission line and storage medium
CN103020908B (en) The method and apparatus of image noise reduction
CN113177898A (en) Image defogging method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160420