Summary of the invention
The problem that technical solution of the present invention solves is that the existing calculated amount that digital picture is repaired is big, and repairing effect is not good.
For addressing the above problem, the embodiment of the invention provides a kind of restorative procedure of image, comprising: add up the characteristic parameter of each pixel, to set up the histogram of image; Determine the characteristic parameter segmentation threshold in zone based on described histogram; According to the characteristic parameter segmentation threshold described image is divided into background area and contaminated area; Based on the average of the characteristic parameter of the average of the characteristic parameter of described contaminated area, described background area and the characteristic parameter that variance is adjusted pixel in the described contaminated area.
Alternatively, described image is gray level image, and described characteristic parameter is gray-scale value.
Alternatively, described image is coloured image, and described characteristic parameter is luminance component or chromatic component, perhaps luminance component and chromatic component.
Alternatively, described characteristic parameter segmentation threshold comprises that characteristic parameter is cut apart the upper limit and characteristic parameter is cut apart lower limit, and described contaminated area comprises bright contaminated area and dark contaminated area; The characteristic parameter of the pixel of described bright contaminated area is higher than described characteristic parameter and cuts apart the upper limit; The characteristic parameter of the pixel of described dark contaminated area is lower than described characteristic parameter and cuts apart lower limit.
Alternatively, the characteristic parameter of the pixel of described background area is less than or equal to the characteristic parameter segmentation threshold; The characteristic parameter of the pixel of described contaminated area is higher than the characteristic parameter segmentation threshold.
Alternatively, the characteristic parameter of the pixel of described background area is greater than or equal to the characteristic parameter segmentation threshold; The characteristic parameter of the pixel of described contaminated area is lower than the characteristic parameter segmentation threshold.
Alternatively, the average of described characteristic parameter
The variance of described characteristic parameter
Wherein, Ti is the characteristic parameter of i pixel, and N is the number of pixel.
Alternatively, when
The time, according to
Adjust the characteristic parameter of pixel in the described contaminated area, wherein, T
OldThe characteristic parameter of pixel before adjustment for described contaminated area; T
NewThe characteristic parameter of pixel after adjustment for described contaminated area;
Average for the characteristic parameter of described contaminated area pixel before adjusting;
Average for the characteristic parameter of described background area pixel; σ
BkgVariance for the characteristic parameter of described background area pixel; α is for recovering intensity factor.
Alternatively, when
The time, according to
Adjust the characteristic parameter of pixel in the described contaminated area, wherein, T
OldThe characteristic parameter of pixel before adjustment for described contaminated area; T
NewThe characteristic parameter of pixel after adjustment for described contaminated area;
Average for the characteristic parameter of described contaminated area pixel before adjusting;
Average for the characteristic parameter of described background area pixel; σ
BkgVariance for the characteristic parameter of described background area pixel; α is for recovering intensity factor.
Alternatively, described recovery intensity factor α represents the characteristic parameter difference degree of described contaminated area and described background area, and described recovery intensity factor α span is [1,3].
Correspondingly, the embodiment of the invention also provides a kind of prosthetic device of image, comprising:
Histogram is set up the unit, is used for the characteristic parameter of each pixel of statistics, to set up the histogram of image;
The segmentation threshold determining unit is used for setting up the characteristic parameter segmentation threshold that the histogram of setting up the unit is determined the zone according to described histogram;
The Region Segmentation unit is used for according to the characteristic parameter segmentation threshold that described segmentation threshold determining unit is determined described image being divided into background area and contaminated area;
The characteristic parameter adjustment unit is used for adjusting the characteristic parameter that described contaminated area needs the pixel repaired based on the average of the characteristic parameter of the average of the characteristic parameter of described contaminated area, described background area and variance.
Correspondingly, the embodiment of the invention also provides a kind of terminal, comprises the prosthetic device of described image.
With respect to prior art, technical solution of the present invention has proposed based on statistics with histogram characteristic split image zone, utilizes background area to repair restorative procedure and the device of the image of contaminated area, has following beneficial effect:
With repeatedly interative computation is different in pointwise traversal need reparation district and the iteration theory of adjustment in the textural characteristics matching method, technical scheme of the present invention has been utilized the statistics with histogram characteristic, image is divided into background area and contaminated area, utilize the statistical property of the characteristic parameter of background area to adjust the characteristic parameter of the pixel of contaminated area, to repair the contaminated area, this recovery technique based on the zone has significantly reduced calculated amount, simple and fast during realization, possesses stronger adaptive ability, can be applicable to the occasion that handling property is lower, as mobile-terminal platform etc.
Can avoid the conventional images restorative procedure based on the image repair technology in zone is that unit repairs that the local color that causes is inconsistent to influence whole impression with the pixel, has guaranteed regional whole consistance, natural texture details impression in the reserve area.
Embodiment
At prior art problems, the inventor provides the restorative procedure of the image of the characteristic parameter that a kind of statistics with histogram characteristic based on the zone adjusts the contaminated area through research.Fig. 1 is the schematic flow sheet of embodiment of the restorative procedure of a kind of image of the present invention.Please refer to Fig. 1, the restorative procedure of the described image of technical solution of the present invention comprises:
Step S1: add up the characteristic parameter of each pixel, to set up the histogram of image;
Step S2: the characteristic parameter segmentation threshold of determining the zone based on described histogram;
Step S3: described image is divided into background area and contaminated area according to the characteristic parameter segmentation threshold;
Step S4: adjust the characteristic parameter that needs the pixel repaired in the described contaminated area based on the average of the characteristic parameter of the average of the characteristic parameter of described contaminated area, described background area and variance.
The average of described characteristic parameter
The variance of described characteristic parameter
Wherein, Ti is the characteristic parameter of i pixel, and N is the number of pixel.For background area, the average of described characteristic parameter
The variance of described characteristic parameter
Wherein, Ti is the characteristic parameter of i pixel of described background area, and N is the number of the pixel of described background area; For the contaminated area, the average of described characteristic parameter
The variance of described characteristic parameter
Wherein, Ti is the characteristic parameter of i the pixel in described contaminated area, and N is the number of the pixel of described contaminated area.
In one embodiment, described characteristic parameter segmentation threshold comprises that characteristic parameter is cut apart the upper limit and characteristic parameter is cut apart lower limit, and described contaminated area comprises bright contaminated area and dark contaminated area; The characteristic parameter of the pixel of described bright contaminated area is higher than described characteristic parameter and cuts apart the upper limit; The characteristic parameter of the pixel of described dark contaminated area is lower than described characteristic parameter and cuts apart lower limit.
In another kind of embodiment, the characteristic parameter of the pixel of described background area is less than or equal to the characteristic parameter segmentation threshold; The characteristic parameter of the pixel of described contaminated area is higher than the characteristic parameter segmentation threshold.
In another embodiment, the characteristic parameter of the pixel of described background area is greater than or equal to the characteristic parameter segmentation threshold; The characteristic parameter of the pixel of described contaminated area is lower than the characteristic parameter segmentation threshold.
Described image can be gray level image, and described characteristic parameter can be gray-scale value.For gray level image, described step S1 statistics comprises the intensity profile in the entire image zone of poluted region.Grey level histogram (histogram) is the function of gray level, has the number of the pixel of every kind of gray level in its presentation video, every kind of frequency that gray scale occurs in the reflection image.The horizontal ordinate of grey level histogram is gray level, and ordinate is the frequency that this gray level occurs, and is the most basic statistical nature of image.
Described image also can be coloured image, and namely described characteristic parameter is luminance component or chromatic component, perhaps luminance component and chromatic component.Color histogram is the histogrammic special case of higher-dimension, the frequency of occurrences of its statistics color, the i.e. probability distribution information of color.Usually this needs certain quantizing process, color is divided into the kind of some non-overlapping copies.Generally directly in rgb color space, do not add up, but after brightness is separated, the information that represents color part is added up, as in the HS subspace in HSI space, the UV subspace of yuv space, and carry out in the color space representation of other reflection human vision characteristics.For coloured image and since human eye to the perception of field color not as the brightness sensitivity, therefore described step S1 can only add up luminance component, described luminance component such as Y passage are adjusted to step S4 according to step S2, and Color Channel is constant again; Can certainly be respectively with brightness Y, color component U and V adjust to step S4 according to step S1.Concrete adjustment mode will be described in following embodiment.
Embodiment one
Present embodiment is that example describes with the gray level image, please refer to Fig. 2, and Fig. 2 is the example schematic that needs to repair image-region in the embodiment of restorative procedure of a kind of image of the present invention.Wherein the gray area in district accounts for major part as a setting, and the contaminated part of black and white region representation is carried out its gray scale to be adjusted to when image-region is repaired and is close to consistently with the background area, whole zone is looked like spare matter.Need to prove that Fig. 2 is a kind of signal, levels such as actual grey, white can change within the specific limits, and transition therebetween neither clearly occupy the majority but totally still show as background, contaminated is minority, and be distributed in the background area brighter or darker two extreme.
Step S1: at first add up the intensity profile of each pixel in the whole zone that comprises the poluted region, set up the histogram of described gray level image.
Step S2: according to the statistical conditions of background area the most intensive in the histogram, can determine the gray scale segmentation threshold of poluted region.Please refer to Fig. 3, Fig. 3 is the statistics with histogram synoptic diagram of image in the specific embodiment of the present invention.The bound of Region Segmentation is determined method as can be seen from Figure 3, among the figure, the gray-scale value of described dark contaminated area central point is the highest gray-scale value of this dark contaminated area frequency of occurrences of described image, the gray-scale value of background area central point is the highest gray-scale value of this background area frequency of occurrences, and the gray-scale value of bright contaminated area central point is the highest gray-scale value of this bright contaminated area frequency of occurrences.From the background area central point, seek the upper and lower bound that the minimal value flex point can draw the entire image Region Segmentation respectively toward both sides, the left and right sides.Concrete Digital Implementation can adopt the digital difference of statistics with histogram to assign to finish, and minimal value flex point place difference near-zero and its value are worth less than the left and right sides.In the present embodiment, described gray scale segmentation threshold can comprise that gray scale is cut apart the upper limit and gray scale is cut apart lower limit.
Step S3: described gray level image is divided into background area and contaminated area according to the gray scale segmentation threshold.In conjunction with Fig. 2 and Fig. 3, cut apart the upper limit and gray scale is cut apart lower limit according to the gray scale that obtains among the step S2, the whole zone of described gray level image can be divided into background area (gray area of Fig. 2), bright contaminated area (white portion of Fig. 2) and dark contaminated area (black region of Fig. 2).The gray values of pixel points that described bright contaminated area is white portion is higher than described gray scale and cuts apart the upper limit; The gray values of pixel points that described dark contaminated area is black region is lower than described gray scale and cuts apart lower limit, and described background area is that the gray values of pixel points of gray area is cut apart the upper limit and described gray scale is cut apart between the lower limit between described gray scale.
Need to prove that for gray level image, bright contaminated area and dark contaminated area are uninevitable to be existed simultaneously.Following two kinds of situations also might appear, that is, and and first kind of situation, the gray values of pixel points of described background area is less than or equal to the gray scale segmentation threshold, the gray values of pixel points of described contaminated area is higher than the gray scale segmentation threshold, and this moment, described contaminated area only comprised bright contaminated area, did not have dark contaminated area; Second kind of situation, the gray values of pixel points of described background area is greater than or equal to the gray scale segmentation threshold, and the gray values of pixel points of described contaminated area is lower than the gray scale segmentation threshold, and this moment, described contaminated area only comprised dark contaminated area, and did not have bright contaminated area.
Step S4: based on average, the gray-scale value of described background area and the gray scale of the pixel that variance is adjusted described contaminated area of the gray scale of described contaminated area.Particularly:
Step S41: calculate described average and variance.
According to the computing formula of above-mentioned average and variance, can draw:
The average of the gray scale of all pixels of background area
The variance of the gray scale of all pixels of background area
Wherein, Gi is i gray values of pixel points of described background area, and N is the number of described background area pixel.The average of the gray scale of all pixels of contaminated area is
Wherein, Gi is i the gray values of pixel points in described contaminated area, and N is the number of described contaminated area pixel.
Step S42: judge the pixel that needs reparation in the contaminated area.
The default intensity factor α that recovers, the extreme Polluted area that described recovery intensity factor α characterizes and the background area gray scale differs in much extent and scopes will be repaired in the present embodiment.Recover intensity factor α and depend on the described contaminated area of need reparation and the gray difference degree of described background area, described recovery intensity factor α span is [1,3], for example can be 1.0,1.2,1.5,1.8,2.0,2.2,2.5,2.8,3.0 etc., difference is more big, and value should be more big.
When
Or
The time, judging that the gray difference of pixel of the gray scale of this pixel in the described contaminated area and described background area is excessive, need repair; When
Judge that then the gray difference of pixel in the gray scale of this pixel in the described contaminated area and the described background area in the tolerable scope, does not need to repair.
Step S43 adjusts the gray scale that needs the pixel of reparation in the described contaminated area.
When
The time, according to
Adjust the pixel gray-scale value that needs reparation in the described contaminated area, wherein, G
OldThe gray-scale value of pixel before adjustment for described contaminated area; G
NewThe gray-scale value of pixel after adjustment for described contaminated area;
Average for the gray scale of described contaminated area before adjusting;
Average for the gray scale of described background area; σ
BkgVariance for the gray scale of described background area pixel; α is recovery intensity factor default among the step S42; Abs represents to ask absolute value.
When
The time, according to
Adjust the gray values of pixel points that needs reparation in the described contaminated area, wherein, G
OldThe gray-scale value of pixel before adjustment for described contaminated area; G
NewThe gray-scale value of pixel after adjustment for described contaminated area;
Average for the gray scale of described contaminated area before adjusting;
Average for the gray scale of described background area; σ
BkgVariance for the gray scale of described background area pixel; α is recovery intensity factor default among the step S42; Abs represents to ask absolute value.
So far, the described gray level image reparation of present embodiment is finished, and whole zone looks like even matter.
Embodiment two
Present embodiment is that example describes with the coloured image and since human eye to the perception of field color not as the brightness sensitivity, so present embodiment is only adjusted the contaminated area of image according to the statistics of luminance component.
Step S1: at first add up the luminance component of each pixel in the whole zone that comprises the poluted region, set up the brightness histogram of described coloured image.
Step S2: according to the statistical conditions of background area the most intensive in the described brightness histogram, can determine the brightness segmentation threshold of poluted region.In the present embodiment, described brightness segmentation threshold can comprise that the upper limit is cut apart in brightness and lower limit is cut apart in brightness.
Step S3: described color images is become background area and contaminated area according to the brightness segmentation threshold.Cut apart the upper limit and lower limit is cut apart in brightness according to the brightness that obtains among the step S2, the whole zone of described luminance picture can be divided into background area, bright contaminated area and dark contaminated area; The brightness value of the pixel of described bright contaminated area is higher than described brightness and cuts apart the upper limit; The brightness value of the pixel of described dark contaminated area is lower than described brightness and cuts apart lower limit, and the brightness value of the pixel of described background area is cut apart the upper limit and described brightness is cut apart between the lower limit between described brightness.
Need to prove that equally for described coloured image, bright contaminated area and dark contaminated area are uninevitable to be existed simultaneously.Following two kinds of situations also might appear, that is, and and first kind of situation, the brightness value of the pixel of described background area is less than or equal to the brightness segmentation threshold, the brightness value of the pixel of described contaminated area is higher than the brightness segmentation threshold, and this moment, described contaminated area only comprised bright contaminated area, did not have dark contaminated area; Second kind of situation, the brightness value of the pixel of described background area is greater than or equal to the brightness segmentation threshold, and the brightness value of the pixel of described contaminated area is lower than the brightness segmentation threshold, and this moment, described contaminated area only comprised dark contaminated area, and did not have bright contaminated area.
Step S4: based on the average of the brightness of the brightness value of described contaminated area and described background area and the brightness of the pixel that variance is adjusted described contaminated area, particularly:
Step S41: calculate described average and variance.
According to the computing formula of above-mentioned average and variance, can draw:
The average of the brightness of all pixels of background area
The variance of the brightness of all pixels of background area
Wherein, Yi is the brightness value of i pixel of described background area, and N is the number of described background area pixel.
The average of the brightness of all pixels of contaminated area is
Wherein, Yi is the brightness value of i the pixel in described contaminated area, and N is the number of described contaminated area pixel.
Step S42: judge the pixel that needs reparation in the contaminated area.
The default intensity factor α that recovers, the extreme Polluted area that described recovery intensity factor α characterizes and background area brightness differs in much extent and scopes will be repaired in the present embodiment.Recover intensity factor α and depend on the described contaminated area of need reparation and the luminance difference degree of described background area, described recovery intensity factor α span is [1,3], for example can be 1.0,1.2,1.5,1.8,2.0,2.2,2.5,2.8,3.0 etc., difference is more big, and value should be more big.
When
Or
The time, judging that the luminance difference of pixel of the brightness of this pixel in the described contaminated area and described background area is excessive, need repair; When
Judge that then the luminance difference of pixel in the brightness of this pixel in the described contaminated area and the described background area in the tolerable scope, does not need to repair.
Step S43 adjusts the brightness that needs the pixel of reparation in the described contaminated area.
When
The time, according to
Adjust the pixel brightness value that needs reparation in the described contaminated area, wherein, Y
OldThe brightness value of pixel before adjustment for described contaminated area; Y
NewThe brightness value of pixel after adjustment for described contaminated area;
Average for the brightness of described contaminated area pixel before adjusting;
Average for the brightness of described background area pixel; σ
BkgVariance for the brightness of described background area pixel; α is recovery intensity factor default among the step S42; Abs represents to ask absolute value.
When
The time, according to
Adjust the brightness value that needs the pixel of reparation in the described contaminated area, wherein, Y
OldThe brightness value of pixel before adjustment for described contaminated area; Y
NewThe brightness value of pixel after adjustment for described contaminated area;
Average for the brightness of described contaminated area pixel before adjusting;
Average for the brightness of described background area pixel; σ
BkgVariance for the brightness of described background area pixel; α is recovery intensity factor default among the step S42; Abs represents to ask absolute value.
So far, the described luminance picture reparation of present embodiment is finished, and whole zone looks like even matter, keeps the trickle texture variations of himself simultaneously, and whole zone so brightness are consistent and be no lack of the natural texture impression.
Embodiment three
Present embodiment is that example describes with the coloured image of YUV color space, in the present embodiment not only according to luminance component, also according to the statistics of chromatic component the contaminated area of image is adjusted simultaneously.
In the YUV color space, luminance component Y separates with chromatic component U, V.Do not have U, V component if having only the Y component, the figure of expression is exactly the black and white gray-scale map so like this.Adopt yuv space can solve the compatibling problem of colour television set and black and white television set with luminance component Y as color TV, make black and white television set also can receive colour signal.
The restorative procedure of luminance component Y is identical with method described in the embodiment two in the present embodiment coloured image, and this does not give unnecessary details.Can be respectively adjust to step S4 according to step S1 for chromatic component U and V.Below be that example describes in detail with chromatic component U.
Step S1: at first add up the chromatic component U of each pixel in the whole zone that comprises the poluted region, set up the colourity U histogram of described coloured image.
Step S2: according to the statistical conditions of background area the most intensive in the described colourity U histogram, can determine the colourity U segmentation threshold of poluted region.In the present embodiment, described colourity U segmentation threshold can comprise that colourity U is cut apart the upper limit and colourity U is cut apart lower limit.
Step S3: described color images is become background area and contaminated area according to colourity U segmentation threshold.Cut apart the upper limit and colourity U is cut apart lower limit according to the colourity U that obtains among the step S2, the whole zone of described colourity U image can be divided into background area, bright contaminated area and dark contaminated area; The colourity U value of the pixel of described bright contaminated area is higher than described colourity U and cuts apart the upper limit; The colourity U value of the pixel of described dark contaminated area is lower than described colourity U and cuts apart lower limit, and the colourity U value of the pixel of described background area is cut apart the upper limit and described colourity U is cut apart between the lower limit between described colourity U.
Need to prove that equally for described coloured image, bright contaminated area and dark contaminated area are uninevitable to be existed simultaneously.Following two kinds of situations also might appear, namely, first kind of situation, the colourity U value of the pixel of described background area is less than or equal to colourity U segmentation threshold, the colourity U value of the pixel of described contaminated area is higher than colourity U segmentation threshold, this moment, described contaminated area only comprised bright contaminated area, did not have dark contaminated area; Second kind of situation, the colourity U value of the pixel of described background area is greater than or equal to colourity U segmentation threshold, and the colourity U value of the pixel of described contaminated area is lower than colourity U segmentation threshold, and this moment, described contaminated area only comprised dark contaminated area, and did not have bright contaminated area.
Step S4: based on the average of the colourity U of the colourity U value of described contaminated area and described background area and the colourity U of the pixel that variance is adjusted described contaminated area, particularly:
Step S41: calculate described average and variance.
According to the computing formula of above-mentioned average and variance, can draw:
The average of the colourity U of all pixels of background area
The variance of the colourity U of all pixels of background area
Wherein, Ui is the colourity U value of i pixel of described background area, and N is the number of described background area pixel.
The average of the colourity U of all pixels of contaminated area is
Wherein, Ui is the colourity U value of i the pixel in described contaminated area, and N is the number of described contaminated area pixel.
Step S42: judge the pixel that needs reparation in the contaminated area.
The default intensity factor α that recovers, the extreme Polluted area that described recovery intensity factor α characterizes and background area colourity U differs in much extent and scopes will be repaired in the present embodiment.Recover intensity factor α and depend on the described contaminated area of need reparation and the colourity U difference degree of described background area, described recovery intensity factor α span is [1,3], for example can be 1.0,1.2,1.5,1.8,2.0,2.2,2.5,2.8,3.0 etc., difference is more big, and value should be more big.
When
Or
The time, judging that the colourity U difference of pixel of the colourity U of this pixel in the described contaminated area and described background area is excessive, need repair; When
Judge that then the colourity U difference of pixel in the colourity U of this pixel in the described contaminated area and the described background area in the tolerable scope, does not need to repair.
Step S43 adjusts the colourity U that needs the pixel of reparation in the described contaminated area.
When
The time, according to
Adjust the pixel colourity U value that needs reparation in the described contaminated area, wherein, U
OldThe colourity U value of pixel before adjustment for described contaminated area; U
NewThe colourity U value of pixel after adjustment for described contaminated area;
Average for the colourity U of described contaminated area pixel before adjusting;
Average for the colourity U of described background area pixel; σ
BkgVariance for the colourity U of described background area pixel; α is recovery intensity factor default among the step S42; Abs represents to ask absolute value.
When
The time, according to
Adjust the chromatic value that needs the pixel of reparation in the described contaminated area, wherein, U
OldThe chromatic value of pixel before adjustment for described contaminated area; U
NewThe chromatic value of pixel after adjustment for described contaminated area;
Average for the colourity of described contaminated area pixel before adjusting;
Average for the colourity of described background area pixel; σ
BkgVariance for the colourity U of described background area pixel; α is recovery intensity factor default among the step S42; Abs represents to ask absolute value.
Restorative procedure for the reparation of the colourity V of described coloured image and above-mentioned colourity U is similar, will not give unnecessary details.
So far, the described coloured image reparation of present embodiment is finished, owing to based on the zone luminance component and the chromatic component of the pixel in image contamination district are adjusted respectively, make that the repairing effect of image is better, whole zone looks like even matter, the trickle texture variations that keeps himself simultaneously, whole zone so colourity are consistent and be no lack of the natural texture impression.
Correspondingly, technical solution of the present invention also provides a kind of prosthetic device of image, this device is that repair on the basis with region unit in the image, has improved whole impression and speed that digital picture is repaired, and the digital picture that is suitable for the low occasion of processor performance is repaired demand.Be elaborated below in conjunction with the prosthetic device of instantiation to image.
With reference to shown in Figure 4, a kind of embodiment of the prosthetic device 1 of a kind of image of the present invention can comprise:
Histogram is set up unit 11, is used for the characteristic parameter of each pixel of statistics, to set up the histogram of image;
Segmentation threshold determining unit 12 is used for setting up the characteristic parameter segmentation threshold that the histogram of setting up unit 11 is determined the zone based on described histogram;
Region Segmentation unit 13 is used for according to the characteristic parameter segmentation threshold that described segmentation threshold determining unit 12 is determined described image being divided into background area and contaminated area;
Characteristic parameter adjustment unit 14 is used for adjusting the characteristic parameter that described contaminated area needs the pixel repaired based on the average of the characteristic parameter of the average of the characteristic parameter of described contaminated area, described background area and variance.
As previously mentioned, described image can be gray level image, and this moment, described characteristic parameter was gray-scale value.Described image also can be coloured image, and described characteristic parameter is luminance component or chromatic component, perhaps luminance component and chromatic component.
In one embodiment, described characteristic parameter segmentation threshold comprises that characteristic parameter is cut apart the upper limit and characteristic parameter is cut apart lower limit, and described contaminated area comprises bright contaminated area and dark contaminated area; The characteristic parameter of the pixel of described bright contaminated area is higher than described characteristic parameter and cuts apart the upper limit; The characteristic parameter of the pixel of described dark contaminated area is lower than described characteristic parameter and cuts apart lower limit.
In another kind of embodiment, the characteristic parameter of the pixel of described background area is less than or equal to the characteristic parameter segmentation threshold; The characteristic parameter of the pixel of described contaminated area is higher than the characteristic parameter segmentation threshold.
In another embodiment, the characteristic parameter of the pixel of described background area is greater than or equal to the characteristic parameter segmentation threshold; The characteristic parameter of the pixel of described contaminated area is lower than the characteristic parameter segmentation threshold.
In one embodiment, please refer to Fig. 5, Fig. 5 is the structural representation of characteristic parameter adjustment unit in the embodiment of prosthetic device of a kind of image of the present invention, and described characteristic parameter adjustment unit 14 can comprise:
Average and variance computation subunit 141 are used for calculating described average and variance;
Judge subelement 142, be used for judging that according to the result of calculation of described average and variance computation subunit 141 contaminated area needs the pixel of repairing;
Adjust subelement 143, be used for adjusting the characteristic parameter that described contaminated area needs the pixel of reparation.
In described average and
variance computation subunit 141, the average of described characteristic parameter
The variance of described characteristic parameter
Wherein, Ti is the characteristic parameter of i pixel, and N is the number of pixel.For background area, the average of described characteristic parameter
The variance of described characteristic parameter
Wherein, Ti is the characteristic parameter of i pixel of described background area, and N is the number of the pixel of described background area; For the contaminated area, the average of described characteristic parameter
The variance of described characteristic parameter
Wherein, Ti is the characteristic parameter of i the pixel in described contaminated area, and N is the number of the pixel of described contaminated area.
In described
judgement subelement 142, the default intensity factor α that recovers.Described recovery intensity factor α characterizes the extreme Polluted area that differs in much extent and scopes with the background area characteristic parameter and will be repaired.Recover intensity factor α and depend on the described contaminated area of need reparation and the characteristic parameter difference degree of described background area, described recovery intensity factor α span is [1,3], for example can be 1.0,1.2,1.5,1.8,2.0,2.2,2.5,2.8,3.0 etc., difference is more big, and value should be more big.When
Or
The time, judging that the characteristic parameter difference of pixel of the characteristic parameter of this pixel in the described contaminated area and described background area is excessive, need repair; When
Judge that then the characteristic parameter difference of pixel in the characteristic parameter of this pixel in the described contaminated area and the described background area in the tolerable scope, does not need to repair.
For described
adjustment subelement 143, in one embodiment, when
The time, described characteristic
parameter adjustment unit 14 bases
Adjust the characteristic parameter of described contaminated area, wherein, T
OldThe characteristic parameter of pixel before adjustment for described contaminated area; T
NewThe characteristic parameter of pixel after adjustment for described contaminated area;
Average for the characteristic parameter of described contaminated area pixel before adjusting;
Average for the characteristic parameter of described background area pixel; σ
BkgVariance for the characteristic parameter of described background area pixel; α is described recovery intensity factor; Abs represents to ask absolute value.
In one embodiment, when
The time, described characteristic
parameter adjustment unit 14 bases
Adjust described contaminated area characteristic parameter, wherein, T
OldThe characteristic parameter of pixel before adjustment for described contaminated area; T
NewThe characteristic parameter of pixel after adjustment for described contaminated area;
Average for the characteristic parameter of described contaminated area pixel before adjusting;
Average for the characteristic parameter of described background area pixel; σ
BkgVariance for the characteristic parameter of described background area pixel; α is described recovery intensity factor; Abs represents to ask absolute value.
Correspondingly, technical solution of the present invention also provides a kind of terminal, comprises the prosthetic device of described image.Described terminal can be portable terminal, panel computer, car-mounted terminal etc.
In one embodiment, described terminal can also comprise image acquisition unit.Described image acquisition unit can be to be directly used in the camera of gathering image, also can be can with the receiving end of other foreign mediums or devices communicating.After described image acquisition unit obtains image, original image is sent to the prosthetic device of described image, this device is that repair on the basis with region unit in the image.
In one embodiment, described terminal can also comprise display unit.Described display unit can be used for the image that the described image acquisition unit of demonstration obtains, and also can be used for showing the image after described treatment of picture device is repaired.
In sum, a kind of image repair method, device and terminal that the embodiment of the invention proposes have been utilized statistics with histogram characteristic split image zone, and repair the contaminated area based on background area.This image repair technology based on the zone has significantly reduced calculated amount, and simple and fast during realization possesses stronger adaptive ability, can be applicable to the occasion that handling property is lower, as mobile-terminal platform etc.; Simultaneously, having avoided the conventional images restorative procedure is that unit repairs that the local color that causes is inconsistent to influence whole impression with the pixel, has guaranteed regional whole consistance, natural texture details impression in the reserve area.
Though the present invention with preferred embodiment openly as above; but it is not to limit the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; can utilize method and the technology contents of above-mentioned announcement that technical solution of the present invention is made possible change and modification; therefore; every content that does not break away from technical solution of the present invention; to any simple modification, equivalent variations and modification that above embodiment does, all belong to the protection domain of technical solution of the present invention according to technical spirit of the present invention.