Embodiment
To the problem that exists in the prior art, a kind of scheme of brand-new removal noise is proposed among the present invention, promptly combine 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, below with reference to the accompanying drawing embodiment that develops simultaneously, scheme according to the invention is done to specify further.
Fig. 1 removes the flow chart of the method embodiment of noise for the present invention.In the present embodiment, receiving each two field picture of input successively, and begin from the 2nd two field picture that receives, is that (x, pixel Y y) handles according to mode shown in Figure 1 respectively to each coordinate among every two field picture M.
Step 11: confirm that coordinate is (x, the relative coefficient of pixel YF 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 each pixel in each zone respectively 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, above-mentioned coordinate (x, y) in, x representes abscissa, shows the row at pixel place, y representes ordinate, shows the row at pixel place.
In this step, confirm at first that coordinate be among the former frame image N of pixel Y and image M (x, the relative coefficient of pixel YF y) (in practical application, but the former frame image N of buffer memory current frame image), specifically realization comprises:
1) respectively among the computed image N coordinate be (x-1, in pixel YF_UP_L y-1) and the image M coordinate be (x-1, coordinate is (x-1 among pixel Y_UP_L y-1), the image N; Y) coordinate is (x-1, pixel Y UP y), and coordinate is (x-1 among the image N in pixel YF_UP and the image M; 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, promptly 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 confirming 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, promptly coordinate is (x among the computed image N; Y-1) in pixel YF_UP_L and the image M coordinate be (x, among pixel Y_UP_L y-1), the image N coordinate be (x, coordinate is (x in pixel YF_UP y) and the image M; Y) pixel Y_UP; And coordinate is that (x, coordinate is (x, the absolute value of the difference of the brightness value of pixel Y_UP_R y+1) in pixel YF_UP_R y+1) and the image M among the image N.
2) confirm 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, do not confirm that then relative coefficient UPsimilar is 0;
If, then with after the brightness value of the brightness value of pixel Y, pixel YF and 1 summation divided by 2, promptly (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 the predefined second threshold value NR3D_MEDIAN_DIFF_M, if confirm that then relative coefficient UPsimilar is 1; Otherwise, confirm that relative coefficient UPsimilar is 0.
Determine after the relative coefficient, calculate three zones from image N, selecting respectively and the luminance difference between the zone of from image M, selecting, the concrete realization comprises:
1) calculates the brightness value sum of each pixel in three zones from image N, selecting and the brightness value sum of each pixel from a zone of from image M, selecting respectively.
Three area schematic of Fig. 3 for from image N, selecting 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 be (x-1, pixel YF_UP_L, coordinate y-1) be (x-1, pixel YF_UP y), coordinate are (x; Y-2) pixel YF_LL, coordinate are (x; Y-1) pixel YF_L, coordinate be (x, pixel YF, coordinate y) be (x+1, pixel YF_DN_LL y-2), coordinate are (x+1; Y-1) pixel YF_DN_L and (x+1, pixel YF_DN composition y); Second zone by coordinate be (x-1, pixel YF_UP_L, coordinate y-1) be (x-1, pixel YF_UP y), coordinate are (x-1; Y+1) pixel YF_UP_R, coordinate be (x, pixel YF_L, coordinate y-1) be (x, pixel YF y), coordinate are (x; Y+1) pixel YF_R, coordinate are (x+1; Y-1) pixel YF_DN_L, coordinate is that (x+1, pixel YF_DN and coordinate y) are (x+1, pixel YF_DN_R composition y+1); The 3rd zone by coordinate be (x-1, pixel YF_UP, coordinate y) be (x-1, pixel YF_UP_R y+1), coordinate are (x-1; Y+2) pixel YF_UP_RR, coordinate be (x, pixel YF, coordinate y) be (x, pixel YF_R y+1), coordinate are (x; Y+2) pixel YF_RR, coordinate are (x+1; Y) pixel YF_DN, coordinate is that (x+1, pixel YF_DN_R and coordinate y+1) are that (x+1, pixel YF_DN_RR y+2) forms.
The area schematic of Fig. 4 for from image M, selecting among the inventive method embodiment.As shown in Figure 4, this zone by coordinate in the image M be (x-1, pixel Y_UP_L y-1), coordinate are (x-1; Y) pixel Y_UP, coordinate be (x-1, pixel Y_UP_R, coordinate y+1) be (x, pixel Y_L y-1), coordinate are (x; Y) pixel Y, coordinate be (x, pixel Y_R, coordinate y+1) be (x+1, pixel Y_DN_L y-1), coordinate are (x+1; Y) pixel Y_DN and coordinate is that (x+1, pixel Y_DN_R y+1) forms.
Wherein, the brightness value sum of each pixel in three zones 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 the absolute value of the difference of sumYF_L, sumYF and sumYF_R and sumY respectively, 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 according to aforesaid way, so for this type pixel, then can not handle according to scheme according to the invention.So, be that (x, pixel Y y) before execution in step 11, in theory, need at first to confirm that whether having coordinate simultaneously in the image M is (x-1 to each coordinate; 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), (x+1; Y+1) and (if exist, then execution in step 11 for x+1, pixel y+2), otherwise, pixel Y is not carried out any processing; In practical application, can in software, explanation in advance need to handle which pixel, only handle these pixels then and get final product.
Step 12: confirm the brightness value of pixel Y according to said relative coefficient, diff_Y_YFL, diff_Y_YF and diff_Y_YFR, and give pixel Y with the brightness value assignment of determining.
The concrete realization of this step comprises:
1) confirms whether diff_Y_YFL, diff_Y_YF and diff_Y_YFR whether all greater than predefined the 3rd threshold value NR3D_MEDIAN_DIFF_H, promptly satisfy diff_Y_YF>NR3D_MEDIAN_DIFF_H and diff_Y_YFL>NR3D_MEDIAN_DIFF_H and diff_Y_YFR>NR3D_MEDIAN_DIFF_H; The former brightness value of then keeping pixel Y is constant, if then execution in step 2 if not).
Whether the value of 2) confirming relative coefficient UPsimilar is 1; If be 1; Then with giving pixel Y (adding 1 is in order to make final television image brighter, to promote user's impression) divided by 2 assignment as a result that obtain after the brightness value of the brightness value of pixel Y, pixel YF and 1 summation; Otherwise; Coordinate is (x among the computed image M respectively; Y-1) pixel Y_L and coordinate is (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 is (x+1, the absolute value diff_YUP_YDN of the difference of the brightness value of pixel Y_DN y).
Above-mentioned diff_YUP_YDN=abs (Y_UP-Y_DN);
diff_YL_YR=abs(Y_L-Y_R)。
3) confirm 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; Promoting user's impression) assignment as a result that obtains gives pixel Y, otherwise, with giving pixel Y divided by 2 assignment as a result that obtain after the brightness value of the brightness value of the pixel Y_UP in the image M, pixel Y_DN and 1 summation.
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 big, can make denoising effect relatively poor, promptly 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 value can be [60,80], and the span of the 3rd threshold value can be [60,100].In addition, above-mentioned is that example describes to comprise 9 pixels in each zone only, in practical application, can set the pixel number that comprises in each zone as required, and adjusts 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 removes the composition structural representation of the device embodiment of noise for the present invention.As shown in Figure 5, comprising:
Receiver module 51 is used to receive each two field picture of input, and sends to processing module 52;
Processing module 52; Be used for beginning from the 2nd two field picture that receives; Each coordinate among every two field picture M is that (coordinate is (x among the former frame image N of definite respectively pixel Y and image M for x, pixel Y y); Y) relative coefficient of pixel YF; And from image N, select three zones that comprise pixel YF, and 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 each pixel in each zone respectively and one that from image M, the selects zone that comprises pixel Y, the pixel number that comprises in each zone is all identical; Confirm the brightness value of pixel Y according to relative coefficient, diff_Y_YFL, diff_Y_YF and diff_Y_YFR, and give pixel Y the brightness value assignment of determining.
Wherein, the pixel number in each zone is generally 9.
In addition, can specifically comprise in the processing module 52:
First processing unit 521; Be used for confirming 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 each pixel in each zone respectively and one that from image M, the selects zone that comprises pixel Y send to second processing unit 522 with said relative coefficient, diff_Y_YFL, diff_Y_YF and diff_Y_YFR;
Second processing unit 522 is used for confirming 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 gives pixel Y with the brightness value assignment of determining.
Can further comprise (, not shown) in first processing unit 521 again for simplifying accompanying drawing:
First computation subunit, be used for respectively computed image N coordinate for (x-1, coordinate is (x-1 in pixel y-1) and the image M; Y-1) among pixel, the image N coordinate be (x-1, coordinate is (x-1, pixel y) in pixel y) and the image M; And coordinate is (x-1 among the image N; Y+1) coordinate is (x-1, the absolute value of the difference of the brightness value of pixel y+1), and confirm that whether three absolute value sums are less than predefined first threshold in pixel and the image M; If not, confirm that then relative coefficient is 0, if; Then with after the brightness value of the brightness value of pixel Y, pixel YF and 1 summation divided by 2, obtain discussing Avg, calculate the absolute value of difference of the brightness value of Avg and pixel YF; Whether confirm this absolute value less than predefined second threshold value, if confirm that then relative coefficient is 1; Otherwise, confirm that relative coefficient is 0; Relative coefficient is sent to second processing unit 522;
Second computation subunit is used for selecting three zones from image N, be respectively by coordinate for (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, the zone that y) pixel is formed, by coordinate be (x-1, y-1), (x-1, y), (x-1, y+1), (x; Y-1), (x, y), (x, y+1), (x+1, y-1), (x+1, y) with (x+1; Y+1) zone that pixel is formed, and by coordinate be (x-1, y), (x-1, y+1), (x-1, y+2), (x; Y), (x, y+1), (x, y+2), (x+1, y), (x+1, y+1) with (x+1; Y+2) brightness value sum sumYF_L, sumYF and the sumYF_R of each pixel in each zone are calculated in the zone that pixel is formed, from image M, select one by coordinate for (x-1, 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, the zone that y+1) pixel is formed is calculated the brightness sum sumY of each pixel in this zone, and calculated absolute value diff_Y_YFL, diff_Y_YF and the diff_Y_YFR of the difference of sumYF_L, sumYF and sumYF_R and sumY respectively, and diff_Y_YFL, diff_Y_YF and diff_Y_YFR are sent to second processing unit 522.
Can further comprise (, not shown) in second processing unit 522 for simplifying accompanying drawing:
First confirms subelement, is used for confirming 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 then notify second to confirm subelement execution self function;
Second confirms subelement, is used for confirming whether the value of relative coefficient is 1, if be 1, then with giving pixel Y divided by 2 assignment as a result that obtain after the brightness value of the brightness value of pixel Y, pixel YF and 1 summation; Otherwise; Coordinate is (x among the computed image M respectively; Y-1) and (x, the absolute value diff_YL_YR and the coordinate of the difference of the brightness value of pixel y+1) be (x-1, y) with (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; Then be that (x, the brightness value of pixel y-1), coordinate are that (x gives pixel Y divided by 2 assignment as a result that obtain after the brightness value of pixel y+1) and 1 summation with coordinate in the image M; Otherwise; Be that (x-1, the brightness value of pixel y), coordinate are that (x+1 gives pixel Y divided by 2 assignment as a result that obtain after the brightness value of pixel y) and 1 summation with coordinate in the image M.
The concrete workflow of device embodiment shown in Figure 5 repeats no more please with reference to the respective description among the method embodiment shown in Figure 1 here.
In a word, adopt technical scheme of the present invention, in conjunction with the former frame image of current frame image; Adopt three-dimensional median filtering method to detect each pixel; And as required it is carried out assignment again, thus removed noise effectively, and then eliminated emergent bright spot and stain on the television image; Especially not to handle scene afterwards, better effects if through other denoising method very greatly or for noise; In addition; Scheme according to the invention is when carrying out again assignment to pixel; (promptly when pixel Y was carried out again assignment, the brightness value of pixel YF was the same with the shared weight of the brightness value of pixel Y, does not have the too much brightness value that depends on pixel YF not have the too much former frame image that depends on; The weight that is about to the brightness value of pixel YF is provided with too highly), the smear phenomenon can not appear therefore; Have, scheme according to the invention only can realize through some simple calculating, realizes that cost is lower, is convenient to popularize again.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope that the present invention protects.