Embodiment
For problems of the prior art, a kind of scheme of brand-new removal noise is proposed among the present invention, namely in conjunction with the former frame image of current frame image, adopt three-dimensional median filtering method to remove noise.
For make technical scheme of the present invention clearer, understand, referring to the accompanying drawing embodiment that develops simultaneously, scheme of the present invention is described in further detail.
Fig. 1 is the flow chart that the present invention removes the embodiment of the method for noise.In the present embodiment, receive successively each two field picture of input, and from the 2nd two field picture that receives, be the pixel Y of (x, y) for each coordinate among every two field picture M, process according to mode shown in Figure 1 respectively.
Step 11: determine that coordinate is the relative coefficient of the pixel YF of (x, y) among the former frame image N of pixel Y and image M; From image N, select three zones that comprise pixel YF, absolute value diff_Y_YFL, diff_Y_YF and the diff_Y_YFR of the difference of the brightness value sum of each pixel in the brightness value sum of calculating respectively each pixel in each zone and one that from image M, the selects zone that comprises pixel Y.
The pixel number that comprises in above-mentioned each zone is all identical, is assumed to be 9 in the present embodiment, and each regional shape is all identical.In addition, in the above-mentioned coordinate (x, y), x represents abscissa, shows the row at pixel place, and y represents ordinate, shows the row at pixel place.
In this step, determine that at first coordinate among the former frame image N of pixel Y and image M is the relative coefficient (in actual applications, but the former frame image N of buffer memory current frame image) of the pixel YF of (x, y), specific implementation comprises:
1) coordinate is (x-1 among the difference computed image N, y-1) coordinate is (x-1 in pixel YF_UP_L and the image M, y-1) coordinate is (x-1 among pixel Y_UP_L, the image N, y) coordinate is (x-1 in pixel YF_UP and the image M, y) pixel Y UP, and coordinate is (x-1 among the image N, y+1) coordinate is (x-1 in pixel YF_UP_R and the image M, the absolute value of the difference of the brightness value of pixel Y_UP_R y+1), and with three absolute value additions, namely have:
Abs(Y_UP_L-YF_UP_L)+abs(Y_UP-YF_UP)+abs(Y_UP_R-YF_UP_R)。
Fig. 2 is the position view of used pixel when determining relative coefficient among the inventive method embodiment.As shown in Figure 2, what adopt in the present embodiment is x-1 among image M and the image N pixel on capable, if only from scheme realization itself, also can adopt the pixel of the capable or x+1 of x on capable, with x behavior example, be that coordinate is (x among the computed image N, y-1) coordinate is (x in pixel YF_UP_L and the image M, y-1) pixel Y_UP_L, coordinate is (x among the image N, y) coordinate is (x in pixel YF_UP and the image M, y) pixel Y_UP, and coordinate is (x among the image N, y+1) coordinate is the absolute value of difference of brightness value of the pixel Y_UP_R of (x, y+1) in pixel YF_UP_R and the image M.
2) determine that whether Abs (Y_UP_L-YF_UP_L)+abs (Y_UP-YF_UP)+abs (Y_UP_R-YF_UP_R) is less than predefined first threshold NR3D_MEDIAN_DIFF_L;
If not, determine that then relative coefficient UPsimilar is 0;
If so, then with after the brightness value of the brightness value of pixel Y, pixel YF and 1 summation divided by 2, namely (Y+YF+1)/2 suppose that result of calculation is Avg; The absolute value of the difference of the brightness value of calculating Avg and pixel YF, be abs (Avg-YF), and whether definite abs (Avg-YF) is less than predefined Second Threshold NR3D_MEDIAN_DIFF_M, if, determine that then relative coefficient UPsimilar is 1, otherwise, determine that relative coefficient UPsimilar is 0.
Determine after the relative coefficient, calculate the Three regions select respectively from image N and the luminance difference between the zone of selecting from image M, specific implementation comprises:
1) calculates respectively the brightness value sum of each pixel in the Three regions of from image N, selecting and the brightness value sum of each pixel from a zone of from image M, selecting.
Fig. 3 is the Three regions schematic diagram of selecting from image N among the inventive method embodiment.As shown in Figure 3, according to order from left to right, first zone is (x-1 by coordinate, y-2) pixel YF_UP_LL, coordinate is (x-1, y-1) pixel YF_UP_L, coordinate is (x-1, y) pixel YF_UP, coordinate is (x, y-2) pixel YF_LL, coordinate is (x, y-1) pixel YF_L, coordinate is (x, y) pixel YF, coordinate is (x+1, y-2) pixel YF_DN_LL, coordinate is the pixel YF_DN_L of (x+1, y-1), and the pixel YF_DN of (x+1, y) forms; Second zone is (x-1 by coordinate, y-1) pixel YF_UP_L, coordinate are (x-1, y) pixel YF_UP, coordinate are (x-1, y+1) pixel YF_UP_R, coordinate are (x, y-1) pixel YF_L, coordinate are (x, y) pixel YF, coordinate are (x, y+1) pixel YF_R, coordinate are (x+1, y-1) pixel YF_DN_L, coordinate are (x+1, y) pixel YF_DN and coordinate are that the pixel YF_DN_R of (x+1, y+1) forms; Three regions is (x-1 by coordinate, y) pixel YF_UP, coordinate are (x-1, y+1) pixel YF_UP_R, coordinate are (x-1, y+2) pixel YF_UP_RR, coordinate are (x, y) pixel YF, coordinate are (x, y+1) pixel YF_R, coordinate are (x, y+2) pixel YF_RR, coordinate are (x+1, y) pixel YF_DN, coordinate are (x+1, y+1) pixel YF_DN_R and coordinate are that the pixel YF_DN_RR of (x+1, y+2) forms.
Fig. 4 is an area schematic of selecting from image M among the inventive method embodiment.As shown in Figure 4, this zone is (x-1 by coordinate in the image M, y-1) pixel Y_UP_L, coordinate are (x-1, y) pixel Y_UP, coordinate are (x-1, y+1) pixel Y_UP_R, coordinate are (x, y-1) pixel Y_L, coordinate are (x, y) pixel Y, coordinate are (x, y+1) pixel Y_R, coordinate are (x+1, y-1) pixel Y_DN_L, coordinate are (x+1, y) pixel Y_DN and coordinate are formed by the pixel Y_DN_R of (x+1, y+1).
Wherein, the brightness value sum of each pixel in the Three regions among the image N is respectively:
sumYF_L=YF_UP_LL+YF_UP_L+YF_UP
+YF_LL+YF_L+YF+
YF_DN_LL+YF_DN_L+YF_DN;
sumYF=YF_UP_L+YF_UP+YF_UP_R+
YF_L+YF+YF_R+
YF_DN_L+YF_DN+YF_DN_R;
sumYF_R=YF_UP+YF_UP_R+YF_UP_RR+
YF+YF_R+YF_RR+
YF_DN+YF_DN_R+YF_DN_RR。
The brightness value sum of each pixel in the zone in the image M is:
sumY=Y_UP_L+Y_UP+Y_UP_R+
Y_L+Y+Y_R+
Y_DN_L+Y_DN+Y_DN_R。
2) calculate respectively the absolute value of the difference of sumYF_L, sumYF and sumYF_R and sumY, that is:
diff_Y_YFL=abs(sumYF_L-sumY);
diff_Y_YF=abs(sumYF-sumY);
diff_Y_YFR=abs(sumYF_R-sumY)。
Need to prove, for some pixel, be the pixel of (1,1) such as coordinate, can not have the zone of selecting in the manner described above, so for this class pixel, then can not process according to scheme of the present invention.So, be the pixel Y of (x, y) for each coordinate, before execution in step 11, in theory, need at first to determine that whether having simultaneously coordinate in the image M is (x-1, y-2), (x-1, y-1), (x-1, y), (x-1, y+1), (x-1, y+2), (x, y-2), (x, y-1), (x, y+1), (x, y+2), (x+1, y-2), (x+1, y-1), (x+1, y), the pixel of (x+1, y+1) and (x+1, y+2), if exist, then execution in step 11, otherwise, pixel Y is not carried out any processing; In actual applications, can in software, in advance explanation need to process which pixel, then only process these pixels and get final product.
Step 12: determine the brightness value of pixel Y according to described relative coefficient, diff_Y_YFL, diff_Y_YF and diff_Y_YFR, and with the brightness value assignment determined to pixel Y.
The specific implementation of this step comprises:
1) determines whether diff_Y_YFL, diff_Y_YF and diff_Y_YFR whether all greater than predefined the 3rd threshold value NR3D_MEDIAN_DIFF_H, namely satisfy diff_Y_YF>NR3D_MEDIAN_DIFF_H and diff_Y_YFL>NR3D_MEDIAN_DIFF_H and diff_Y_YFR>NR3D_MEDIAN_DIFF_H; If not, the former brightness value of then keeping pixel Y is constant, and if so, then execution in step 2).
Whether the value of 2) determining relative coefficient UPsimilar is 1, if be 1, then with after the brightness value of the brightness value of pixel Y, pixel YF and 1 summation divided by the 2 as a result assignment that obtain to pixel Y (adding 1 is in order to make final television image brighter, to promote user's impression); Otherwise, coordinate is (x among the computed image M respectively, y-1) pixel Y_L and coordinate are (x, the absolute value diff_YL_YR of the difference of the brightness value of pixel Y_R y+1), and coordinate is (x-1 in the image M, y) pixel Y_UP and coordinate are the absolute value diff_YUP_YDN of difference of brightness value of the pixel Y_DN of (x+1, y).
Above-mentioned diff_YUP_YDN=abs (Y_UP-Y_DN);
diff_YL_YR=abs(Y_L-Y_R)。
3) determine that whether diff_YL_YR is less than diff_YUP_YDN, if, then with (adding 1 is in order to make final television image brighter divided by 2 after the brightness value of the brightness value of the pixel Y_L in the image M, pixel Y_R and 1 summation, lifting user impression) the as a result assignment that obtains is to pixel Y, otherwise, with after the brightness value of the brightness value of the pixel Y_UP in the image M, pixel Y_DN and 1 summation divided by the 2 as a result assignment that obtain to pixel Y.
The concrete value of each threshold value that relates in embodiment illustrated in fig. 1 can be decided according to the actual requirements.Usually, if the value of each threshold value is too large, can make denoising effect relatively poor, namely part stain or bright spot can not be removed, if value is too little, can causes that again normal pixel is used as noise processed and fall, thereby make television image fuzzy.In the present embodiment, the span of first threshold can be [20,60], and the span of Second Threshold can be [60,80], and the span of the 3rd threshold value can be [60,100].In addition, above-mentionedly only comprise 9 pixels in each zone and describe as example, in actual applications, can set as required the pixel number that comprises in each zone, and adjust the concrete value of each threshold value along with the difference of pixel number.Have again, embodiment illustrated in fig. 1 in, if any result of calculation is not integer, can round up.
Based on said method, Fig. 5 is the composition structural representation that the present invention removes the device embodiment of noise.As shown in Figure 5, comprising:
Receiver module 51 is used for receiving each two field picture of input, and sends to processing module 52;
Processing module 52, be used for from the 2nd two field picture that receives, be (x for each coordinate among every two field picture M, y) pixel Y, coordinate is (x among the former frame image N of definite pixel Y and image M respectively, y) relative coefficient of pixel YF, and from image N, select three zones that comprise pixel YF, the absolute value diff_Y_YFL of the difference of the brightness value sum of each pixel in the brightness value sum of calculating respectively each pixel in each zone and one that from image M, the selects zone that comprises pixel Y, diff_Y_YF and diff_Y_YFR, the pixel number that comprises in each zone is all identical; Determine the brightness value of pixel Y according to relative coefficient, diff_Y_YFL, diff_Y_YF and diff_Y_YFR, and with the brightness value assignment determined to pixel Y.
Wherein, the pixel number in each zone is generally 9.
In addition, can specifically comprise in the processing module 52:
The first processing unit 521, be used for determining the relative coefficient of pixel Y and pixel YF, and from image N, select three zones that comprise pixel YF, absolute value diff_Y_YFL, diff_Y_YF and the diff_Y_YFR of the difference of the brightness value sum of each pixel in the brightness value sum of calculating respectively each pixel in each zone and one that selects from the image M zone that comprises pixel Y send to the second processing unit 522 with described relative coefficient, diff_Y_YFL, diff_Y_YF and diff_Y_YFR;
The second processing unit 522 is used for determining according to the relative coefficient, diff_Y_YFL, diff_Y_YF and the diff_Y_YFR that receive the brightness value of pixel Y, and with the brightness value assignment determined to pixel Y.
Can further comprise again (for simplifying accompanying drawing, not shown) in the first processing unit 521:
The first computation subunit, being used for respectively, computed image N coordinate is (x-1, y-1) coordinate is (x-1 in pixel and the image M, y-1) coordinate is (x-1 among pixel, the image N, y) coordinate is (x-1 in pixel and the image M, y) pixel, and coordinate is (x-1 among the image N, y+1) coordinate is (x-1 in pixel and the image M, the absolute value of the difference of the brightness value of pixel y+1), and determine that whether three absolute value sums are less than predefined first threshold; If not, determine that then relative coefficient is 0, if so, then with after the brightness value of the brightness value of pixel Y, pixel YF and 1 summation divided by 2, obtain discussing Avg, the absolute value of the difference of the brightness value of calculating Avg and pixel YF, whether determine this absolute value less than predefined Second Threshold, if so, determine that then relative coefficient is 1, otherwise, determine that relative coefficient is 0; Relative coefficient is sent to the second processing unit 522;
The second computation subunit, be used for selecting Three regions from image N, being respectively by coordinate is (x-1, y-2), (x-1, y-1), (x-1, y), (x, y-2), (x, y-1), (x, y), (x+1, y-2), (x+1, y-1) and (x+1, y) zone that pixel forms, be (x-1 by coordinate, y-1), (x-1, y), (x-1, y+1), (x, y-1), (x, y), (x, y+1), (x+1, y-1), (x+1, y) and (x+1, y+1) zone that pixel forms, and be (x-1, y) by coordinate, (x-1, y+1), (x-1, y+2), (x, y), (x, y+1), (x, y+2), (x+1, y), the zone that the pixel of (x+1, y+1) and (x+1, y+2) forms, calculate the brightness value sum sumYF_L of each pixel in each zone, sumYF and sumYF_R, selecting one from image M is (x-1, y-1) by coordinate, (x-1, y), (x-1, y+1), (x, y-1), (x, y), (x, y+1), (x+1, y-1), (x+1, y) and the zone that forms of the pixel of (x+1, y+1), calculate the brightness sum sumY of each pixel in this zone, and calculate respectively sumYF_L, the absolute value diff_Y_YFL of the difference of sumYF and sumYF_R and sumY, diff_Y_YF and diff_Y_YFR are with diff_Y_YFL, diff_Y_YF and diff_Y_YFR send to the second processing unit 522.
Can further comprise (for simplifying accompanying drawing, not shown) in the second processing unit 522:
First determines subelement, is used for determining that whether diff_Y_YFL, diff_Y_YF and diff_Y_YFR are all greater than predefined the 3rd threshold value; If not, the former brightness value of then keeping pixel Y is constant, if so, then notifies second to determine subelement execution self function;
Second determines subelement, is used for determining whether the value of relative coefficient is 1, if be 1, then with after the brightness value of the brightness value of pixel Y, pixel YF and 1 summation divided by the 2 as a result assignment that obtain to pixel Y; Otherwise, coordinate is (x among the computed image M respectively, y-1) and (x, the absolute value diff_YL_YR of the difference of the brightness value of pixel y+1) and coordinate are (x-1, y) and (x+1, the absolute value diff_YUP_YDN of the difference of the brightness value of pixel y), and whether definite diff_YL_YR is less than diff_YUP_YDN; If, be (x with coordinate in the image M then, the brightness value of pixel y-1), coordinate are (x, the brightness value of pixel y+1) and 1 the summation after divided by the 2 as a result assignment that obtain to pixel Y, otherwise, with coordinate in the image M be the pixel of (x-1, y) brightness value, coordinate for after the brightness value of the pixel of (x+1, y) and 1 summation divided by the 2 as a result assignment that obtain to pixel Y.
The specific works flow process of device embodiment shown in Figure 5 please refer to the respective description in the embodiment of the method shown in Figure 1, repeats no more herein.
In a word, adopt technical scheme of the present invention, former frame image in conjunction with current frame image, adopt three-dimensional median filtering method to detect each pixel, and as required it is carried out again assignment, thus effectively removed noise, and then eliminated emergent bright spot and stain on the television image, especially not very large or by the scene of other denoising method after having handled, better effects if for noise; In addition, scheme of the present invention is when carrying out again assignment to pixel, do not have too much to depend on the former frame image (namely when pixel Y is carried out again assignment, the shared weight of the brightness value of pixel YF and the brightness value of pixel Y is the same, do not have the too much brightness value that depends on pixel YF, the weight that is about to the brightness value of pixel YF arranges too highly), motion blur phenomenon can not appear therefore; Have, scheme of the present invention only can realize by some simple calculating, realizes that cost is lower, is convenient to popularize again.
The above only is preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of making, is equal to replacement, improvement etc., all should be included within the scope of protection of the invention.