Summary of the invention
The invention provides a kind of method and device that improves the simulated television mobile visible, can effectively promote the appreciation effect of simulated television in moving.
A kind of method of improving the simulated television mobile visible that the embodiment of the invention proposes comprises the steps:
The picture quality of the picture frame that demodulation is come out to anolog TV signals detects in real time, judge whether to occur picture quality and become bad situation, if, then abandon picture quality and become bad picture frame with predetermined percentage, contact between the adjacent image frame correspondence position pixel that utilization is retained is carried out smoothing processing according to the pixel of previous image frame to the pixel of current image frame.
Preferably, describedly judge whether to occur picture quality and become bad situation and comprise:
The mean value of the side-play amount of the position of the horizontal-drive signal of each row in the calculating chart picture frame;
Whether judge described mean value greater than the first threshold that sets in advance, if judge that then the picture quality of described picture frame becomes bad.
Preferably, setting in advance described first threshold comprises:
Make the side-play amount of position of the horizontal-drive signal of image increase in time since 0;
Determine that image picture quality becomes bad crash time point;
The mean value of the side-play amount of the position of the horizontal-drive signal of the image that described crash time point is corresponding is set to first threshold.
Preferably, the value of described first threshold is 28.
Preferably, describedly judge whether to occur picture quality and become bad situation and comprise:
If current image frame is the N frame, calculate the mean value of position of the maximum brightness of continuous n picture frame before the N frame, if the position of the maximum brightness of N frame and the difference of this mean value, are then judged the picture quality of N frame greater than predefined second threshold value and are become bad.
Preferably, the pixel number of the position of described maximum brightness is greater than predefined number limit value.
Preferably, the span of described second threshold value is 0x0E~0x28.
Preferably, describedly judge whether to occur picture quality and become bad situation and comprise:
Calculate the difference of the brightness summation of a current image frame and a last picture frame, whether judge this difference, if judge that then the picture quality of current image frame becomes bad greater than predefined the 3rd threshold value.
Preferably, describedly abandon picture quality with predetermined percentage and become after the bad picture frame, further comprise: utilize the method for three-dimensional denoising to remove the noise that is retained in the picture frame.
Preferably, describedly abandon picture quality with predetermined percentage and become after the bad picture frame, be retained picture frame account for abandon before the ratio of all images frame be not less than 50%.
Preferably, the contact between the adjacent image frame correspondence position pixel that described utilization is retained, according to the pixel of previous image frame the pixel of current image frame is carried out smoothing processing and comprise:
Weighted sum diff=|Y_L-YF_L|+|Y-YF| * the 2+|Y_R-YF_R| of the luminance difference absolute value of the pixel of the calculating current processed pixels point of present frame and neighbor pixel and former frame correspondence position, wherein, Y is the brightness of the current processed pixels point of present frame, Y_L is the brightness of the left adjacent pixel of the current processed pixels point colleague of present frame, Y_R is the brightness of the right adjacent pixel of the current processed pixels point colleague of present frame, YF is the brightness of the former frame correspondence position pixel of the current processed pixels point of present frame, YF_L is the brightness of the former frame correspondence position pixel of the left adjacent pixel of the current processed pixels point colleague of present frame, and YF_R is the brightness of the former frame correspondence position pixel of the right adjacent pixel of the current processed pixels point colleague of present frame;
The value of weight factor w is set: if described weighted sum diff more than or equal to threshold value DIFF0, is provided with weight factor w and equals 4; If weighted sum diff less than threshold value DIFF0 and more than or equal to threshold value DIFF1, is provided with weight factor w and equals 3; Diff is provided with weight factor w and equals 2 less than threshold value DIFF1 and more than or equal to threshold value DIFF2; If weighted sum diff less than threshold value DIFF2, is provided with weight factor w and equals 0;
The current processed pixels of calculating present frame is put adjusted brightness and is
The embodiment of the invention also proposes a kind of device that improves the simulated television mobile visible, comprising:
Real-time detection module, the picture quality that is used for the picture frame that demodulation is come out to anolog TV signals detects in real time, judges whether to occur picture quality and becomes bad situation, if then enable the frame losing module;
The frame losing module is used for abandoning picture quality with predetermined percentage and becomes bad picture frame; And
The image stabilization module is used for after the frame losing module abandons picture frame, utilizes the contact between the adjacent image frame correspondence position pixel that is retained, and according to the pixel of previous image frame the pixel of current image frame is carried out smoothing processing.
Preferably, described real-time monitoring modular comprises:
First detecting unit is used for the mean value of side-play amount of position of the horizontal-drive signal of each row of calculating chart picture frame; Whether judge described mean value greater than the first threshold that sets in advance, if judge that then the picture quality of described picture frame becomes bad.
Preferably, the value of described first threshold is 28.
Preferably, described real-time monitoring modular comprises: second detecting unit;
If current image frame is the N frame, described second detecting unit is used to calculate the mean value of position of the maximum brightness of continuous n picture frame before the N frame, if the position of the maximum brightness of N frame and the difference of this mean value, are then judged the picture quality of N frame greater than predefined second threshold value and are become bad.
Preferably, the pixel number of the position of described maximum brightness is greater than predefined number limit value.
Preferably, the span of described second threshold value is 0x0E~0x28.
Preferably, described real-time monitoring modular comprises:
The 3rd detecting unit is used to calculate the difference of the brightness summation of a current image frame and a last picture frame, whether judges this difference greater than predefined the 3rd threshold value, if judge that then the picture quality of current image frame becomes bad.
Preferably, this device further comprises: the denoising module, be used for after described frame losing module abandons picture frame, and utilize the method for three-dimensional denoising to remove the noise that is retained in the picture frame.
Preferably, described frame losing module abandons after the picture frame, be retained picture frame account for abandon before the ratio of all images frame be not less than 50%.
Preferably, described image stabilization module comprises:
Computing unit, be used to calculate the weighted sum diff=|Y_L-YF_L|+|Y-YF| * 2+|Y_R-YF_R| of luminance difference absolute value of the pixel of the current processed pixels point of present frame and neighbor pixel and former frame correspondence position, wherein, Y is the brightness of the current processed pixels point of present frame, Y_L is the brightness of the left adjacent pixel of the current processed pixels point colleague of present frame, Y_R is the brightness of the right adjacent pixel of the current processed pixels point colleague of present frame, YF is the brightness of the former frame correspondence position pixel of the current processed pixels point of present frame, YF_L is the brightness of the former frame correspondence position pixel of the left adjacent pixel of the current processed pixels point colleague of present frame, and YF_R is the brightness of the former frame correspondence position pixel of the right adjacent pixel of the current processed pixels point colleague of present frame;
The weight factor unit is used to be provided with the value of weight factor w: if described weighted sum diff more than or equal to threshold value DIFF0, is provided with weight factor w and equals 4; If weighted sum diff less than threshold value DIFF0 and more than or equal to threshold value DIFF1, is provided with weight factor w and equals 3; Diff is provided with weight factor w and equals 2 less than threshold value DIFF1 and more than or equal to threshold value DIFF2; If weighted sum diff less than threshold value DIFF2, is provided with weight factor w and equals 0;
Adjustment unit is used to calculate the current processed pixels of present frame and puts adjusted brightness and be
As can be seen from the above technical solutions, the picture quality of the picture frame that comes out by the demodulation of real-time detection anolog TV signals, in time abandon picture quality and become bad picture frame, and carry out respective handling to being retained picture frame, can effectively improve the simulated television picture quality in moving, image is no longer glimmered, and make adjacent two two field pictures not have the sense of beating.
Embodiment
Simulated television picture degradation situation takes place in moving, and following characteristics are roughly arranged: 1 is relevant with the place environment, and 2, occur at random basically.
Based on These characteristics, the present invention proposes a kind of scheme of improving the simulated television mobile visible, the picture quality that demodulation is come out to anolog TV signals detects in real time, according to the abrupt change of the horizontal displacement of image and/or brightness as the criterion of judging picture quality, if think that picture quality becomes bad, then lose the frame of damage with certain frame per second, again residual image is carried out smoothing processing, the brightness and the color of image are no longer glimmered, and make adjacent two two field pictures not have the sense of beating.Preferably, can also use the method for three-dimensional denoising to remove noise on the image, image is improved.
Below by specific embodiment the present invention program is described in detail.
The handling process of the improvement simulated television mobile visible of the embodiment of the invention comprises the steps: as shown in Figure 1
Step 101: the picture quality that demodulation is come out to anolog TV signals detects in real time, and judge whether to occur picture quality and become bad situation, if, continue execution in step 102, otherwise, repeat this step.
Because in the environment of multipath and Fading, cause the skew of horizontal displacement (H-Offset) easily, also can in image, produce bright and dark excessively cord simultaneously.Therefore, the brightness block diagram that calculates according to the brightness value of each pixel in the picture frame has obvious variation, except the beating of mean value, also has the significantly variation of slope.Can judge picture quality with in following three kinds of modes any:
1, judges picture quality according to the mean value of the side-play amount (H-Offset) of the position of horizontal-drive signal
In anolog TV signals, with one section pulse (Burst) signal signature horizontal synchronization (H-sync), this pulse signal is called horizontal-drive signal.Can utilize in the frame mean value of side-play amount (H-Offset) of position of the horizontal-drive signal of each row to judge the picture quality of this frame.The image frame of the mean value by the different H-Offset of naked eyes paired observation, can find following rule:
When the mean value of H-Offset when 0 becomes big gradually, image frame develops into the image that has distortion or distortion gradually from the high quality graphic of normal demonstration.Can find the critical value of the mean value of a H-Offset, when the mean value of H-Offset during greater than this critical value, think that then tangible distortion or distortion have appearred in image frame, and the mean value of H-Offset is during less than this critical value, image picture quality still can be accepted.This critical value is as the first threshold of the embodiment of the invention.If the mean value of every capable H-Offset is greater than the first threshold that sets in advance in the frame, think that then the picture quality of this frame becomes bad, so this frame should abandon immediately.In the embodiment of the invention, the preferable value of first threshold is 28.
Can determine first threshold in the following way:
Make the side-play amount of position of the horizontal-drive signal of image increase in time since 0;
Determine that image picture quality becomes bad crash time point;
The mean value of the side-play amount of the position of the horizontal-drive signal of the image that described crash time point is corresponding is set to first threshold.
As shown in Figures 2 and 3, this is simulated television demodulation chip information under institute's record in moving, and curve 201 and curve 301 are represented noise levels, and curve 202 and curve 302 are represented signal gains, and curve 203 and curve 303 are represented H-Offset.Signal in moving receives the influence that is subjected to building, and the result of multipath and Fading allows the average of H-Offset that different variations is arranged, and the influence of Fig. 2 is little, but at Fig. 3, picture quality is significantly destroyed.If abandon the image of H-Offset mean value serious offense 28, the average frame per second of the image of reservation (Average Frame Rate) is still more than 92%, and the consecutive image of finding of naked eye is not out of shape and the phenomenon of distortion takes place.
2, judge picture quality according to the rate of change of the brightness block diagram (Luma Histogram) of image
The brightness that the distribution of brightness block diagram can demonstrate consecutive image changes, and is the brightness block diagram of two successive image frames as shown in Figure 4 and Figure 5, and transverse axis is 0 to 255 Luminance Distribution, and the longitudinal axis is the number of pixel.The position of maximum brightness and the value of mean flow rate all have significantly between Fig. 4 and Fig. 5 beats.
The position of maximum brightness is the control of the number limit value (Floor) preset.This be because, may have a spot of high brightness noise at random in the image, generally do not think these high brightness at random the appearance of noise can cause picture degradation.By Floor is set, can be directly these high brightness at random noise neglect, have only the pixel number just to list the scope of judgement in greater than those brightness positions of Floor.The span of Floor can be between 0x2C~0x3C.
Shown in the brightness block diagram all pixel numbers greater than Floor brightness position in, find the wherein the highest position of brightness, be used as the reference point of maximum brightness.If present frame is the N frame, when judging the picture quality of present frame, can calculate continuous n frame before the N frame maximum brightness the position mean value (promptly N-n frame, N-n+1 frame ... the mean value of the position of the maximum brightness of N-1 frame), whether the brightness that can judge image according to the difference of the position of the maximum brightness of N frame and this mean value occurs obviously beating.Consecutive image picture by the described difference correspondence of naked eyes paired observation, can find the critical value of a difference, if described difference, thinks then that obviously beating has appearred in the brightness of consecutive image greater than this critical value, otherwise thinks that then consecutive image brightness is still in normal range (NR).The critical value of this difference is as second threshold value of the embodiment of the invention.
If the mean value of the position of the maximum brightness of continuous n frame before the position of the maximum brightness of N frame and the N frame greater than predefined second threshold value, judge that then the picture quality change of N frame is bad, promptly this frame can be abandoned.Preferably, the span of described second threshold value is between 0x0E~0x28.
3, judge picture quality according to the rate of change of the brightness summation (Luma Sum) of picture frame
Whether the brightness summation of picture frame can obviously represent the picture quality of a frame stable.In the image of one section continous-stable, the brightness summation of each frame does not have tangible acute variation, unless the conversion of scene or picture material have violent flicker painstakingly, so we can utilize such characteristic to judge a certain frame, and whether picture quality is impaired because being subjected to the influence of Fading effect.
The statistics of the brightness summation of image promptly is the added luminance with all pixels in the picture frame.Under the normal condition, the difference of the brightness summation of adjacent image frame should be less than a critical value, and if picture frame is subjected to the influence of Fading effect, then the difference of the brightness summation of adjacent image frame will be greater than this critical value.Described critical value is as the 3rd threshold value of the embodiment of the invention.
Calculate the difference of the brightness summation of a current image frame and a last picture frame, whether judge this difference greater than predefined the 3rd threshold value, if, judging that then the picture quality of current image frame becomes bad, this frame can be abandoned.
In order to judge the conversion of scene, must precisely judge and whether really move.Therefore, can be when adopting aforesaid way 1 to judge, any judgment mode in employing mode 2 or the mode 3 becomes bad if judged result is picture quality, and then setting up procedure 102.
Step 102: abandon picture quality with predetermined percentage and become bad picture frame.Wherein, be retained picture frame account for abandon before the ratio of all images frame be not less than 50%.
The control of frame per second is that the continuity of guaranteeing image can maintain certain scope, the original frame per second of anolog TV signals, PAL/SECAM is 25 frames, NTSC is 30 frames, the naked eyes that the frame per second that abandons is not higher than 50% couple of people still do not have too much influence, therefore we can add up the number of times of frame losing in frame losing, and then the frame per second of control chart picture output is more than 50%.
Step 103:, utilize the method for three-dimensional denoising to remove noise on the image for the picture frame that is retained.
The embodiment of the invention utilizes smoothing filter between three dimensional frame (3-Dimension Inter SmoothFilter) to remove noise on the image originally.For the unusual pixel Y of any brightness,, replace the brightness value of pixel Y with variable ratio according to the relation of the pixel brightness of the brightness of its surrounding pixel point and former frame correspondence position.
The level and smooth principle content of former frame that has been buffer memory between three dimensional frame, can be used for doing point-to-point comparison with this frame, the principle of smoothing filter as shown in Figure 6 between three dimensional frame, the position of the pixel of handling is the capable j row of the n of present frame, then all pixel positions relatively are: the capable j row of former frame n, the capable j of n ± 3 row, the capable j of n ± 6 row, and the capable j of n-1 of present frame ± 3 row.
Smoothing filter is provided with two thresholdings between three dimensional frame, is respectively low spot threshold value (THRESHOLD_LOW) and high some threshold value (THRESHOLD_HIGH), and computational process is as follows:
The initial value of R=Y // be provided with R is the original brightness value when the pixel of pre-treatment
Each pixel relatively of For n As All related points // traversal
{
The absolute value of the luminance difference of Diff=absolute (Y-Y (n)) // calculating current pixel point and compared pixels point;
(R=R+Y (n) of Diff<=THRESHOLD_LOW) is if a=a+1 // this luminance difference absolute value is less than or equal to the low spot threshold to if
Value, then the brightness value Y (n) with this compared pixels point is accumulated among the R, and the count value of counter a is added 1;
else?if(Diff<=THRESHOLD_HIGH)R=R+(Y(n)+2)/4,b=b+1
If // this absolute difference is greater than the low spot threshold value, and be less than or equal to high some threshold value, then (Y (n)+2)/4 be accumulated among the R,
And the count value of counter b added 1;
}End?For
Y=(R*norm[b][a]+128)/256
// the computing formula of brightness value after the processing of the pixel of pre-treatment;
Define?norm[8][8]={
{256,128,85,64,51,43,37,32},
{205,114,79,60,49,41,35,0},
{171,103,73,57,47,39,0,0},
{146,93,68,54,44,0,0,0},
{128,85,64,51,0,0,0,0},
{114,79,60,0,0,0,0,0},
{103,73,0,0,0,0,0,0},
{93,0,0,0,0,0,0,0}};
The matrix norm[8 that // definition is one 8 * 8] [8]
Y (n) is the point of arrow indication among Fig. 6, and Y is the point of handling at present, and last Y replaces with the mean value of R.
The value of low spot threshold value and high some threshold value can the embodiment of the invention be recommended between 0~255 preferred values be respectively 12 and 20.
The computing of colourity is consistent with the method for brightness, so repeat no more.The above computational process only is a kind of example, not in order to restriction the present invention.
Step 104: utilize the contact between the adjacent image frame correspondence position pixel that is retained, the pixel of current image frame is carried out smoothing processing according to the pixel of previous image frame.
Owing in step 102, abandoned a part of picture frame, may lack the picture frame of transition between the adjacent image frame that is retained, therefore the continuous picture of perusal may feel that image changes suddenly, " jump " occurred for beholder's the picture of feeling.Therefore need carry out smoothing processing to the adjacent image frame, reduce the difference of adjacent image frame, make the continuous pictures that is observed visually more natural.
The embodiment of the invention utilizes three-dimensional stability smoothing filter (3-Dimension Stable SmoothFilter) to realize this step.Concrete processing procedure is as follows:
The content of former frame that the principle that three-dimensional stability is level and smooth has been buffer memory, can be used for doing point-to-point comparison with this frame, according to comparative result the pixel of present frame is handled, reduce the gap of the pixel of the pixel of present frame and previous frame correspondence position, the gap between the described pixel has comprised the gap of brightness aspect and the gap of colourity aspect.Its principle as shown in Figure 7.
This filter is provided with three threshold values, is respectively threshold value DIFF0, threshold value DIFF1 and threshold value DIFF2, and DIFF0>DIFF1>DIFF2, computational process is as follows:
diff=(absolute(Y_L-YF_L)+
(absolute(Y-YF)*2)+
absolute(Y_R-YF_R))/4
The absolute value of the luminance difference of the pixel of current processed pixels point of // calculating present frame and former frame same position, and this pixel is together
The absolute value of the luminance difference of the pixel of adjacent two pixels of row and former frame same position,
If is (if diff>=DIFF0) weight=4//diff is provided with weight factor and equals 4 more than or equal to threshold value DIFF0;
Else if is (if diff>=DIFF1) weight=3//diff is provided with weight factor and equals less than DIFF0 and more than or equal to DIFF1
3;
Else if is (if diff>=DIFF2) weight=2//diff is provided with weight factor and equals less than DIFF1 and more than or equal to DIFF2
2;
else?weight=0
If // diff less than threshold value DIFF2, is provided with weight factor and equals 0
Y=((YF*(4-weight))+(Y*weight)+2)/4
// brightness value of current processed pixels point is adjusted
If when the point of the same position of the point of pre-treatment and former frame has very strong similitude, the brightness of then using former frame is to replace current this point than higher weights.
The optimum value of DIFF0~DIFF2 that the embodiment of the invention is recommended is respectively 110,100,70.The computing of colourity is consistent with the method for brightness.
The embodiment of the invention also proposes a kind of device that improves the simulated television mobile visible, comprising:
Real-time detection module, the picture quality that is used for the picture frame that demodulation is come out to anolog TV signals detects in real time, judges whether to occur picture quality and becomes bad situation, if then enable the frame losing module;
The frame losing module is used for abandoning picture quality with predetermined percentage and becomes bad picture frame; And
The image stabilization module is used for after the frame losing module abandons picture frame, utilizes the contact between the adjacent image frame correspondence position pixel that is retained, and according to the pixel of previous image frame the pixel of current image frame is carried out smoothing processing.
Preferably, described real-time monitoring modular comprises:
First detecting unit is used for the mean value of side-play amount of position of the horizontal-drive signal of each row of calculating chart picture frame; Whether judge described mean value greater than the first threshold that sets in advance, if judge that then the picture quality of described picture frame becomes bad.
Preferably, the value of described first threshold is 28.
Preferably, described real-time monitoring modular comprises: second detecting unit;
If current image frame is the N frame, described second detecting unit is used to calculate the mean value of position of the maximum brightness of continuous n picture frame before the N frame, if the position of the maximum brightness of N frame and the difference of this mean value, are then judged the picture quality of N frame greater than predefined second threshold value and are become bad.
Preferably, the pixel number of the position of described maximum brightness is greater than predefined number limit value.
Preferably, the span of described second threshold value is 0x0E~0x28.
Preferably, described real-time monitoring modular comprises:
The 3rd detecting unit is used to calculate the difference of the brightness summation of a current image frame and a last picture frame, whether judges this difference greater than predefined the 3rd threshold value, if judge that then the picture quality of current image frame becomes bad.
Preferably, this device further comprises: the denoising module, be used for after described frame losing module abandons picture frame, and utilize the method for three-dimensional denoising to remove the noise that is retained in the picture frame.
Preferably, described frame losing module abandons after the picture frame, be retained picture frame account for abandon before the ratio of all images frame be not less than 50%.
Preferably, described image stabilization module comprises:
Computing unit, be used to calculate the weighted sum diff=|Y_L-YF_L|+|Y-YF| * 2+|Y_R-YF_R| of luminance difference absolute value of the pixel of the current processed pixels point of present frame and neighbor pixel and former frame correspondence position, wherein, Y is the brightness of the current processed pixels point of present frame, Y_L is the brightness of the left adjacent pixel of the current processed pixels point colleague of present frame, Y_R is the brightness of the right adjacent pixel of the current processed pixels point colleague of present frame, YF is the brightness of the former frame correspondence position pixel of the current processed pixels point of present frame, YF_L is the brightness of the former frame correspondence position pixel of the left adjacent pixel of the current processed pixels point colleague of present frame, and YF_R is the brightness of the former frame correspondence position pixel of the right adjacent pixel of the current processed pixels point colleague of present frame;
The weight factor unit is used to be provided with the value of weight factor w: if described weighted sum diff more than or equal to threshold value DIFF0, is provided with weight factor w and equals 4; If weighted sum diff less than threshold value DIFF0 and more than or equal to threshold value DIFF1, is provided with weight factor w and equals 3; Diff is provided with weight factor w and equals 2 less than threshold value DIFF1 and more than or equal to threshold value DIFF2; If weighted sum diff less than threshold value DIFF2, is provided with weight factor w and equals 0;
Adjustment unit is used to calculate the current processed pixels of present frame and puts adjusted brightness and be
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope of protection of the invention.