CN106097286A - A kind of method and device of image procossing - Google Patents

A kind of method and device of image procossing Download PDF

Info

Publication number
CN106097286A
CN106097286A CN201610456890.6A CN201610456890A CN106097286A CN 106097286 A CN106097286 A CN 106097286A CN 201610456890 A CN201610456890 A CN 201610456890A CN 106097286 A CN106097286 A CN 106097286A
Authority
CN
China
Prior art keywords
target area
gray level
value
statistical probability
probability value
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.)
Granted
Application number
CN201610456890.6A
Other languages
Chinese (zh)
Other versions
CN106097286B (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201610456890.6A priority Critical patent/CN106097286B/en
Publication of CN106097286A publication Critical patent/CN106097286A/en
Priority to PCT/CN2017/089192 priority patent/WO2017219962A1/en
Priority to EP17814700.5A priority patent/EP3459043A4/en
Priority to US16/219,907 priority patent/US11094045B2/en
Application granted granted Critical
Publication of CN106097286B publication Critical patent/CN106097286B/en
Priority to US17/342,695 priority patent/US20210295480A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

The present invention relates to image processing field, particularly to a kind of image processing method and device, use histogram equalization to carry out the most inflexible problem of method of image procossing present in prior art in order to solving.The embodiment of the present invention, according to accumulation histogram corresponding to the target area of image, determines the statistical probability value that in 1 gray level of N in addition to maximum gray scale, each gray level is corresponding;Determine the optimized coefficients that each statistical probability value is corresponding, and according to each optimized coefficients, generate the Optimal Curve that optimized coefficients is corresponding;According to the adjustment curve that each gray level in each the Optimal Curve generated, and 1 gray level of N in addition to maximum gray scale preset is corresponding, determine the mapping curve that target area is corresponding;And according to mapping curve, the pixel value of pixel is adjusted.The image of the embodiment of the present invention individually can process for each target area, so that the method for image procossing is the most flexible.

Description

A kind of method and device of image procossing
Technical field
The present invention relates to technical field of image processing, particularly to a kind of image processing method and device.
Background technology
At present, when by video camera or collected by camera picture, owing to photographed scene is different, different image effects can be obtained Really.Such as, the scene that illumination condition is good shoots picture, it is possible to obtain preferably image effect;But at strong backlight, by force Shooting picture in the scenes such as frontlighting, the image often taken is got confused, or partially dark, and details is the abundantest, image entirety permeability Not.
At present, the method for most commonly seen raising picture contrast is histogram equalization.Wherein, histogram equalization is Refer to make input picture be converted to the output figure having approximately uniform pixel number in each gray level by grey scale mapping Picture, the grey level histogram i.e. exported is uniform.The method using histogram equalization to process image includes:
1, the gray scale normalization rectangular histogram of statistical picture, acquisition probability density function p (x), wherein 0≤x≤1;
2, the cumulative distribution function of calculating image:
f ( r ) = ∫ 0 r p r ( μ ) d μ ;
3, histogram equalization conversion formula:
Wherein DBFor the pixel value after conversion, DABefore conversion Pixel value.
In the image obtained after processing through the method for above-mentioned histogram equalization, pixel will be occupied as much as possible Gray level and being evenly distributed.But during the method using histogram equalization processes image, if the position of this image A width of n, the gray level number of the most described image is 2n;When the gray scale normalization rectangular histogram of statistical picture, need to add up 2nIndividual ash The rectangular histogram of degree level, further according to 2nThe histogram calculation accumulation histogram of individual gray level so that amount of calculation is bigger.
In sum, the current method using histogram equalization to carry out image procossing is complex.
Summary of the invention
The present invention provides a kind of image processing method and device, uses rectangular histogram equal present in prior art in order to solving Weighing apparatusization carries out the problem that the method for image procossing is complex.
A kind of image processing method is provided based on the problems referred to above embodiment of the present invention, including:
The accumulation histogram that target area according to image is corresponding, determines N-1 gray level in addition to maximum gray scale In statistical probability value corresponding to each gray level, wherein, described N is the gray level number of described accumulation histogram, and described N is Positive integer more than 1, and described N is less than the gray level number of described image;
Determine the optimized coefficients that each statistical probability value described is corresponding, and according to each optimized coefficients described, generate The Optimal Curve that described optimized coefficients is corresponding;
According to every in each the Optimal Curve generated, and N-1 the gray level in addition to maximum gray scale preset The adjustment curve that one gray level is corresponding, determines the mapping curve that described target area is corresponding;
Determine the pixel needing to carry out processing in described target area, and according to described mapping curve to described pixel Pixel value be adjusted.
When needing the target area processed to process in image due to the embodiment of the present invention, determine target area The accumulation histogram that gray level number is N that territory is corresponding, wherein N is far smaller than the gray level number 2 of imagen, n is the position of image Width, owing to needing to add up the accumulation histogram of little gray level number, thus amount of calculation when reducing image procossing, thus simplify The method of image procossing.
Optionally, the described optimized coefficients determining that each statistical probability value described is corresponding, including:
According to the gray level that each statistical probability value is corresponding, determine corresponding the most excellent of each statistical probability value described Change coefficient;
According to the central pixel point of described target area, determine the optimized coefficients that each initial optimization coefficient is corresponding.
Owing to the embodiment of the present invention is after determining the initial optimization coefficient that gray level is corresponding, need initial optimization coefficient is entered Row limits, and obtains the optimized coefficients that gray level is corresponding, when carrying out image procossing according to optimized coefficients, it is possible to Reasonable adjustment image The contrast of regional.
Optionally, the described gray level corresponding according to each statistical probability value, determine each statistical probability value described Corresponding initial optimization coefficient, including:
For any one statistical probability value, according to the gray level that described statistical probability value is corresponding, determine that described statistics is general The span that rate value is corresponding;
According to the maximum in described span and minima, described statistical probability value is adjusted;And according to tune Statistical probability value after whole, determines the initial optimization coefficient that described statistical probability value is corresponding.
Owing to the embodiment of the present invention can adaptively determine statistical probability value according to gray level corresponding to statistical probability value Corresponding span, and according to the maximum in span and minima, reasonably statistical probability value is adjusted, root Determine initial optimization coefficient according to the statistical probability value after adjusting, thus be calculated the initial optimization coefficient of optimum, make image Effect reaches optimum.
Optionally, the span of statistical probability value corresponding to described gray level be determined according to the following equation:
Max=bin+k1
Min=bin+k2
Wherein, max is the maximum in described span, and min is the minima in described span, and 0 < Min < max < 1;Bin is the Normalized Grey Level level that described statistical probability value is corresponding, and bin more than or equal to 0 and is less than or equal to 1;k1> k2
According to following equation, described statistical probability value is adjusted:
Py'=min+ (max-min) × Py
Wherein, PyFor described statistical probability value, Py' it is the statistical probability value after adjusting, max is in described span Maximum, min is the minima in described span;
Initial optimization coefficient that described statistical probability value corresponding be determined according to the following equation:
A=log (p 'y)/log(bin);
Wherein, A is initial optimization coefficient, Py' it is the statistical probability value after adjusting, bin is that described statistical probability value is corresponding Normalized Grey Level level, and bin is more than or equal to 0 and less than or equal to 1.
Owing to embodiments providing the formula of span corresponding to concrete counting statistics probit, to statistics The formula that probit is adjusted, and determine the formula of initial optimization coefficient corresponding to statistical probability value, thus obtain accurately Initial optimization coefficient, the treatment effect making image is optimal.
Optionally, the described central pixel point according to described target area, determine that each initial optimization coefficient is corresponding Optimized coefficients, including:
For any one initial optimization coefficient, if gray level corresponding to described initial optimization coefficient is less than first threshold, Then according to the pixel value of the central pixel point of described target area, and the pixel of neighboring area corresponding to described central pixel point The pixel value of point, determines the optimized coefficients that described initial optimization coefficient is corresponding;Wherein, described neighboring area is with described middle imago Region centered by vegetarian refreshments;
For any one initial optimization coefficient, if gray level corresponding to described initial optimization coefficient is not less than the first threshold Value, then according to the pixel value of the central pixel point of described target area, determine the optimized coefficients that described initial optimization coefficient is corresponding.
Owing to the embodiment of the present invention is when determining optimized coefficients according to initial optimization coefficient, according to the scope of gray level not With, it is provided that the mode of different determination optimized coefficients.When gray level is less than first threshold, according to the pixel of central pixel point Value, and the pixel value of the pixel of neighboring area corresponding to central pixel point, determine the optimization system that initial optimization coefficient is corresponding Number, thus improve the contrast of the low bright part of image;When gray level is not less than first threshold, according to according to central pixel point Pixel value determines the optimized coefficients that initial optimization coefficient is corresponding, thus effectively suppression highlight regions excessively strengthens.
Optionally, when the gray level that described initial optimization coefficient is corresponding is less than first threshold, it is determined according to the following equation The optimized coefficients that described initial optimization coefficient is corresponding:
A '=A × m;
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;M is described week The ratio of the pixel value of the central pixel point of the meansigma methods of the pixel value of all pixels and described target area in edge regions;
When gray level corresponding to described initial optimization coefficient is not less than first threshold, be determined according to the following equation described at the beginning of The optimized coefficients that beginning optimized coefficients is corresponding:
A '=A × (1+pix_value);
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;pix_value For the pixel value of the central pixel point of the described target area after normalized, and pix_value more than or equal to 0 and is less than Equal to 1.
Owing to the embodiment of the present invention is according to different grey-scale scope, it is provided that different determination initial optimization coefficients is corresponding The formula of optimized coefficients, thus according to the formula provided, when different grey level range, all can accurately determine optimized coefficients.
Optionally, described according to each the Optimal Curve generated, and the N-1 in addition to maximum gray scale preset The adjustment curve that in gray level, each gray level is corresponding, determines the mapping curve that described target area is corresponding, including:
The Optimal Curve corresponding according to same gray level and adjustment curve, determine the son mapping song that described gray level is corresponding Line;
According to the sub-mapping curve that each gray level in N-1 gray level in addition to maximum gray scale is corresponding, determine The mapping curve that described target area is corresponding.
Optionally, determine, according to following manner, the mapping curve that described target area is corresponding:
Yout=G1(Yin)×B1(Yin)+G2(Yin)×B2(Yin)+……+GN-1(Yin)×BN-1(Yin);
Wherein, G1、G2……GN-1For described Optimal Curve, B1、B2……BN-1For described adjustment curve, YoutFor output picture Element value, YinFor input pixel value;Further, at B1、B2……BN-1Input value identical time, B1、B2……BN-1Output valve sum is 1。
Owing to embodiments providing according to Optimal Curve and adjusting curve, determine the mapping song that target area is corresponding The concrete grammar of line, thus according to the mapping curve determined, the pixel value of target area is adjusted to target area Pixel value process time obtain optimal effect.
Optionally, if target area corresponding to described image is one, the most described target area is described image;
If the target area that described image is corresponding is multiple, the number of the most described target area is pixel in described image Number, and the central pixel point that each pixel is a target area in described image.
Owing to the embodiment of the present invention is when processing image, using whole image as target area, or can incite somebody to action Image division is multiple target area;When being multiple in the target area of image, each pixel in image corresponding one Individual target area, and the central pixel point of the target area that pixel is its correspondence, embodiments provide flexibly The method carrying out image procossing.
Optionally, if target area corresponding to described image is multiple, it is positioned at described figure in the subregion of target area During picture outside, according to the pixel in the region being positioned in described target area within described image, determine described target area In be positioned at the pixel of subregion of described picture appearance.
Owing to the embodiment of the present invention is multiple in the target area of image, if the subregion of target area is positioned at outside image Portion, then carry out supplement process by this target area.When carrying out the supplement of target area, according in target area in the picture The pixel of subregion, determines the pixel in the region of picture appearance in this target area, thus ensures in target area The pixel value of pixel be closer to so that more accurate when the central pixel point of this target area is processed.
Optionally, described determine the pixel needing to carry out processing in described target area, including:
If the target area that described image is corresponding is one, the most described target area need the pixel carrying out processing be All pixels in described target area;
If the target area that described image is corresponding is multiple, the most described target area need the pixel carrying out processing be The central pixel point of described target area.
Owing to the embodiment of the present invention is when processing image, can be using whole image as target area, and to figure Each pixel in Xiang processes;Or be multiple target area by whole image division, and to each target area The central pixel point in territory processes, so that the method for image procossing is more flexible.
On the other hand, the embodiment of the present invention also provides for the device of a kind of image procossing, including:
Acquisition module, for the accumulation histogram corresponding according to the target area of image, determines in addition to maximum gray scale N-1 gray level in statistical probability value corresponding to each gray level, wherein, described N is the gray scale of described accumulation histogram Level number, described N is the positive integer more than 1, and described N is less than the gray level number of described image;
Determine module, for determining the optimized coefficients that each statistical probability value described is corresponding, and according to described each Optimized coefficients, generates the Optimal Curve that described optimized coefficients is corresponding;
Control module, for each the Optimal Curve according to generation, and the N-1 in addition to maximum gray scale preset The adjustment curve that in individual gray level, each gray level is corresponding, determines the mapping curve that described target area is corresponding;
Processing module, for determining the pixel needing to carry out processing in described target area, and maps song according to described The pixel value of described pixel is adjusted by line.
Optionally, described determine module, specifically for:
According to the gray level that each statistical probability value is corresponding, determine corresponding the most excellent of each statistical probability value described Change coefficient;According to the central pixel point of described target area, determine the optimized coefficients that each initial optimization coefficient is corresponding.
Optionally, described determine module, specifically for:
For any one statistical probability value, according to the gray level that described statistical probability value is corresponding, determine that described statistics is general The span that rate value is corresponding;According to the maximum in described span and minima, described statistical probability value is adjusted Whole;And according to the statistical probability value after adjusting, determine the initial optimization coefficient that described statistical probability value is corresponding.
Optionally, described determine module, specifically for:
The span of statistical probability value corresponding to described gray level be determined according to the following equation:
Max=bin+k1
Min=bin+k2
Wherein, max is the maximum in described span, and min is the minima in described span, and 0 < Min < max < 1;Bin is the Normalized Grey Level level that described statistical probability value is corresponding, and bin more than or equal to 0 and is less than or equal to 1;k1> k2
According to following equation, described statistical probability value is adjusted:
Py'=min+ (max-min) × Py
Wherein, PyFor described statistical probability value, Py' it is the statistical probability value after adjusting, max is in described span Maximum, min is the minima in described span;
Initial optimization coefficient that described statistical probability value corresponding be determined according to the following equation:
A=log (p 'y)/log(bin);
Wherein, A is initial optimization coefficient, Py' it is the statistical probability value after adjusting, bin is that described statistical probability value is corresponding Normalized Grey Level level, and bin is more than or equal to 0 and less than or equal to 1.
Optionally, described determine module, specifically for:
For any one initial optimization coefficient, if gray level corresponding to described initial optimization coefficient is less than first threshold, Then according to the pixel value of the central pixel point of described target area, and the pixel of neighboring area corresponding to described central pixel point The pixel value of point, determines the optimized coefficients that described initial optimization coefficient is corresponding;Wherein, described neighboring area is with described middle imago Region centered by vegetarian refreshments;
For any one initial optimization coefficient, if gray level corresponding to described initial optimization coefficient is not less than the first threshold Value, then according to the pixel value of the central pixel point of described target area, determine the optimized coefficients that described initial optimization coefficient is corresponding.
Optionally, described determine module, specifically for:
When gray level corresponding to described initial optimization coefficient is less than first threshold, be determined according to the following equation described initially The optimized coefficients that optimized coefficients is corresponding:
A '=A × m;
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;M is described week The ratio of the pixel value of the central pixel point of the meansigma methods of the pixel value of all pixels and described target area in edge regions;
When gray level corresponding to described initial optimization coefficient is not less than first threshold, be determined according to the following equation described at the beginning of The optimized coefficients that beginning optimized coefficients is corresponding:
A '=A × (1+pix_value);
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;pix_value For the pixel value of the central pixel point of the described target area after normalized, and pix_value more than or equal to 0 and is less than Equal to 1.
Optionally, described control module, specifically for:
The Optimal Curve corresponding according to same gray level and adjustment curve, determine the son mapping song that described gray level is corresponding Line;According to the sub-mapping curve that each gray level in N-1 gray level in addition to maximum gray scale is corresponding, determine described mesh The mapping curve that mark region is corresponding.
Optionally, described control module, specifically for:
The mapping curve that described target area is corresponding is determined according to following manner:
Yout=G1(Yin)×B1(Yin)+G2(Yin)×B2(Yin)+……+GN-1(Yin)×BN-1(Yin);
Wherein, G1、G2……GN-1For described Optimal Curve, B1、B2……BN-1For described adjustment curve, YoutFor output picture Element value, YinFor input pixel value;Further, at B1、B2……BN-1Input value identical time, B1、B2……BN-1Output valve sum is 1。
Optionally, if target area corresponding to described image is one, the most described target area is described image;
If the target area that described image is corresponding is multiple, the number of the most described target area is pixel in described image Number, and the central pixel point that each pixel is a target area in described image.
Optionally, described acquisition module, it is additionally operable to:
If the target area that described image is corresponding is multiple, it is positioned at the outside of described image in the subregion of target area Time, according to the pixel in the region being positioned in described target area within described image, determine and described target area is positioned at institute State the pixel of the subregion of picture appearance.
Optionally, described processing module, specifically for:
If the target area that described image is corresponding is one, the most described target area need the pixel carrying out processing be All pixels in described target area;
If the target area that described image is corresponding is multiple, the most described target area need the pixel carrying out processing be The central pixel point of described target area.
Accompanying drawing explanation
Fig. 1 is the flow chart of the method for embodiment of the present invention image procossing;
Fig. 2 is the flow chart of the image processing method corresponding when being one in the target area of embodiment of the present invention image;
Fig. 3 A-Fig. 3 E is that the embodiment of the present invention carries out mending the structural representation of image when limit processes to image;
Fig. 4 A-4D is the method schematic diagram that the embodiment of the present invention carries out mending limit to target area;
Fig. 5 is the target area of embodiment of the present invention image flow process of the image processing method of target area when being multiple Figure;
Fig. 6 is the target area of embodiment of the present invention image bulk flow of the image processing method of target area when being multiple Cheng Tu;
Fig. 7 is the optimization gamma figure of the specific embodiment of the invention;
Fig. 8 is the Gauss weighting curve figure of the specific embodiment of the invention;
Fig. 9 is the mapping curve figure of the specific embodiment of the invention;
Figure 10 is the structural representation of the device of embodiment of the present invention image procossing.
Detailed description of the invention
The embodiment of the present invention, according to accumulation histogram corresponding to the target area of image, determines in addition to maximum gray scale The statistical probability value that in N-1 gray level, each gray level is corresponding, wherein, described N is the gray level of described accumulation histogram Number, described N is the positive integer more than 1, and described N is less than the gray level number of described image;Determine each system described The optimized coefficients that meter probit is corresponding, and according to each optimized coefficients described, generate optimization corresponding to described optimized coefficients bent Line;According to each ash in each the Optimal Curve generated, and N-1 the gray level in addition to maximum gray scale preset The adjustment curve that degree level is corresponding, determines the mapping curve that described target area is corresponding;Determine and described target area needs carry out The pixel processed, and according to described mapping curve, the pixel value of described pixel is adjusted.
When needing the target area processed to process in image due to the embodiment of the present invention, determine target area The accumulation histogram that gray level number is N that territory is corresponding, wherein N is far smaller than the gray level number 2 of imagen, n is the position of image Width, owing to needing to add up the accumulation histogram of little gray level number, thus amount of calculation when reducing image procossing, thus simplify The method of image procossing.
The embodiment of the present invention, before processing image, needs RGB image is converted into gray-scale map.And target area Accumulation histogram corresponding to territory is added up on the basis of gray-scale map and is obtained.
Wherein, the gray level of the embodiment of the present invention refers to the gray level after normalized, gray level in the range of [0, 1], gray level is 0 to represent black, and gray level is that 1 representative is white.
The embodiment of the present invention is according to gray level number set in advance, and needs the gray level of statistics, it may be determined that go out The accumulation histogram that target area is corresponding.Accumulation histogram be grey level histogram accumulation and.For a gray level, accumulation is straight Side's figure represents the number of the pixel being not more than this gray level in target area, is not more than the institute of this gray level in reflection target area Having the probability that gray level occurs, the abscissa of accumulation histogram is gray level, and vertical coordinate is no more than all ashes of this gray level The statistical probability value (being i.e. not more than pixel and the ratio of all pixels in target area of this gray level) that degree level is corresponding.
In order to make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing the present invention made into One step ground describes in detail, it is clear that described embodiment is only some embodiments of the present invention rather than whole enforcement Example.Based on the embodiment in the present invention, those of ordinary skill in the art are obtained under not making creative work premise All other embodiments, broadly fall into the scope of protection of the invention.
As it is shown in figure 1, the method for embodiment of the present invention image procossing, including:
Step 101, according to accumulation histogram corresponding to the target area of image, determine the N-1 in addition to maximum gray scale The statistical probability value that in individual gray level, each gray level is corresponding, wherein, described N is the gray level of described accumulation histogram Number, described N is the positive integer more than 1, and described N is less than the gray level number of described image;
Step 102, determine the optimized coefficients that each statistical probability value described is corresponding, and according to described each optimize system Number, generates the Optimal Curve that described optimized coefficients is corresponding;
Step 103, according to each the Optimal Curve generated, and N-1 in addition to maximum gray scale preset is grey The adjustment curve that in degree level, each gray level is corresponding, determines the mapping curve that described target area is corresponding;
Step 104, determine the pixel needing to carry out processing in described target area, and according to described mapping curve to institute The pixel value stating pixel is adjusted.
The number of pixels that statistical probability value is no more than this gray level of the embodiment of the present invention and all pictures in target area The ratio of element number.For any one gray level, the embodiment of the present invention when determining statistical probability value corresponding to this gray level, Determine that in target area, gray level is not more than the number of pixels of this gray level, number of pixels and the target of this gray level will be not more than In region, the ratio of all number of pixels is as statistical probability value corresponding to this gray level.
Such as, when determining the statistical probability value of gray level 0.5 correspondence, determine that in target area, gray level is not more than 0.5 Number of pixels be A, and in target area, all of number of pixels is B, then statistical probability value P=A/ of gray level 0.5 correspondence B。
It should be noted that the embodiment of the present invention is when determining the accumulation histogram of target area, if the bit wide of image For n, then the gray level number of this image is 2n, gray level number N presetting accumulation histogram is far smaller than 2n, thus greatly Reduce greatly the amount of calculation during accumulation histogram determining target area.
The target area that embodiment of the present invention image is corresponding can be one or be multiple.
When the target area that image is corresponding is one, the most described target area is described image;At the mesh that image is corresponding Mark region is when being multiple, and the number of the most described target area is in described image in the number of pixel, and described image Each pixel is the central pixel point of a target area.
Below according to the number of the target area of image, the method for image procossing is illustrated respectively.
One, the target area that image is corresponding is one.
When the target area that the image of the embodiment of the present invention is corresponding is one, then using this image as target area.
As in figure 2 it is shown, when the target area that image is corresponding is one, the method processing image includes:
Step 201, convert the image into gray-scale map, and determine the accumulation histogram of this gray-scale map, wherein, accumulation histogram Gray level number be N.
Step 202, according to accumulation histogram corresponding to image, determine in N-1 gray level in addition to maximum gray scale The statistical probability value that each gray level is corresponding.
Concrete, according to the accumulation histogram that image is corresponding, determine in N-1 gray level in addition to maximum gray scale every The method that statistical probability value corresponding to one gray level uses is same as the prior art, and concrete method is the most superfluous at this State.
Such as, when determining accumulation histogram corresponding to image, the gray level number set as 4, respectively 0.25,0.5, 0.75、1;Then need to determine the statistical probability value of gray level 0.25 correspondence, the statistical probability of 0.5 correspondence according to accumulation histogram Value and the statistical probability value of 0.75 correspondence.
Step 203, determine the optimized coefficients that each statistical probability value is corresponding.
When determining optimized coefficients corresponding to statistical probability value, optionally, according to the ash that each statistical probability value is corresponding Degree level, determines the initial optimization coefficient that each statistical probability value described is corresponding;According to the central pixel point of described image, determine The optimized coefficients that each initial optimization coefficient is corresponding.
Wherein, first this step determines the initial optimization coefficient that statistical probability value is corresponding, it is then determined that initial optimization system The optimized coefficients that number is corresponding.It is divided into two aspects below to illustrate.
First aspect, for any one statistical probability value, describe in detail and determine the initial optimization that statistical probability value is corresponding The step of coefficient.
A, according to gray level corresponding to statistical probability value, determine the span of statistical probability value corresponding to gray level;
B, according to the maximum in span and minima, described statistical probability value is adjusted;And according to adjustment After statistical probability value, determine the initial optimization coefficient that described statistical probability value is corresponding.
Owing to the embodiment of the present invention is when determining accumulation histogram corresponding to image, the gray level that accumulation histogram is corresponding Number is N, and when the bit wide of image is n, N is far smaller than 2n.The minimizing of accumulation histogram gray level can reduce amount of calculation, but Also bring along adverse effect.Such as, piece image entirety is partially dark, and pixel value concentrates on low bright area, minimum in N number of gray level Statistical probability value corresponding to gray level is close to 1, and image is processed by the statistical probability value directly using gray level corresponding, The pixel of low bright area can be caused eventually excessively to strengthen, the not mild phenomenon of significantly height bright area transition occurs.Therefore, in basis After accumulation histogram determines the statistical probability value that this gray level is corresponding, in addition it is also necessary to the statistical probability value obtained is adjusted.
Concrete adjustment process is:
Determine the span of statistical probability value corresponding to gray level;According to the maximum in span and minima, Described statistical probability value is adjusted.
Wherein it is determined that the mode of the span of statistical probability value corresponding to gray level includes but not limited to:
Mode one, pre-set the span of statistical probability value corresponding to each gray level.
The embodiment of the present invention can use the span pre-setting statistical probability value corresponding to each gray level Mode, which is artificial setting.
Such as, the gray level number of the accumulation histogram set as 4, and respectively 0.25,0.5,0.75,1, determine ash The statistical probability value of degree level 0.25 correspondence is Pys, determine that the statistical probability value of gray level 0.5 correspondence is Pym, determine gray level The statistical probability value of 0.75 correspondence is Pyh.The span of the statistical probability value of gray level 0.25 correspondence pre-set is [0.01,0.35];The span of the statistical probability value of gray level 0.5 correspondence pre-set is [0.35,0.65];Set in advance The span of the statistical probability value of gray level 0.75 correspondence put is [0.65,0.95];To Pys、Pym、PyhIt is adjusted Time, according to the span of statistical probability value corresponding to each gray level pre-set, to Pys、Pym、PyhIt is adjusted.
Mode two, self adaptation determine the span of statistical probability value corresponding to each gray level.
The embodiment of the present invention adaptive can determine statistical probability value corresponding to gray level according to different gray levels Span.
Concrete, when the adaptive span determining statistical probability value corresponding to gray level, need according to this ash Degree level, and empirical coefficient corresponding to this gray level be determined.
In enforcement, following equation self adaptation is used to determine the span of statistical probability value corresponding to gray level:
Max=bin+k1... formula one;
Min=bin+k2... formula two;
Wherein, max is the maximum in described span, and min is the minima in described span;And 0 < Min < max < 1;Bin is the Normalized Grey Level level that described statistical probability value is corresponding, and bin more than or equal to 0 and is less than or equal to 1;k1> k2
It addition, the k in above-mentioned formula one and formula two1、k2For empirical coefficient, each gray level correspondence is identical or different K1、k2
It should be noted that above-mentioned two kinds be given determine the mode of the span of statistical probability value corresponding to gray level The simply illustration of the embodiment of the present invention, the embodiment of the present invention is to be protected determines statistical probability value corresponding to gray level The mode of span is not limited to the example above, any span that can determine statistical probability value corresponding to gray level Mode is all applicable to the present invention.
In enforcement, according to following equation, described statistical probability value is adjusted:
Py'=min+ (max-min) × Py... formula three;
Wherein, PyFor described statistical probability value, Py' it is the statistical probability value after adjusting, max is in described span Maximum, min is the minima in described span.
The embodiment of the present invention, according to the statistical probability value after adjusting, determines the initial optimization that described statistical probability value is corresponding During coefficient, specifically can use following equation:
A=log (p 'y)/log (bin) ... formula four;
Wherein, A is initial optimization coefficient, Py' it is the statistical probability value after adjusting, bin is that described statistical probability value is corresponding Normalized Grey Level level, and 0≤bin≤1.
Owing to the embodiment of the present invention obtains N-1 initial optimization coefficient according to said method, if the most excellent according to this N-1 Change coefficient generate N-1 bar Optimal Curve, utilize this N-1 bar Optimal Curve that image is processed, it is thus achieved that image effect not Preferable, it is therefore desirable to be optimized obtaining N-1 initial optimization coefficient.
Second aspect, for any one initial optimization coefficient, describe in detail and determine the optimization that initial optimization coefficient is corresponding The step of coefficient.
In enforcement, gray level corresponding to initial optimization coefficient in different scopes time, determine that initial optimization coefficient is corresponding The method of optimized coefficients the most different.
It is concrete, if gray level corresponding to described initial optimization coefficient is less than first threshold, then according in described image The pixel value of imago vegetarian refreshments, and the pixel value of the pixel of neighboring area corresponding to described central pixel point, determine described at the beginning of The optimized coefficients that beginning optimized coefficients is corresponding;Wherein, described neighboring area is the region centered by described central pixel point;
If the gray level that described initial optimization coefficient is corresponding is not less than first threshold, then according to the center pixel of described image The pixel value of point, determines the optimized coefficients that described initial optimization coefficient is corresponding.
It should be noted that the first threshold in the embodiment of the present invention is preset value, due to gray level in the range of [0, 1], may range from (0,1) of the first threshold preset, optionally, first threshold is 0.5.
Scope below for initial optimization coefficient corresponding grey scale level is different, is described separately and determines that initial optimization coefficient is corresponding The method of optimized coefficients.
The gray level that A, initial optimization coefficient are corresponding is less than first threshold.
The embodiment of the present invention is being optimized process to initial optimization coefficient, determines the optimization system that initial optimization coefficient is corresponding During number, need according to initial optimization coefficient and the corresponding relation of gray value, determine the gray value that initial optimization coefficient is corresponding, if really Fixed gray value is less than first threshold, then use following method to determine the optimized coefficients that initial optimization coefficient is corresponding.
In enforcement, according to the pixel value of the central pixel point of described image, and the periphery that described central pixel point is corresponding The pixel value of the pixel in region, determines the optimized coefficients that described initial optimization coefficient is corresponding.
Wherein, the region that neighboring area is the L*M centered by central pixel point that central pixel point is corresponding, and L is The number of pixels often gone of neighboring area, M is the number of pixels of each column of neighboring area.
Optionally, the embodiment of the present invention uses following equation to determine the optimized coefficients that initial optimization coefficient is corresponding.
A '=A × m ... formula five;
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;M is described week The ratio of the pixel value of the central pixel point of the meansigma methods of the pixel value of all pixels and described image in edge regions;
It should be noted that neighboring area corresponding to central pixel point is the region centered by central pixel point, and The neighboring area number of pixels that often row and each column comprise is set in advance, such as, can pre-set central pixel point corresponding Neighboring area is centered by central pixel point, the square area of 3*3, and wherein, 3 represent number of pixels.
When the optimized coefficients that calculating initial optimization coefficient is corresponding, it is thus necessary to determine that the pixel of the central pixel point of this image Value, it is assumed that for a1;According to the neighboring area that the central pixel point determined is corresponding, determine the pixel of all pixels in neighboring area The meansigma methods of value, it is assumed that the meansigma methods of the pixel value of neighboring area pixel is b1, then m=b1/a1
The embodiment of the present invention is when using formula five to determine optimized coefficients corresponding to initial optimization coefficient, if it is determined that m < 1, illustrate that central pixel point is higher than the pixel brightness of neighboring area, thus calculated optimized coefficients is compared to initial optimization Coefficient diminishes so that the degree that highlights increases;If it is determined that m > 1, the central pixel point pixel brightness than neighboring area is described Low, thus calculated optimized coefficients becomes big compared to initial optimization coefficient so that the degree that highlights reduces;Therefore, the present invention Embodiment by the way of calculating the optimized coefficients that initial optimization coefficient is corresponding, can improve the contrast of the low bright part of image.
The gray level that B, initial optimization coefficient are corresponding is not less than first threshold.
The embodiment of the present invention is being optimized process to initial optimization coefficient, determines the optimization system that initial optimization coefficient is corresponding During number, need according to initial optimization coefficient and the corresponding relation of gray value, determine the gray value that initial optimization coefficient is corresponding, if really Fixed gray value is not less than first threshold, then use following method to determine the optimized coefficients that initial optimization coefficient is corresponding.
In enforcement, according to the pixel value of the central pixel point of described image, determine corresponding excellent of described initial optimization coefficient Change coefficient.
Optionally, the embodiment of the present invention uses following equation to determine the optimized coefficients that initial optimization coefficient is corresponding.
A '=A × (1+pix_value) ... formula six;
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;pix_value For the pixel value of the central pixel point of the described image after normalized, and pix_value more than or equal to 0 and is less than or equal to 1。
It should be noted that the central pixel point that the pix_value in formula six is the described image after normalized Pixel value, the embodiment of the present invention is when being normalized the pixel value of central pixel point, and the method for employing is existing The method of technology, in this not go into detail for the method for concrete normalized central pixel point pixel value.
The embodiment of the present invention, when using formula six to determine optimized coefficients corresponding to initial optimization coefficient, works as pix_value Time the biggest, the biggest according to the optimized coefficients that initial optimization coefficient calculations obtains, in therefore can effectively suppressing, highlight regions is excessive Strengthen.
Step 204, generate N-1 Optimal Curve according to N-1 the optimized coefficients determined.
The embodiment of the present invention uses following manner to determine the Optimal Curve that optimized coefficients is corresponding:
Concrete, when determining Optimal Curve, can be determined according to the following equation:
Y o u t = ( 2 n - 1 ) * ( Y i n 2 n - 1 ) A ′ ;
Wherein, YoutFor output pixel value, YinFor input pixel value, n is the bit wide of image, A ' optimized coefficients.
Such as, when optimized coefficients is gamma value, the Optimal Curve of generation is gamma distribution curve.
Step 205, according to N-1 the Optimal Curve generated, and default N-1 gray scale in addition to maximum gray scale The adjustment curve that in Ji, each gray level is corresponding, determines the mapping curve that described image is corresponding.
Wherein, N-1 Optimal Curve of generation and the N-1 bar preset adjust curve is one to one.Except maximum gray scale In N-1 gray level outside Ji, each gray level all has the Optimal Curve of correspondence and adjusts curve.
Concrete, when determining mapping curve corresponding to image, it is determined according to following manner.
The Optimal Curve corresponding according to same gray level and adjustment curve, determine the son mapping song that described gray level is corresponding Line;
According to the sub-mapping curve that each gray level in N-1 gray level in addition to maximum gray scale is corresponding, determine The mapping curve that described image is corresponding.
In enforcement, determine, according to following manner, the mapping curve that described image is corresponding:
Yout=G1(Yin)×B1(Yin)+G2(Yin)×B2(Yin)+……+GN-1(Yin)×BN-1(Yin) ... formula seven;
Wherein, G1、G2……GN-1For described Optimal Curve, B1、B2……BN-1For described adjustment curve, YoutFor output picture Element value, YinFor input pixel value;Further, at B1、B2……BN-1Input value identical time, B1、B2……BN-1Output valve sum is 1。
Step 206, according to described mapping curve, the pixel value of pixels all in described image is adjusted.
The embodiment of the present invention, when being adjusted the pixel value of the pixel in image, is reflected according in step 205 Penetrate curve, each pixel in image is mapped.Concrete mapping process is: for any one pixel in image Point, determines the original pixel value of this pixel in image, using the original pixel value of this pixel as Yin, according to formula seven, Pixel value Y after the adjustment that this pixel is correspondingout, the pixel value of this pixel in image is adjusted to Yout
Two, the target area that image is corresponding is multiple.
If the target area that described image is corresponding is multiple, the number of the most described target area is pixel in described image Number, and the central pixel point that each pixel is a target area in described image..
The embodiment of the present invention, when the target area that image is corresponding is multiple, needs to ensure corresponding one of each pixel Target area, and the central pixel point that this pixel is corresponding target area, i.e. each pixel in image is The central pixel point of the target area of its correspondence.
The central pixel point of the target area of its correspondence it is due to each pixel in embodiment of the present invention image, Accordingly, there exist target area corresponding to pixel to be not exclusively positioned in image.
There is target area corresponding to pixel for the embodiment of the present invention and be not exclusively positioned at the situation in image, determining Before the target area that each pixel is corresponding, need the size according to target area that image carries out mend limit and process.
Concrete benefit limit processes can use following two ways.
Mode one, before determining multiple target area, whole image is carried out mend limit process.
Concrete, it is assumed that the number of pixels often gone in the target area preset is W, and the number of pixels of each column is H, wherein, W, H are positive integer.
Image A as shown in Figure 3A carries out mend limit process.
The first step, determines first area and second area in image A;Wherein, first area is positioned at the most left of image A Side, and the first area often number of pixels that includes of row is W/2, and the number of pixels that each column includes is equal to the pixel of image A each column Number;Second area is positioned at the rightmost side of image A, and the second area number of pixels that often row includes is W/2, and each column includes Number of pixels is equal to the number of pixels of image A each column;First area and second area position in image A are as shown in Figure 3 B;
Second step, centered by the edge line of the image A leftmost side line, first area is carried out mirror image processing;And with image A Line centered by the edge line of the rightmost side, carries out mirror image processing by second area;Behind first area and second area mirror image processing Image B is as shown in Figure 3 C;
3rd step, determine the 3rd region and the 4th region at image B;Wherein, the 3rd region is positioned at the top of image B, And the 3rd region number of pixels that often row includes is the number of pixels often gone equal to image B, and the number of pixels that each column includes is H/2;4th region is positioned at the bottom of image B, and the 4th region number of pixels that often row includes is often go equal to image B Number of pixels, the number of pixels that each column includes is H/2;3rd region and the 4th region position in image B is as shown in Figure 3 D;
4th step, centered by the edge line of image B the top line, the 3rd region is carried out mirror image processing;With image B under Line centered by method, edge line, carries out mirror image processing by the 4th region;By the image C after the 3rd region and the 4th region mirror image processing As shown in FIGURE 3 E;
The image C obtained through aforementioned four step is the image after benefit limit corresponding for image A processes.
According to mending the image after limit processes, in mending the image after limit processes, determine all sub-districts meeting and imposing a condition Territory, meets the subregions that impose a condition as target area corresponding to image using all.Wherein, the condition set is as in subregion The number of pixels often gone is that in W, and described subregion, the number of pixels of each column is H.
Mode two, determine target area according to each pixel in image, when determining target area, image is carried out Benefit limit processes.
Assuming that the number of pixels often gone in the target area preset is W, the number of pixels of each column is H, and wherein, W, H are Positive integer.
Concrete, if in target area, subregion is positioned at the outside of described image, then according to position in described target area In the pixel in the region within described image, determine the picture of the subregion being positioned at described picture appearance in described target area Vegetarian refreshments.
In enforcement, for any one pixel, determine the sub regions centered by this pixel, and this son The number of pixels often gone in region is W, and the number of pixels of each column is H, then this subregion is the target area that this pixel is corresponding, and And if subregion is positioned at the outside of image in target area, then the region to being positioned at picture appearance in this target area is needed to enter Row mends limit.
Below for the position of different target areas, it is described separately the method carrying out mending limit to target area.
1, position, target area as shown in Figure 4 A, wherein, dashed region is image-region, and solid line region is target area Territory.Will be located in the region within image and be referred to as first area, the region that will be located in picture appearance is referred to as second area.According to target The central point in region, is divided into four regions, respectively region A, region B, region C, region with X-axis and Y-axis by target area D.Wherein, region A is first area, and region B, C, D are second area.
When second area being carried out mending limit according to the pixel in first area, region A is made mirror image with X-axis for axis of symmetry Process, obtain pixel in the B of region;And region A and region B is made mirror image processing with Y-axis for axis of symmetry, obtain region C and district Pixel in the D of territory, thus complete the benefit limit of second area in target area.
2, position, target area as shown in Figure 4 B, wherein, dashed region is image-region, and solid line region is target area Territory.Will be located in the region within image and be referred to as first area, the region that will be located in picture appearance is referred to as second area.According to target The central point in region, is divided into four regions, respectively region A, region B, region C, region with X-axis and Y-axis by target area D, wherein, region B includes the region B1 being positioned at picture appearance and is positioned at the region B2 within image.Then region A, B2 is first Region, region B1, C, D are second area.
When second area being carried out mending limit according to the pixel in first area, determine in target area symmetrical with region B1 Region be region A1, then region A1 is made mirror image processing with X-axis for axis of symmetry, obtains pixel in the B1 of region;And by region A Make mirror image processing with Y-axis for axis of symmetry with region B, obtain pixel in region C and region D, thus complete in target area The benefit limit of second area.
3, position, target area as shown in Figure 4 C, wherein, dashed region is image-region, and solid line region is target area Territory.Will be located in the region within image and be referred to as first area, the region that will be located in picture appearance is referred to as second area.According to target The central point in region, is divided into two regions, respectively region A and region B with X-axis by target area.Wherein, region A is One region, region B is second area.
When second area being carried out mending limit according to the pixel in first area, region A is made mirror image with X-axis for axis of symmetry Process, obtain pixel in the B of region.Thus complete the benefit limit of second area in target area.
4, position, target area as shown in Figure 4 D, wherein, dashed region is image-region, and solid line region is target area Territory.Will be located in the region within image and be referred to as first area, the region that will be located in picture appearance is referred to as second area.According to target The central point in region, is divided into two regions, respectively region A and region B with X-axis target area, and wherein, region B includes Being positioned at the region B1 of picture appearance and be positioned at the region B2 within image, region A, B2 are first area, and region B1 is the secondth district Territory.
When second area being carried out mending limit according to the pixel in first area, determine in target area symmetrical with region B1 Region be region A1, then region A1 is made mirror image processing with X-axis for axis of symmetry, obtains pixel in the B1 of region.Thus complete To the benefit limit of second area in target area.
Wherein, target area, when different positions, is carried out only mending the method on limit by the above-mentioned four kinds of target areas be given Being the illustration to the embodiment of the present invention, in target area when other positions, the method that target area carries out mending limit can With the method with reference to the example above.
It should be noted that the above-mentioned concrete mode one mending limit process be given and mode two are simply to the embodiment of the present invention Mending the illustration of limit processing mode, embodiment of the present invention benefit to be protected limit processing mode is not limited to the example above, appoints What can carry out mending the method for limit process and all be applicable to the present invention.
For any one target area in the embodiment of the present invention, following method is used to carry out image procossing.
As it is shown in figure 5, the method processing the image of target area includes:
Step 501, target area being converted to gray-scale map, and determine the accumulation histogram of this gray-scale map, wherein, accumulation is straight The gray level number of side's figure is N;
It should be noted that the step that target area is changed my gray-scale map can also is that, and image is carrying out the process of benefit limit Before, the most whole image being converted to gray-scale map, processing gray-scale map being carried out benefit limit.
Step 502, according to accumulation histogram corresponding to target area, determine N-1 gray scale in addition to maximum gray scale The statistical probability value that in Ji, each gray level is corresponding.
Concrete, according to the accumulation histogram that target area is corresponding, determine N-1 gray level in addition to maximum gray scale In the method that uses of statistical probability value corresponding to each gray level same as the prior art, concrete method is the most detailed at this Repeat.
Such as, when determining accumulation histogram corresponding to target area, the gray level number set as 4, respectively 0.25, 0.5、0.75、1;Then need according to accumulation histogram determine the statistical probability value of gray level 0.25 correspondence, 0.5 correspondence statistics general The statistical probability value of rate value and 0.75 correspondence.
Step 503, determine the optimized coefficients that each statistical probability value is corresponding.
When determining optimized coefficients corresponding to statistical probability value, optionally, according to the ash that each statistical probability value is corresponding Degree level, determines the initial optimization coefficient that each statistical probability value described is corresponding;According to the central pixel point of described target area, Determine the optimized coefficients that each initial optimization coefficient is corresponding.
Wherein, first this step determines the initial optimization coefficient that statistical probability value is corresponding, it is then determined that initial optimization system The optimized coefficients that number is corresponding.It is divided into two aspects below to illustrate.
First aspect, for any one statistical probability value, describe in detail and determine the initial optimization that statistical probability value is corresponding The step of coefficient.
A, according to gray level corresponding to statistical probability value, determine the span of statistical probability value corresponding to gray level;
B, according to the maximum in span and minima, described statistical probability value is adjusted;And according to adjustment After statistical probability value, determine the initial optimization coefficient that described statistical probability value is corresponding.
Owing to the embodiment of the present invention is when determining accumulation histogram corresponding to target area, the gray scale that accumulation histogram is corresponding Level number is N, and when the bit wide of image is n, N is far smaller than 2n.The minimizing of accumulation histogram gray level can reduce amount of calculation, But also bring along adverse effect.Such as, piece image entirety is partially dark, and pixel value concentrates on low bright area, in N number of gray level Statistical probability value corresponding to little gray level is close to 1, directly use statistical probability value corresponding to gray level to image at Reason, the pixel eventually resulting in low bright area excessively strengthens, and the not mild phenomenon of significantly height bright area transition occurs.Therefore, After determine the statistical probability value that this gray level is corresponding according to accumulation histogram, in addition it is also necessary to the statistical probability value obtained is adjusted Whole.
Concrete adjustment process is:
Determine the span of statistical probability value corresponding to gray level;According to the maximum in span and minima, Described statistical probability value is adjusted.
Wherein it is determined that the mode of the span of statistical probability value corresponding to gray level includes but not limited to:
Mode one, pre-set the span of statistical probability value corresponding to each gray level.
The embodiment of the present invention can use the span pre-setting statistical probability value corresponding to each gray level Mode, which is artificial setting.
Such as, the gray level number of the accumulation histogram set as 4, and respectively 0.25,0.5,0.75,1, determine ash The statistical probability value of degree level 0.25 correspondence is Pys, determine that the statistical probability value of gray level 0.5 correspondence is Pym, determine gray level The statistical probability value of 0.75 correspondence is Pyh.The span of the statistical probability value of gray level 0.25 correspondence pre-set is [0.01,0.35];The span of the statistical probability value of gray level 0.5 correspondence pre-set is [0.35,0.65];Set in advance The span of the statistical probability value of gray level 0.75 correspondence put is [0.65,0.95];To Pys、Pym、PyhIt is adjusted Time, according to the span of statistical probability value corresponding to each gray level pre-set, to Pys、Pym、PyhIt is adjusted.
Mode two, self adaptation determine the span of statistical probability value corresponding to each gray level.
The embodiment of the present invention adaptive can determine statistical probability value corresponding to gray level according to different gray levels Span.
Concrete, when the adaptive span determining statistical probability value corresponding to gray level, need according to this ash Degree level, and empirical coefficient corresponding to this gray level be determined.
In enforcement, following equation self adaptation is used to determine the span of statistical probability value corresponding to gray level:
Max=bin+k3
Min=bin+k4
Wherein, max is the maximum in described span, and min is the minima in described span;And 0 < Min < max < 1;Bin is the Normalized Grey Level level that described statistical probability value is corresponding, and bin more than or equal to 0 and is less than or equal to 1;k3> k4, and k3、k4It is all higher than 0 and less than 1.
It addition, the k in above-mentioned formula3、k4For empirical coefficient, the corresponding identical or different k of each gray level3、k4
It should be noted that above-mentioned two kinds be given determine the mode of the span of statistical probability value corresponding to gray level The simply illustration of the embodiment of the present invention, the embodiment of the present invention is to be protected determines statistical probability value corresponding to gray level The mode of span is not limited to the example above, any span that can determine statistical probability value corresponding to gray level Mode is all applicable to the present invention.
In enforcement, according to following equation, described statistical probability value is adjusted:
Py'=min+ (max-min) × Py
Wherein, PyFor described statistical probability value, Py' it is the statistical probability value after adjusting, max is in described span Maximum, min is the minima in described span.
The embodiment of the present invention, according to the statistical probability value after adjusting, determines the initial optimization that described statistical probability value is corresponding During coefficient, specifically can use following equation:
A=log (p 'y)/log(bin);
Wherein, A is initial optimization coefficient, Py' it is the statistical probability value after adjusting, bin is that described statistical probability value is corresponding Normalized Grey Level level, and 0≤bin≤1.
Owing to the embodiment of the present invention obtains N-1 initial optimization coefficient according to said method, if the most excellent according to this N-1 Change coefficient generate N-1 bar Optimal Curve, utilize this N-1 bar Optimal Curve that target area is processed, it is thus achieved that target area Image effect unsatisfactory, it is therefore desirable to be optimized obtaining N-1 initial optimization coefficient.
Second aspect, for any one initial optimization coefficient, describe in detail and determine the optimization that initial optimization coefficient is corresponding The step of coefficient.
In enforcement, gray level corresponding to initial optimization coefficient in different scopes time, determine that initial optimization coefficient is corresponding The method of optimized coefficients the most different.
It is concrete, if gray level corresponding to described initial optimization coefficient is less than first threshold, then according to described target area The pixel value of central pixel point, and the pixel value of the pixel of neighboring area corresponding to described central pixel point, determine institute State the optimized coefficients that initial optimization coefficient is corresponding;Wherein, described neighboring area is the region centered by described central pixel point;
If the gray level that described initial optimization coefficient is corresponding is not less than first threshold, then according to the center of described target area The pixel value of pixel, determines the optimized coefficients that described initial optimization coefficient is corresponding.
It should be noted that the first threshold in the embodiment of the present invention is preset value, due to gray level in the range of [0, 1], may range from (0,1) of the first threshold preset, optionally, first threshold is 0.5.
Scope below for initial optimization coefficient corresponding grey scale level is different, is described separately and determines that initial optimization coefficient is corresponding The method of optimized coefficients.
The gray level that A, initial optimization coefficient are corresponding is less than first threshold.
The embodiment of the present invention is being optimized process to initial optimization coefficient, determines the optimization system that initial optimization coefficient is corresponding During number, need according to initial optimization coefficient and the corresponding relation of gray value, determine the gray value that initial optimization coefficient is corresponding, if really Fixed gray value is less than first threshold, then use following method to determine the optimized coefficients that initial optimization coefficient is corresponding.
In enforcement, according to the pixel value of the central pixel point of described target area, and described central pixel point is corresponding The pixel value of the pixel of neighboring area, determines the optimized coefficients that described initial optimization coefficient is corresponding.
Wherein, the region that neighboring area is the L*M centered by central pixel point that central pixel point is corresponding, and L is The number of pixels often gone of neighboring area, M is the number of pixels of each column of neighboring area.
Optionally, the embodiment of the present invention uses following equation to determine the optimized coefficients that initial optimization coefficient is corresponding.
A '=A × m;
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;M is described week The ratio of the pixel value of the central pixel point of the meansigma methods of the pixel value of all pixels and described target area in edge regions;
It should be noted that neighboring area corresponding to central pixel point is the region centered by central pixel point, and The neighboring area number of pixels that often row and each column comprise is set in advance, such as, can pre-set central pixel point corresponding Neighboring area is centered by central pixel point, the square area of 4*4, and wherein, 4 represent number of pixels.
When the optimized coefficients that calculating initial optimization coefficient is corresponding, it is thus necessary to determine that the picture of the central pixel point of this target area Element value, it is assumed that for a1;According to the neighboring area that the central pixel point determined is corresponding, determine the picture of all pixels in neighboring area The meansigma methods of element value, it is assumed that the meansigma methods of the pixel value of neighboring area pixel is b1, then m=b1/a1
The embodiment of the present invention is when using above-mentioned formula to determine optimized coefficients corresponding to initial optimization coefficient, if it is determined that m < 1, illustrates that central pixel point is higher than the pixel brightness of neighboring area, thus calculated optimized coefficients is compared to the most excellent Change coefficient to diminish so that the degree that highlights increases;If it is determined that m > 1, the central pixel point pixel brightness than neighboring area is described Low, thus calculated optimized coefficients becomes big compared to initial optimization coefficient so that the degree that highlights reduces;Therefore, the present invention Embodiment by the way of calculating the optimized coefficients that initial optimization coefficient is corresponding, can improve the contrast of the low bright part in target area Degree.
The gray level that B, initial optimization coefficient are corresponding is not less than first threshold.
The embodiment of the present invention is being optimized process to initial optimization coefficient, determines the optimization system that initial optimization coefficient is corresponding During number, need according to initial optimization coefficient and the corresponding relation of gray value, determine the gray value that initial optimization coefficient is corresponding, if really Fixed gray value is not less than first threshold, then use following method to determine the optimized coefficients that initial optimization coefficient is corresponding.
In enforcement, according to the pixel value of the central pixel point of described target area, determine that described initial optimization coefficient is corresponding Optimized coefficients.
Optionally, the embodiment of the present invention uses following equation to determine the optimized coefficients that initial optimization coefficient is corresponding.
A '=A × (1+pix_value);
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;pix_value For the pixel value of the central pixel point of the described target area after normalized, and pix_value more than or equal to 0 and is less than Equal to 1.
It should be noted that the center that the pix_value in above-mentioned formula is the described target area after normalized The pixel value of pixel, the embodiment of the present invention when the pixel value of central pixel point is normalized, the method for employing For the method for prior art, in this not go into detail for the method for concrete normalized central pixel point pixel value.
The embodiment of the present invention, when using above-mentioned formula to determine optimized coefficients corresponding to initial optimization coefficient, works as pix_ When value is the biggest, the biggest according to the optimized coefficients that initial optimization coefficient calculations obtains, highlight regions in therefore can effectively suppressing Excessively strengthen.
Step 504, generate N-1 Optimal Curve according to N-1 the optimized coefficients determined.
The embodiment of the present invention uses following manner to determine the Optimal Curve that optimized coefficients is corresponding:
Concrete, when determining Optimal Curve, can be determined according to the following equation:
Y o u t = ( 2 n - 1 ) * ( Y i n 2 n - 1 ) A ′ ;
Wherein, YoutFor output pixel value, YinFor input pixel value, n is the bit wide of image, A ' optimized coefficients.
Such as, when optimized coefficients is gamma value, the Optimal Curve of generation is gamma distribution curve.
Step 505, according to N-1 the Optimal Curve generated, and default N-1 gray scale in addition to maximum gray scale The adjustment curve that in Ji, each gray level is corresponding, determines the mapping curve that described target area is corresponding.
Wherein, N-1 Optimal Curve of generation and the N-1 bar preset adjust curve is one to one.Except maximum gray scale In N-1 gray level outside Ji, each gray level all has the Optimal Curve of correspondence and adjusts curve.
Concrete, when determining mapping curve corresponding to target area, it is determined according to following manner.
The Optimal Curve corresponding according to same gray level and adjustment curve, determine the son mapping song that described gray level is corresponding Line;
According to the sub-mapping curve that each gray level in N-1 gray level in addition to maximum gray scale is corresponding, determine The mapping curve that described target area is corresponding.
In enforcement, determine, according to following manner, the mapping curve that described target area is corresponding:
Yout=G1(Yin)×B1(Yin)+G2(Yin)×B2(Yin)+……+GN-1(Yin)×BN-1(Yin);
Wherein, G1、G2……GN-1For described Optimal Curve, B1、B2……BN-1For described adjustment curve, YoutFor output picture Element value, YinFor input pixel value;Further, at B1、B2……BN-1Input value identical time, B1、B2……BN-1Output valve sum is 1。
Step 506, according to described mapping curve, the pixel value of the central pixel point of described target area is adjusted.
The embodiment of the present invention is when the pixel value of the central pixel point to target area is adjusted, according in step 505 Obtain mapping curve, each pixel in target area is mapped.Concrete mapping process is: determine target area The original pixel value of central pixel point, using the original pixel value of this central pixel point as Yin, according to above-mentioned formula, obtain in this Pixel value Y after the adjustment that imago vegetarian refreshments is correspondingout, the pixel value of the central pixel point of target area is adjusted to Yout
As shown in Figure 6, include as a example by multiple target area by image, the overall flow of embodiment of the present invention image procossing Figure, including:
Step 601, convert the image into gray-scale map;
Step 602, determine multiple target areas that image is corresponding, wherein, corresponding one of each pixel in this image Target area, and the central pixel point that pixel is corresponding target area;
Step 603, from multiple target areas that image is corresponding, determine that subregion is positioned at the target area of picture appearance Territory, and carry out the region being positioned at picture appearance in target area mending limit process;
Step 604, according to accumulation histogram corresponding to described target area, determine the N-1 in addition to maximum gray scale The statistical probability value that in gray level, each gray level is corresponding;
Step 605, determine the span of statistical probability value corresponding to each gray level;
Step 606, span according to statistical probability value corresponding to each gray level described, general to each statistics Rate value is adjusted;And according to the statistical probability value after adjusting, determine the initial optimization coefficient that each statistical probability value is corresponding;
Step 607, central pixel point according to described target area, determine the optimization that each initial optimization coefficient is corresponding Coefficient;
Step 608, generate N-1 Optimal Curve according to N-1 the optimized coefficients determined;
Step 609, according to N-1 the Optimal Curve generated, and default N-1 gray scale in addition to maximum gray scale The adjustment curve that in Ji, each gray level is corresponding, determines the mapping curve that described target area is corresponding;
Step 610, according to described mapping curve, the pixel value of the central pixel point of described target area is adjusted.
Below with the method for a specific embodiment explanation image procossing.Wherein, multiple target area is included with image As a example by illustrate.
1, gray-scale map is converted the image into.
2, multiple target areas that this gray-scale map is corresponding, wherein, the corresponding mesh of each pixel in image are determined Mark region, and the central pixel point that pixel is corresponding target area.
3, determine that in multiple target area, subregion is in the target area of picture appearance, the existence subregion that will determine Carry out mending limit to process in the target area of picture appearance.Explanation during concrete benefit limit processing method is as detailed above.
Below for any one target area, describe the method that target area is processed in detail.Wherein, the present invention The optimized coefficients that specific embodiment uses is for optimizing gamma value, and Optimal Curve is for optimizing gamma, and adjustment curve is Gauss Weighting curve.
4, determining the accumulation histogram that target area is corresponding, wherein the gray level number of accumulation histogram is 4, gray scale fraction It is not 0.25,0.5,0.75,1, the gray level after wherein this gray level is normalized;
5, according to the accumulation histogram that target area is corresponding, statistical probability value P of gray level 0.25 correspondence is determinedys, gray scale Statistical probability value P of level 0.5 correspondenceym, statistical probability value P of gray level 0.75 correspondenceyh
6, amount of calculation can be reduced owing to accumulation histogram gray level reduces, but also bring along adverse effect.Such as mesh Mark region entirety is partially dark, and pixel value concentrates on low bright area, is calculating PysTime, PysClose to 1, eventually result in low bright area Pixel excessively strengthen, the mild phenomenon of significantly height bright area transition occurs.Accordingly, it would be desirable to PyIt is defined:
Py'=min+ (max-min) × Py
Wherein, PyFor described statistical probability value, Py' it is the statistical probability value after adjusting, max is in described span Maximum, min is the minima in described span.
Further, the default value of max, min of gray level 0.25 correspondence is: maxs=0.35, mins=0.01;Gray level 0.5 The default value of corresponding max, min is: maxm=0.65, minm=0.35;The default value of max, min of gray level 0.75 correspondence For: maxh=0.95, minh=0.65.
Max, min value in the specific embodiment of the invention can independently controlled shadow directly perceived, middle, The enhancing intensity in each region of highlight, ratio, if desired for the luminance raising degree reinforcement to shadow region, can increase The max value in shadow region.Therefore, can realize independent control each bright by max, min value of the different luminance area of regulation The enhancing degree in degree region.
Wherein, max, min value can be chosen according to level adaptations such as the overall brightnesses of target area, or manually adjusts Each max, min value is adjusted by the mode of joint.
Max, min value is chosen according to following manner self adaptation:
Max=bin+k3
Min=bin+k4
Wherein, max is the maximum in described span, and min is the minima in described span;And 0 < Min < max < 1;Bin is the Normalized Grey Level level that described statistical probability value is corresponding, and bin more than or equal to 0 and is less than or equal to 1;k3> k4, and k3、k4It is empirical coefficient.
7, the initial gamma value that each statistical probability value is corresponding is calculated.
Gamma_value=log (p 'y)/log(bin);Wherein, gamma_value is initial optimization coefficient, Py' for adjusting Statistical probability value after whole, bin is the Normalized Grey Level level that described statistical probability value is corresponding, and 0≤bin≤1.
8, according to the gray level that initial gamma value is corresponding, the optimization gamma value that initial gamma value is corresponding is determined.
A, initial gamma value for gray level 0.25 correspondence, calculate the excellent of initial gamma value correspondence according to following equation Change gamma value:
Gamma_value '=gamma_value × m;
Wherein, gamma_value is described initial optimization coefficient, and gamma_value ' is corresponding for described initial optimization coefficient Optimized coefficients;M is the meansigma methods of the pixel value of all pixels and the middle imago of described target area in described neighboring area The ratio of the pixel value of vegetarian refreshments;Further, pre-setting neighboring area corresponding to central pixel point is centered by central pixel point, The square area of 3*3,3 represent number of pixels.
In formula, if m < 1, illustrate that the central pixel point of target area is higher than the pixel brightness of peripheral region, so that Gamma_value ' diminishes, and the degree that highlights increases;If m > 1, the central pixel point picture than peripheral region of target area is described Vegetarian refreshments brightness is low, so that gamma_value ' becomes big, the degree that highlights reduces.Finally, improve increasing by gamma_value ' The contrast of the low bright part of image after strong.
B, initial gamma value for gray level 0.5 and 0.75 correspondence, calculate initial gamma value according to following equation right The optimization gamma value answered:
Gamma_value '=gamma_value × (1+pix_value);
Wherein, gamma_value is described initial optimization coefficient, and gamma_value ' is corresponding for described initial optimization coefficient Optimized coefficients, pix_value is the pixel value of the central pixel point of the target area after normalized.Work as pix_value The biggest, gamma_value ' is the biggest, thus in suppression, highlight regions excessively strengthens.
9, according to the gamma_value ' that each gray level is corresponding, the optimization gamma that each gray level is corresponding is determined Curve.
When determining optimization gamma, it is determined according to following equation:
Y o u t = ( 2 n - 1 ) * ( Y i n 2 n - 1 ) g a m m a _ value ′ ;
The optimization gamma generated is as shown in Figure 7.Wherein, obtain three curve gamma and be respectively Gs、GmWith Gh, wherein, gamma GsThrough Pys', gamma GmThrough Pym', gamma GhThrough Pyh′;And gamma is bent Line GsCorresponding to the shadow brightness degree of target area, gamma GmCorresponding to the middle brightness degree of target area, Gamma GhHighlight brightness degree corresponding to target area.
10, according to optimizing gamma, and Gauss weighting curve, the mapping curve that synthesis target area is corresponding.Its In, Gauss weighting curve is as shown in Figure 8.
Mapping curve corresponding to target area according to following equation synthesis:
Yout=Gs(Yin)×Bs(Yin)+Gm(Yin)×Bm(Yin)+Gh(Yin)×Bh(Yin);
Wherein, Gs、Gm、GhFor optimizing gamma, Bs、Bm、BhFor Gauss weighting curve, YoutFor output pixel value, Yin For input pixel value;Further, at Bs、Bm、BhInput value identical time, Bs、Bm、BhOutput valve sum is 1.
The mapping curve of the specific embodiment of the invention obtained according to above-mentioned formula is as shown in Figure 9.
11, according to described mapping curve, the pixel value of the central pixel point of described target area is adjusted.
Concrete, using the original pixel value of the central pixel point of target area as Yin, according to the public affairs of above-mentioned mapping curve Formula, calculates the output pixel value Y of the central pixel point of target areaout, and by the pixel value of the central pixel point of target area It is adjusted to Yout
Based on same inventive concept, the embodiment of the present invention additionally provides the device of a kind of image procossing, due to this device The principle of solution problem is similar to the method for embodiment of the present invention image procossing, and therefore the enforcement of this device may refer to method Implement, repeat no more in place of repetition.
As shown in Figure 10, the device of embodiment of the present invention image procossing, including:
Acquisition module 1001, for the accumulation histogram corresponding according to the target area of image, determines except maximum gray scale Outside N-1 gray level in statistical probability value corresponding to each gray level, wherein, described N is described accumulation histogram Gray level number, N is the positive integer more than 1, and described N is less than the gray level number of described image;
Determine module 1002, for determining the optimized coefficients that each statistical probability value described is corresponding, and according to described often One optimized coefficients, generates the Optimal Curve that described optimized coefficients is corresponding;
Control module 1003, for according to generate each Optimal Curve, and preset in addition to maximum gray scale N-1 gray level in adjustment curve corresponding to each gray level, determine the mapping curve that described target area is corresponding;
Processing module 1004, for determining the pixel needing to carry out processing in described target area, and reflects according to described Penetrate curve the pixel value of described pixel is adjusted.
Optionally, described determine module 1002, specifically for:
According to the gray level that each statistical probability value is corresponding, determine corresponding the most excellent of each statistical probability value described Change coefficient;According to the central pixel point of described target area, determine the optimized coefficients that each initial optimization coefficient is corresponding.
Optionally, described determine module 1002, specifically for:
For any one statistical probability value, according to the gray level that described statistical probability value is corresponding, determine that described statistics is general The span that rate value is corresponding;According to the maximum in described span and minima, described statistical probability value is adjusted Whole;And according to the statistical probability value after adjusting, determine the initial optimization coefficient that described statistical probability value is corresponding.
Optionally, described determine module 1002, specifically for:
The span of statistical probability value corresponding to described gray level be determined according to the following equation:
Max=bin+k1
Min=bin+k2
Wherein, max is the maximum in described span, and min is the minima in described span;And 0 < Min < max < 1;Bin is the Normalized Grey Level level that described statistical probability value is corresponding, and bin more than or equal to 0 and is less than or equal to 1;k1> k2
According to following equation, described statistical probability value is adjusted:
Py'=min+ (max-min) × Py
Wherein, PyFor described statistical probability value, Py' it is the statistical probability value after adjusting, max is in described span Maximum, min is the minima in described span;
Initial optimization coefficient that described statistical probability value corresponding be determined according to the following equation:
A=log (p 'y)/log(bin);
Wherein, A is initial optimization coefficient, Py' it is the statistical probability value after adjusting, bin is that described statistical probability value is corresponding Normalized Grey Level level, and bin is more than or equal to 0 and less than or equal to 1.
Optionally, described determine module 1002, specifically for:
For any one initial optimization coefficient, if gray level corresponding to described initial optimization coefficient is less than first threshold, Then according to the pixel value of the central pixel point of described target area, and the pixel of neighboring area corresponding to described central pixel point The pixel value of point, determines the optimized coefficients that described initial optimization coefficient is corresponding;Wherein, described neighboring area is with described middle imago Region centered by vegetarian refreshments;
For any one initial optimization coefficient, if gray level corresponding to described initial optimization coefficient is not less than the first threshold Value, then according to the pixel value of the central pixel point of described target area, determine the optimized coefficients that described initial optimization coefficient is corresponding.
Optionally, described determine module 1002, specifically for:
When gray level corresponding to described initial optimization coefficient is less than first threshold, be determined according to the following equation described initially The optimized coefficients that optimized coefficients is corresponding:
A '=A × m;
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;M is described week The ratio of the pixel value of the central pixel point of the meansigma methods of the pixel value of all pixels and described target area in edge regions;
When gray level corresponding to described initial optimization coefficient is not less than first threshold, be determined according to the following equation described at the beginning of The optimized coefficients that beginning optimized coefficients is corresponding:
A '=A × (1+pix_value);
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;pix_value For the pixel value of the central pixel point of the described target area after normalized, and pix_value more than or equal to 0 and is less than Equal to 1.
Optionally, described control module 1003, specifically for:
The Optimal Curve corresponding according to same gray level and adjustment curve, determine the son mapping song that described gray level is corresponding Line;According to the sub-mapping curve that each gray level in N-1 gray level in addition to maximum gray scale is corresponding, determine described mesh The mapping curve that mark region is corresponding.
Optionally, described control module 1003, specifically for:
The mapping curve that described target area is corresponding is determined according to following manner:
Yout=G1(Yin)×B1(Yin)+G2(Yin)×B2(Yin)+……+GN-1(Yin)×BN-1(Yin);
Wherein, G1、G2……GN-1For described Optimal Curve, B1、B2……BN-1For described adjustment curve, YoutFor output picture Element value, YinFor input pixel value;Further, at B1、B2……BN-1Input value identical time, B1、B2……BN-1Output valve sum is 1。
Optionally, if target area corresponding to described image is one, the most described target area is described image;
If the target area that described image is corresponding is multiple, the number of the most described target area is pixel in described image Number, and the central pixel point that each pixel is a target area in described image.
Optionally, described acquisition module 1001, it is additionally operable to:
If the target area that described image is corresponding is multiple, it is positioned at the outside of described image in the subregion of target area Time, according to the pixel in the region being positioned in described target area within described image, determine and described target area is positioned at institute State the pixel of the subregion of picture appearance.
Optionally, described processing module 1004, specifically for:
If the target area that described image is corresponding is one, the most described target area need the pixel carrying out processing be All pixels in described target area;
If the target area that described image is corresponding is multiple, the most described target area need the pixel carrying out processing be The central pixel point of described target area.
Obviously, those skilled in the art can carry out various change and the modification essence without deviating from the present invention to the present invention God and scope.So, if these amendments of the present invention and modification belong to the scope of the claims in the present invention and equivalent technologies thereof Within, then the present invention is also intended to comprise these change and modification.

Claims (22)

1. the method for an image procossing, it is characterised in that the method includes:
The accumulation histogram that target area according to image is corresponding, determines in N-1 gray level in addition to maximum gray scale every The statistical probability value that one gray level is corresponding, wherein, described N is the gray level number of described accumulation histogram, and described N is for being more than The positive integer of 1, and described N is less than the gray level number of described image;
Determine the optimized coefficients that each statistical probability value described is corresponding, and according to each optimized coefficients described, generate described The Optimal Curve that optimized coefficients is corresponding;
According to generate each Optimal Curve, and preset N-1 gray level in addition to maximum gray scale in each The adjustment curve that gray level is corresponding, determines the mapping curve that described target area is corresponding;
Determine the pixel needing to carry out processing in described target area, and according to the described mapping curve picture to described pixel Element value is adjusted.
2. the method for claim 1, it is characterised in that the described optimization determining that each statistical probability value described is corresponding Coefficient, including:
According to the gray level that each statistical probability value is corresponding, determine the initial optimization system that each statistical probability value described is corresponding Number;
According to the central pixel point of described target area, determine the optimized coefficients that each initial optimization coefficient is corresponding.
3. method as claimed in claim 2, it is characterised in that the described gray level corresponding according to each statistical probability value, Determine the initial optimization coefficient that each statistical probability value described is corresponding, including:
For any one statistical probability value, according to the gray level that described statistical probability value is corresponding, determine that described gray level is corresponding The span of statistical probability value;
According to the maximum in described span and minima, described statistical probability value is adjusted;And after according to adjusting Statistical probability value, determine the initial optimization coefficient that described statistical probability value is corresponding.
4. method as claimed in claim 3, it is characterised in that the statistics described gray level being determined according to the following equation corresponding is general The span of rate value:
Max=bin+k1
Min=bin+k2
Wherein, max is the maximum in described span, and min is the minima in described span, and 0 < min < Max < 1;Bin is the Normalized Grey Level level that described statistical probability value is corresponding, and bin is more than or equal to 0 and less than or equal to 1;k1> k2
According to following equation, described statistical probability value is adjusted:
P′y=min+ (max-min) × Py
Wherein, PyFor described statistical probability value, P 'yFor the statistical probability value after adjusting, max is the maximum in described span Value, min is the minima in described span;
Initial optimization coefficient that described statistical probability value corresponding be determined according to the following equation:
A=log (p 'y)/log(bin);
Wherein, A is initial optimization coefficient, P 'yFor the statistical probability value after adjusting, bin is the normalizing that described statistical probability value is corresponding Change gray level, and bin is more than or equal to 0 and less than or equal to 1.
5. method as claimed in claim 2, it is characterised in that the described central pixel point according to described target area, determines The optimized coefficients that each initial optimization coefficient is corresponding, including:
For any one initial optimization coefficient, if gray level corresponding to described initial optimization coefficient is less than first threshold, then root According to the pixel value of the central pixel point of described target area, and the pixel of neighboring area corresponding to described central pixel point Pixel value, determines the optimized coefficients that described initial optimization coefficient is corresponding;Wherein, described neighboring area is with described central pixel point Centered by region;
For any one initial optimization coefficient, if gray level corresponding to described initial optimization coefficient is not less than first threshold, then The pixel value of the central pixel point according to described target area, determines the optimized coefficients that described initial optimization coefficient is corresponding.
6. method as claimed in claim 5, it is characterised in that the gray level corresponding at described initial optimization coefficient is less than first During threshold value, optimized coefficients that described initial optimization coefficient corresponding it is determined according to the following equation:
A '=A × m;
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;M is described surrounding zone The ratio of the pixel value of the central pixel point of the meansigma methods of the pixel value of all pixels and described target area in territory;
When the gray level that described initial optimization coefficient is corresponding is not less than first threshold, it is determined according to the following equation described the most excellent The optimized coefficients that change coefficient is corresponding:
A '=A × (1+pix_value);
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;Pix_value is for returning One change process after the pixel value of central pixel point of described target area, and pix_value more than or equal to 0 and is less than or equal to 1。
7. the method as described in as arbitrary in claim 1~6, it is characterised in that described according to each the Optimal Curve generated, with And the adjustment curve that in N-1 the gray level in addition to maximum gray scale preset, each gray level is corresponding, determine described mesh The mapping curve that mark region is corresponding, including:
The Optimal Curve corresponding according to same gray level and adjustment curve, determine the sub-mapping curve that described gray level is corresponding;
According to the sub-mapping curve that each gray level in N-1 gray level in addition to maximum gray scale is corresponding, determine described The mapping curve that target area is corresponding.
8. method as claimed in claim 7, it is characterised in that determine the mapping that described target area is corresponding according to following manner Curve:
Yout=G1(Yin)×B1(Yin)+G2(Yin)×B2(Yin)+······+GN-1(Yin)×BN-1(Yin);
Wherein, G1、G2……GN-1For described Optimal Curve, B1、B2……BN-1For described adjustment curve, YoutFor output pixel value, YinFor input pixel value;Further, at B1、B2……BN-1Input value identical time, B1、B2……BN-1Output valve sum is 1.
9. the method as described in as arbitrary in claim 1~8, it is characterised in that
If the target area that described image is corresponding is one, the most described target area is described image;
If the target area that described image is corresponding is multiple, the number of the most described target area is the individual of pixel in described image Number, and the central pixel point that each pixel is a target area in described image.
10. method as claimed in claim 9, it is characterised in that if target area corresponding to described image is multiple, in target When the subregion in region is positioned at described image outside, according to the region being positioned in described target area within described image Pixel, determines the pixel of the subregion being positioned at described picture appearance in described target area.
11. methods as claimed in claim 9, it is characterised in that described determine described target area needs carry out to process Pixel, including:
If the target area that described image is corresponding is one, it is described for needing the pixel carrying out processing in the most described target area All pixels in target area;
If the target area that described image is corresponding is multiple, it is described for needing the pixel carrying out processing in the most described target area The central pixel point of target area.
The device of 12. 1 kinds of image procossing, it is characterised in that including:
Acquisition module, for the accumulation histogram corresponding according to the target area of image, determines the N-1 in addition to maximum gray scale The statistical probability value that in individual gray level, each gray level is corresponding, wherein, described N is the gray level of described accumulation histogram Number, described N is the positive integer more than 1, and described N is less than the gray level number of described image;
Determine module, for determining the optimized coefficients that each statistical probability value described is corresponding, and according to each optimization described Coefficient, generates the Optimal Curve that described optimized coefficients is corresponding;
Control module, for each the Optimal Curve according to generation, and N-1 in addition to the maximum gray scale ash preset The adjustment curve that in degree level, each gray level is corresponding, determines the mapping curve that described target area is corresponding;
Processing module, for determining the pixel needing to carry out processing in described target area, and according to described mapping curve pair The pixel value of described pixel is adjusted.
13. devices as claimed in claim 12, it is characterised in that described determine module, specifically for:
According to the gray level that each statistical probability value is corresponding, determine the initial optimization system that each statistical probability value described is corresponding Number;According to the central pixel point of described target area, determine the optimized coefficients that each initial optimization coefficient is corresponding.
14. devices as claimed in claim 13, it is characterised in that described determine module, specifically for:
For any one statistical probability value, according to the gray level that described statistical probability value is corresponding, determine described statistical probability value Corresponding span;According to the maximum in described span and minima, described statistical probability value is adjusted;And According to the statistical probability value after adjusting, determine the initial optimization coefficient that described statistical probability value is corresponding.
15. devices as claimed in claim 14, it is characterised in that described determine module, specifically for:
The span of statistical probability value corresponding to described gray level be determined according to the following equation:
Max=bin+k1
Min=bin+k2
Wherein, max is the maximum in described span, and min is the minima in described span, and 0 < min < Max < 1;Bin is the Normalized Grey Level level that described statistical probability value is corresponding, and bin is more than or equal to 0 and less than or equal to 1;k1> k2
According to following equation, described statistical probability value is adjusted:
P′y=min+ (max-min) × Py
Wherein, PyFor described statistical probability value, P 'yFor the statistical probability value after adjusting, max is the maximum in described span Value, min is the minima in described span;
Initial optimization coefficient that described statistical probability value corresponding be determined according to the following equation:
A=log (p 'y)/log(bin);
Wherein, A is initial optimization coefficient, P 'yFor the statistical probability value after adjusting, bin is the normalizing that described statistical probability value is corresponding Change gray level, and bin is more than or equal to 0 and less than or equal to 1.
16. devices as claimed in claim 13, it is characterised in that described determine module, specifically for:
For any one initial optimization coefficient, if gray level corresponding to described initial optimization coefficient is less than first threshold, then root According to the pixel value of the central pixel point of described target area, and the pixel of neighboring area corresponding to described central pixel point Pixel value, determines the optimized coefficients that described initial optimization coefficient is corresponding;Wherein, described neighboring area is with described central pixel point Centered by region;
For any one initial optimization coefficient, if gray level corresponding to described initial optimization coefficient is not less than first threshold, then The pixel value of the central pixel point according to described target area, determines the optimized coefficients that described initial optimization coefficient is corresponding.
17. devices as claimed in claim 16, it is characterised in that described determine module, specifically for:
When the gray level that described initial optimization coefficient is corresponding is less than first threshold, described initial optimization is determined according to the following equation The optimized coefficients that coefficient is corresponding:
A '=A × m;
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;M is described surrounding zone The ratio of the pixel value of the central pixel point of the meansigma methods of the pixel value of all pixels and described target area in territory;
When the gray level that described initial optimization coefficient is corresponding is not less than first threshold, it is determined according to the following equation described the most excellent The optimized coefficients that change coefficient is corresponding:
A '=A × (1+pix_value);
Wherein, A is described initial optimization coefficient, and A ' is optimized coefficients corresponding to described initial optimization coefficient;Pix_value is for returning One change process after the pixel value of central pixel point of described target area, and pix_value more than or equal to 0 and is less than or equal to 1。
18. as arbitrary in claim 12~17 as described in device, it is characterised in that described control module, specifically for:
The Optimal Curve corresponding according to same gray level and adjustment curve, determine the sub-mapping curve that described gray level is corresponding;Root According to the sub-mapping curve that each gray level in N-1 gray level in addition to maximum gray scale is corresponding, determine described target area The mapping curve that territory is corresponding.
19. devices as claimed in claim 18, it is characterised in that described control module, specifically for:
The mapping curve that described target area is corresponding is determined according to following manner:
Yout=G1(Yin)×B1(Yin)+G2(Yin)×B2(Yin)+······+GN-1(Yin)×BN-1(Yin);
Wherein, G1、G2……GN-1For described Optimal Curve, B1、B2……BN-1For described adjustment curve, YoutFor output pixel value, YinFor input pixel value;Further, at B1、B2……BN-1Input value identical time, B1、B2……BN-1Output valve sum is 1.
20. as arbitrary in claim 12~19 as described in device, it is characterised in that
If the target area that described image is corresponding is one, the most described target area is described image;
If the target area that described image is corresponding is multiple, the number of the most described target area is the individual of pixel in described image Number, and the central pixel point that each pixel is a target area in described image..
21. devices as claimed in claim 20, it is characterised in that described acquisition module, are additionally operable to:
If the target area that described image is corresponding is multiple, when being positioned at described image outside in the subregion of target area, According to the pixel in the region being positioned in described target area within described image, determine and described target area is positioned at described figure The pixel of the subregion outside Xiang.
22. devices as claimed in claim 20, it is characterised in that described processing module, specifically for:
If the target area that described image is corresponding is one, it is described for needing the pixel carrying out processing in the most described target area All pixels in target area;
If the target area that described image is corresponding is multiple, it is described for needing the pixel carrying out processing in the most described target area The central pixel point of target area.
CN201610456890.6A 2016-06-21 2016-06-21 A kind of method and device of image procossing Active CN106097286B (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
CN201610456890.6A CN106097286B (en) 2016-06-21 2016-06-21 A kind of method and device of image procossing
PCT/CN2017/089192 WO2017219962A1 (en) 2016-06-21 2017-06-20 Systems and methods for image processing
EP17814700.5A EP3459043A4 (en) 2016-06-21 2017-06-20 Systems and methods for image processing
US16/219,907 US11094045B2 (en) 2016-06-21 2018-12-13 Systems and methods for image processing
US17/342,695 US20210295480A1 (en) 2016-06-21 2021-06-09 Systems and methods for image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610456890.6A CN106097286B (en) 2016-06-21 2016-06-21 A kind of method and device of image procossing

Publications (2)

Publication Number Publication Date
CN106097286A true CN106097286A (en) 2016-11-09
CN106097286B CN106097286B (en) 2019-02-12

Family

ID=57238877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610456890.6A Active CN106097286B (en) 2016-06-21 2016-06-21 A kind of method and device of image procossing

Country Status (1)

Country Link
CN (1) CN106097286B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017219962A1 (en) * 2016-06-21 2017-12-28 Zhejiang Dahua Technology Co., Ltd. Systems and methods for image processing
CN110533609A (en) * 2019-08-16 2019-12-03 域鑫科技(惠州)有限公司 Image enchancing method, device and storage medium suitable for endoscope
CN111050211A (en) * 2019-12-13 2020-04-21 广州酷狗计算机科技有限公司 Video processing method, device and storage medium
CN113191990A (en) * 2021-05-28 2021-07-30 浙江宇视科技有限公司 Image processing method and device, electronic equipment and medium
CN113411511A (en) * 2021-06-29 2021-09-17 中国科学院长春光学精密机械与物理研究所 High frame frequency imaging system image preprocessing method based on histogram analysis

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005323926A (en) * 2004-05-17 2005-11-24 Ge Medical Systems Global Technology Co Llc Method for processing image, image processor, and x-ray ct apparatus
CN101980521A (en) * 2010-11-23 2011-02-23 华亚微电子(上海)有限公司 Image sharpening method and related device
CN104021531A (en) * 2014-06-18 2014-09-03 厦门美图之家科技有限公司 Improved method for enhancing dark environment images on basis of single-scale Retinex
CN105376498A (en) * 2015-10-16 2016-03-02 凌云光技术集团有限责任公司 Image processing method and system for expanding dynamic range of camera

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005323926A (en) * 2004-05-17 2005-11-24 Ge Medical Systems Global Technology Co Llc Method for processing image, image processor, and x-ray ct apparatus
CN101980521A (en) * 2010-11-23 2011-02-23 华亚微电子(上海)有限公司 Image sharpening method and related device
CN104021531A (en) * 2014-06-18 2014-09-03 厦门美图之家科技有限公司 Improved method for enhancing dark environment images on basis of single-scale Retinex
CN105376498A (en) * 2015-10-16 2016-03-02 凌云光技术集团有限责任公司 Image processing method and system for expanding dynamic range of camera

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017219962A1 (en) * 2016-06-21 2017-12-28 Zhejiang Dahua Technology Co., Ltd. Systems and methods for image processing
US11094045B2 (en) 2016-06-21 2021-08-17 Zhejiang Dahua Technology Co., Ltd. Systems and methods for image processing
CN110533609A (en) * 2019-08-16 2019-12-03 域鑫科技(惠州)有限公司 Image enchancing method, device and storage medium suitable for endoscope
CN110533609B (en) * 2019-08-16 2022-05-27 域鑫科技(惠州)有限公司 Image enhancement method, device and storage medium suitable for endoscope
CN111050211A (en) * 2019-12-13 2020-04-21 广州酷狗计算机科技有限公司 Video processing method, device and storage medium
CN111050211B (en) * 2019-12-13 2021-10-26 广州酷狗计算机科技有限公司 Video processing method, device and storage medium
CN113191990A (en) * 2021-05-28 2021-07-30 浙江宇视科技有限公司 Image processing method and device, electronic equipment and medium
CN113411511A (en) * 2021-06-29 2021-09-17 中国科学院长春光学精密机械与物理研究所 High frame frequency imaging system image preprocessing method based on histogram analysis
CN113411511B (en) * 2021-06-29 2022-05-17 中国科学院长春光学精密机械与物理研究所 High frame frequency imaging system image preprocessing method based on histogram analysis

Also Published As

Publication number Publication date
CN106097286B (en) 2019-02-12

Similar Documents

Publication Publication Date Title
CN106097286A (en) A kind of method and device of image procossing
US9218653B2 (en) Method and apparatus for dynamic range enhancement of an image
CN101483711B (en) Gradation correction device, gradation correction method
WO2020038124A1 (en) Image contrast enhancement method and apparatus, and device and storage medium
CN105719611B (en) The show uniformity method of adjustment and device of liquid crystal display
CN104519281B (en) The processing method and processing unit of a kind of image
CN104620280A (en) Image processing device, image display device, image capture device, image printing device, gradation conversion method, and program
US8165419B2 (en) Histogram stretching apparatus and histogram stretching method for enhancing contrast of image
US7142724B2 (en) Apparatus and method to enhance a contrast using histogram matching
CN101916431B (en) Low-illumination image data processing method and system
US8781225B2 (en) Automatic tone mapping method and image processing device
CN105323459B (en) Image processing method and mobile terminal
US9396526B2 (en) Method for improving image quality
CN107680056A (en) A kind of image processing method and device
CN102496152A (en) Self-adaptive image contrast enhancement method based on histograms
CN104869332B (en) A kind of adaptive multiple slope integration adjusting method
CN101719989A (en) Method and system for backlight compensation
US9113085B2 (en) Apparatus for controlling exposure amount of an imaging device
CN109447915B (en) Line scanning image quality improving method based on characteristic model establishment and gamma gray correction
US20190172186A1 (en) Image tuning device and method
KR20180035863A (en) Image contrast enhancement method
CN108460730A (en) A kind of image processing method and its device
CN104954696A (en) Automatic EMCCD gain adjusting method
CN104115490A (en) Video image display device and television receiving device
CN107068042B (en) Image processing method

Legal Events

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