Embodiment
For the object, technical solutions and advantages of the present invention are more clearly understood, below in conjunction with specific embodiment, and reference
Attached drawing, the present invention is described in more detail.
1, move the statistical distribution analysis of pixel and static pixel
In conventional art such as patent US 2006/0139494A1, US6061100, the method for testing motion taken is only
The statistical distribution of static pixel is considered, so as to be unable to control the generation of undetected error.In order to control undetected error, the present invention is right
The statistical distribution of movement pixel has done following analysis, can quantitatively find out that the luminance difference of moving object and background (contrasts
Degree) influence to motion detection.
As shown in Fig. 2A, Fig. 2 B, moving object is the circle in Fig. 2A.Assuming that the gray value of background is B, moving object and
Gray scale difference, that is, contrast of background is C, noise n, then in the case where there is noise situations, its gray value of moving object is C+B+n, week
The region for enclosing white is background, and gray value B+n, noise n obey zero-mean gaussian, and noise variance isI.e.Fig. 2A is image of the video at the t-1 moment, and image 2B is image of the video in t moment.Moving object is sent out
Movement is given birth to.
The image intensity value for being located at t moment is gt, the image intensity value at t-1 moment is gt-1
The distribution of the inter-pixel difference d in the A3 regions in moving region, i.e. Fig. 2 B is as follows:
gt-1=C+B+n (1)
gt=B+n (2)
D=gt-gt-1 (3)
What then d was obeyed is distributed as:
Make y=| d |, then what the absolute difference y of inter-pixel was obeyed is distributed as
The average of y is:
The variance of y is:
When carrying out motion detection, the local mean values (Mean of the absolute difference y of generally use inter-pixel
Absolute Error, referred to as MAE) it is used as the feature of motion detection, shown in the calculating such as formula (8) of the MAE features,
Y1 ..., yk are respectively the absolute difference y of the inter-pixel of local k adjacent pixel, and the distribution that m is obeyed, its is equal
Value is identical with y, and variance is the 1/k of y variances, i.e.,
The pixel (the A2 regions of the image in t moment of such as Fig. 2 B) of stagnant zone, the distribution that its MAE feature is obeyed, is
The special circumstances of formula (9) and (10) in C=0
The MAE feature distributions of the movement pixel determined according to formula (9) and formula (10), and formula (11) and formula (12) decision are quiet
The only MAE feature distributions of pixel, it can be deduced that C=8, σgDistribution curve when=2, such as Fig. 3 A, and C=4, σgDistribution when=2
Curve, such as Fig. 3 B.
The σ when noise level is identical is can be seen that from Fig. 3 A and 3Bg=2, when contrast C is 8, move pixel and static
The MAE features of pixel do not have overlapping region substantially, have relatively good separability, and when contrast C is reduced to 4, motor image
Plain MAE features have had larger overlapping region with static pixel MAE features.
If contrast C and noise level σgRelation be
C=x σg (13)
X is Contrast-to-noise ratio, by substantial amounts of data analysis, works as x>3, i.e. contrast>During 3 times of noise levels, movement
The MAE features overlapping region of pixel and static pixel is smaller, has preferable separability, works as x<When 3, overlapping region is with x's
Reduce gradually increase, separability declines.
2nd, the adaptive video denoising system of contrast
As can be seen from the above analysis, when Contrast-to-noise ratio x is smaller, if carrying out movement inspection by threshold value
Survey, no matter how threshold value is chosen, and can all have detection mistake, if threshold value is smaller, it may occur that missing inspection, if threshold value is larger, can send out
Raw false-alarm, but phenomenon pair of the distortion phenomenon of the moving target hangover produced due to missing inspection than the noise that false-alarm produces without removal
Human eye vision is even more serious, so under low-contrast circumstances, in order to reach relatively good visual effect, motion detection should be use up
The generation of amount control missing inspection.For this reason, this patent provides contrast adaptive video denoising system to solve the above problems.
2, contrast adaptive video denoising system explanation
The contrast adaptive video denoising system of the present embodiment is as shown in Figure 4.The system includes:Deposited including frame, interframe
Difference characteristic computing module, contrast computing module, low contrast regions detection module, motion detection block, Motion Adaptive
Time-domain filtering module;Frame is deposited for caching filter result;Frame difference feature calculation module is according to video present incoming frame and frame
Previous filtering frame in depositing calculates output interframe difference characteristic;Contrast computing module calculates output currently according to present incoming frame
The local contrast of input frame;Low contrast regions detection module calculates according to present incoming frame local contrast and exports low contrast
Spend Region confidence;Motion detection block is according to low contrast regions confidence level and the frame of frame difference feature calculation module output
Between difference calculate output pixel probability of motion;During Motion Adaptive time-domain filtering module is deposited according to video present incoming frame and frame
Previous filtering frame and the probability of motion of each pixel carry out Motion Adaptive time-domain filtering, finally export current filter frame
Deposit frame is deposited.
Frame difference feature calculation module calculates the frame difference of the previous filtering frame during video present incoming frame and frame are deposited
Feature, has many frame difference feature calculation methods to use, such as simple poor, absolute difference, absolute difference and SAD (Sum
Of Absolute Difference), average absolute value difference MAE (Mean Absolute Error).Used in the present embodiment
Frame difference is characterized as MAE features, as formula (8) defines.
As shown in Figure 5A, contrast computing module includes horizontal gradient computing unit, Grads threshold to contrast computing module
Computing unit, intermediate zone detection unit, left average calculation unit, right average calculation unit, absolute difference computing unit;
Horizontal gradient computing unit is used to present incoming frame being transformed to horizontal gradient image G;Grads threshold computing unit
Output Grads threshold Gt is calculated according to horizontal gradient image G;Intermediate zone detection unit is according to horizontal gradient image G, Grads threshold
Gt calculates the intermediate zone mark α for exporting measuring point pixel to be checked, and local window around measuring point pixel to be checked is divided into left window
And right window;Left average calculation unit calculates the output non-intermediate zone pixel of left window according to present incoming frame and intermediate zone mark α
Gray average left_mean;Right average calculation unit is non-according to present incoming frame and intermediate zone mark α calculating output right windows
The gray average right_mean of intermediate zone pixel;Absolute difference computing unit calculates the ash of the output non-intermediate zone pixel of left window
The absolute value of the difference of average left_mean and the gray average right_mean of the non-intermediate zone pixel of right window is spent as current
The local contrast C of input frame.
In order to facilitate the contrast computational methods for understanding this patent, now the corresponding method of the module is illustrated, is such as schemed
5B show through on a horizontal line of moving object and background intersection its row coordinate of pixel j (j represent pixel in water
Square upward coordinate) and pixel grey scale be worth corresponding diagram, the gray value of moving object is V1, and the gray value of the gray scale of background is
V2, there are certain intermediate zone between moving object and background.Then contrast C=V2-V1 of moving object and background.
In order to calculate C, V1 and V2 need to be estimated, it is specific as shown in Fig. 5 (C), if present incoming frame I's is to be detected
Point pixel (i, j) contrast calculation window is (2N+1) x1, and pixel coordinate is expressed as (i, j+n) in window, the picture of-N≤n≤0
Element is the pixel of left window, and the pixel of 1≤n≤N is the pixel of right window;Then estimated using the average of the pixel in left window
V1, estimates V2 using the average of the pixel in right window, and due to left and right window, there is certain intermediate zone, these mistakes
V1 can be influenced by crossing the gray scale of the pixel of band, and the correct estimation of V2, can more connect so calculating average after intermediate zone pixel is removed
The right value of nearly V1 and V2.The specific calculation procedure of the local contrast C of present incoming frame I is calculated in contrast computing module
For:
Step 11, calculated level gradient image G
Horizontal gradient can be calculated with gradient operator and image convolution, the present embodiment is calculated using the Sobel gradients of 3x3
Son.
Step 12 calculates Grads threshold Gt
Calculating Grads threshold Gt methods in point position (i, j) to be checked is:Take and taken around measuring point pixel (i, j) to be checked
Local (2N+1) x1 windows, calculate the maximum of gradients max_grad and Grads threshold Gt of local window, such as formula (14) and (15)
It is shown.
Max_grad (i, j)=maxj-N≤n≤j+NG (i, n) (14)
Gt (i, j)=W*max_grad (i, j) (15)
Wherein, W is the proportionality coefficient that Grads threshold is maximum of gradients, and W, which can use, does 0.7.
Step 13, using horizontal gradient image G, Grads threshold Gt, intermediate zone detection is carried out, calculates measuring point pixel to be checked
The non-intermediate zone mark α of (2N+1) the x1 local windows of (i, j)
I.e. when the gradient G of the pixel in local window is less than Grads threshold Gt, which is non-intermediate zone pixel.
Step 14, the gray average of the non-intermediate zone pixel of left window is calculated using preceding input frame I, and non-intermediate zone mark α
left_mean
In the local window of (2N+1) x1 around pixel (i, j) to be detected, coordinate is (i, j+n) and-N≤n≤0
Pixel is the pixel of left window.The gray average left_mean of the non-intermediate zone pixel of left window is calculated, specific formula is formula
(17)、(18)、(19)。
Left_mean (i, j)=left_sum (i, j)/left_count (i, j) (19)
Left_sum in formula (17) is the sum of the gray value of non-intermediate zone pixel in left window, the left_ in formula (18)
Count is the number of non-intermediate zone pixel in left window, and formula (19) calculates the gray average of non-intermediate zone pixel.
Step 15, the gray average of the non-intermediate zone pixel of right window is calculated using image I, and non-intermediate zone mark α
In the local window of (2N+1) x1 around pixel (i, j) to be detected, coordinate is (i, j+n) and 1≤n≤N
Pixel is the pixel of right window.The calculating such as formula (20) of the gray average right_mean of the non-intermediate zone pixel of right window, (21),
(22) shown in, the right_sum in formula (20) is the sum of the gray value of non-intermediate zone pixel in right window.In formula (21)
Right_count is the number of non-intermediate zone pixel in left window.Formula (22) calculates the gray scale of the non-intermediate zone pixel of right window
Average.
Right_mean (i, j)=right_sum (i, j)/right_count (i, j) (22)
Step 16, the gray average left_mean and the non-intermediate zone pixel of right window of the non-intermediate zone pixel of left window are utilized
Gray average right_mean calculate contrast C, as shown in formula (23)
C (i, j)=| right_mean (i, j)-left_mean (i, j) | (23)
Low contrast regions detection module receives the contrast C input of contrast module calculating, calculates low contrast area
Domain confidence level R_LC.Carry out low contrast regions detection purpose be, can be in low contrast district using traditional method for testing motion
Domain produces undetected error, produces the distortion phenomenon of moving target hangover.It can be seen that from Fig. 3 A and 3B when noise level is identical
(σg=2) when, contrast C is 8, the MAE features for moving pixel and static pixel do not have overlapping region substantially, can use tradition
The adaptive method for testing motion of noise take 2 times or 3 times of noise levels be motion detection threshold, without bringing detection mistake
Difference.And when contrast C is reduced to 4, movement pixel MAE features have had larger overlapping with static pixel MAE features
Region, if detected using 2 times of traditional noise levels, can cause substantial amounts of undetected error.This patent provides will be low right
The method come out than degree region detection.It can be detected after detecting with the contrast adaptive motion of this patent to avoid leak
The generation of error detection by mistake.
The low contrast regions detection method that the present embodiment uses is not detected merely with contrast, also utilizes noise water
Put down to detect, so being a kind of adaptive low contrast regions detection method of noise.Same contrast, in low noise
When and strong noise when different influences can be brought to motion detection, it is good using the adaptive detection method of noise level
Place can eliminate the influence of noise.As shown in Figure 6 A and 6 B, in contrast C=4, when noise level is 1, static pixel and fortune
There is no overlapping region between dynamic pixel, but under same contrast, when noise level is 2, as shown in Figure 6B, static pixel and
There is overlapping region between movement pixel, if detected using 2 times of traditional noise levels, substantial amounts of missing inspection can be caused wrong
By mistake.
The adaptive low specific computational methods than degree region detection of noise
Step 21, Contrast-to-noise ratio X is calculated, as shown in formula (25)
Step 22, low contrast regions confidence level R_LC is calculated according to Contrast-to-noise ratio X.Fig. 7 A, 7B show two kinds
Calculate the curve of R_LC.Contrasted zones and high-contrast area threshold limit value X1, low confidence drop threshold X2 are set, wherein
X2 < X1, as X (i, j)≤X2, confidence level R_LC is 1, and as X2 < X (i, j) < X1, confidence level R_LC is with Contrast-to-noise ratio
The increase of X (i, j) is by 1 to 0 monotone decreasing, and confidence level R_LC is 0 during X1≤X (i, j).
Fig. 7 C show another curve for calculating R_LC, eliminate the influence of smooth area, specially set threshold X 1,
X2, X3, X4, wherein X4 < X3 < X2 < X1, as X (i, j)≤X4, confidence level R_LC is 0, is put as X4 < X (i, j) < X3
Reliability R_LC is with the increase of Contrast-to-noise ratio X by 0 to 1 monotonic increase, and confidence level R_LC is 1 during X3≤X (i, j)≤X2, when
Confidence level with the increase of R_LC Contrast-to-noise ratios X by 1 to 0 monotone decreasing, put by when X1≤X (i, j) during X2 < X (i, j) < X1
Reliability is 0.
Motion detection block receive frame difference feature calculation frame difference feature m and low contrast regions detection it is low
Contrast district confidence level R_LC is inputted, and is carried out the adaptive motion detection of contrast, is exported probability of motion.In low contrast confidence
The higher region of degree, moving between pixel and static pixel has larger overlapping region, at this time, the fortune brought due to undetected error
The distortion phenomenon of moving-target hangover is even more serious than the phenomenon that the noise that false-alarm error tape comes does not remove completely, so in low contrast
Region is spent, this patent is adjusted the parameter of motion detection with low contrast regions confidence level, the hair of undetected error is controlled with this
It is raw.
If the output of motion detection shows a kind of method of motion detection for probability of motion R_Motion, Fig. 8, wherein
T1, T2 are the soft-threshold for carrying out motion detection,:As m (i, j) < T1, the probability of motion R_Motion of pixel is 1, as T1≤m
During (i, j)≤T2 the probability of motion R_Motion of pixel with the increase of frame difference feature m by 1 to 0 monotone decreasing, as T2 < m
The probability of motion R_Motion of pixel is 0 when (i, j).
The parameter of motion detection is adjusted using low contrast regions confidence level, in low contrast regions, will be moved
The parameter adjustment of detection is to more encouraging pixel to be detected as movement pixel, so as to reduce omission factor.If examined using the movement of Fig. 8
Survey method, method of adjustment is reduces movement inspection threshold value, as shown in formula (26), (27)
T1 (i, j)=(1- α R_LC (i, j)) * T1Preset (26)
T2 (i, j)=(1- β R_LC (i, j)) * T2Preset (27)
T1PresetAnd T2PresetFor default motion detection parameters, can be set according to traditional method for testing motion, α
It is the parameter that is previously set with β.It can be set to α=0.5, β=0.5.Then in high-contrast area, low contrast confidence level R_
LC (i, j)=0, then T1 (i, j)=T1Preset, T2 (i, j)=T2Preset, traditional method for testing motion can be deteriorated to, is protected
Card high-contrast area had not both had false-alarm mistake, also without undetected error, so as to ensure denoising effect, and in low contrast regions,
Low contrast confidence level R_LC (i, j)=0, then T1 (i, j)=(1- α) * T1Preset, T2 (i, j)=(1- β) * T2Preset, threshold value
Reduce, so as to so that the generation of control undetected error.
Motion Adaptive time-domain filtering module receives the probability of motion R_Motion inputs of motion detection block calculating, and
Present incoming frame image and frame in depositing it is previous filtering frame input, with probability of motion instruct present image and it is previous filtering frame plus
Power filtering.The big pixel of probability of motion does not use time-domain Weighting Filter, and the small pixel of probability of motion takes time-domain Weighting Filter.From
And while stagnant zone denoising is reached, moving target hangover and time domain blooming will not be produced in moving region.