Background technology
Panoramic video is widely used in the application such as sports cast, three-dimensional movie, multipart video-meeting.One width of cloth panoramic picture is to do rotation or convergent-divergent motion by the flake video camera of six or octahedral around fixing axle, the same time domain of scene around the video camera is taken the photo of different azimuth, seamless spliced these photos with some " stitching " technology, again according to cylinder or the sphere mapping algorithm is mapped to cylinder figure or spherical diagram forms.Therefore, the resolution of panoramic picture is in general than higher, and the motion details is abundanter.And because panoramic video be in order to allow the user have reality scene to experience, the camera motion of general virtual support reappears, and therefore, the staggered feature of global motion and local motion is more obvious.Moreover cylinder and sphere mapping algorithm can cause the object of which movement distortion, make the difficulty of estimation strengthen.But simultaneously, we can find from the analysis of two dimensional surface coordinate mapping cylinder areal coordinate and spherical coordinate, the motion deformation of panoramic picture object on cylinder or sphere mainly shows as the deformation that motion is cut in video camera rotation, convergent-divergent, mistake, therefore, we can use global motion model to come panoramic video is carried out the overall motion estimation compensation.
But, in the past studies show that overall motion estimation exists the big problem of amount of calculation.The overall motion estimation key is the estimation to global motion model parameters.In theory, for a definite global motion parameter model, as affine six movement parameter models, only the motion vector of 3 background pixel points of need can be tried to achieve the value of six kinematic parameters.But general motion vector method can only obtain the limited motion vector of precision, if only estimate global motion model parameters with seldom several pixel motion vector, the precision as a result that obtains is very low, therefore needs more pixel motion vector to participate in global motion model parameters and estimates to improve accuracy.Like this, parameter Estimation has just become a problem of separating the inconsistent equation group, and available least square method is found the solution, as Gauss's Newton iteration method.By the several iterative computation group of solving an equation, to the last the global motion model parameters value converges on a comparatively stable value.But this iterative process is the highest part of computation complexity in the overall motion estimation, especially when the global motion model of need handling comparatively complicated, under the more situation of iterations.
Moreover, most video scene all includes global motion and local motion, if allow all pixel motion vector all participate in overall motion estimation, pixel and the bigger pixel of estimation of motion vectors error of then making local motion can produce very big interference to overall motion estimation, make motion model parameters estimate just to be converged on a stationary value many times by iteration.Not only reduce the precision of overall motion estimation, and made computational complexity raise greatly.
Pixel in the local motion zone, we are called exterior point, the global motion pixel, we are called interior point.The emphasis of the quick global motion estimation method that we will study effectively splits the local motion zone from the view picture image exactly, makes the global motion zone comprise interior point as much as possible and the least possible exterior point.Key and the difficult point of distinguishing exterior point and interior point are determining of threshold value T.In some document, T is set to a fixing value (being referred to as the fixed threshold method), but often be difficult to find a suitable fixed threshold T to be competent at: if T is too little in whole iterative process, iterative process converges on the part that needs the local motion zone probably at the very start, when especially the local motion zone accounts for the large percentage of whole scene; When iteration finished if T is too big, the global motion pixel is misjudged some was the local motion point, thereby influences the accuracy of parameter Estimation greatly.Some document is mentioned with percentage threshold r% and is replaced threshold value T (being referred to as the fixed percentage threshold method), even the exterior point set is the set of the bigger r% pixel of residual values.But because to account for the scale of whole scene all inequality in the global motion zone in the different video, therefore this method or can only obtain the global motion zone of part, or in interior some set, can comprise a lot of exterior points.There is the scholar to propose a kind of improved method: to make the average (be referred to as residual error average threshold method) of threshold value T for the residual error of all pixels, but the residual error averaging method might not be portrayed the difference of global motion zone and local moving region well, and experimental result shows that also the some set converges on the local motion zone in this method may make in some cases.
Above-mentioned these inner regions determine that method is difficult to take into account the accuracy and the robustness of parameter Estimation, and often need to select a desirable threshold value in advance at different video scenes, and adaptability is relatively poor.
Embodiment
Below in conjunction with embodiment the present invention is further described:
The concrete enforcement of the present invention is carried out in two steps:
1. the first step is carried out the brightness residual threshold method.
When the utilization recurrent least square method was estimated global motion, the initialization input value was the motion vector that each macro block obtains after estimating through block matching motion in the image.The motion vector that is in the macro block in local motion zone does not belong to the set of point in the global motion, it is the exterior point that the global motion parameter Estimation is caused interference, will consume a large amount of operation time. therefore, if when using block matching algorithm to carry out estimation, just can carry out anticipation to the attribute of macro block estimation, find in advance may disturb the macro block of overall motion estimation and be rejected, will inevitably reduce the amount of calculation of overall motion estimation greatly.
Analysis to video image can find that the texture in global motion zone is than horn of plenty; And local motion generally is positioned at texture gray scale unanimity or the extremely level and smooth zone of gray scale.This is that comparatively speaking, the brightness residual between primitive frame and the reference frame corresponding blocks also seldom because the movable information that the local motion zone is comprised is fewer.Therefore, the monochrome information of the present invention after by the macro block motion compensation comes each macro block is carried out preanalysis, to judge whether this macro block belongs to the local motion macro block, if, then this macro block was rejected away from the global motion set of macroblocks before carrying out overall motion estimation, to save the computing cost of overall motion estimation, improve the precision of overall motion estimation.
This algorithm is divided into following four steps:
1) entire image is divided into the piece of non-overlapping copies, block size is 16 * 16, to the estimation of taking exercises of each piece, obtains the motion vector (Δ x, Δ y) of each piece with block matching algorithm.In theory, block size is more little, and motion estimation result is accurate more, an opposite extreme situations, and when block size is a pixel, then motion estimation result is the most accurate.But so, the complexity of estimation will raise greatly, need the motion vector bit number of coding transmission also more.This algorithm adopts 16 * 16, takes into account and considers computation complexity and estimation accuracy.Simultaneously, estimate that what we adopted is that three step search quick motions are estimated, further reduces the complexity of estimation for block matching motion.The motion vector (Δ x, Δ y) of each piece that obtains by block matching algorithm needs preserve, imports as the initialization of the second link motion vector residual error classification thresholds method of execution.
2) use motion vector (Δ x, Δ y) that the previous step block matching algorithm obtains to the compensation of taking exercises of each piece of present frame, obtain the predicted value I of each pixel of present frame
kBecause (Δ x, Δ y) representative is because the caused interframe local motion displacement MV of object motion itself
1, do after the inter motion compensation, then can passing threshold current frame pixel (i, brightness I j)
kWith in the next frame ((i, j)+MV
1) brightness of position pixel
Difference judge that (i j) is global motion area pixel or local motion area pixel to current frame pixel.
3) calculate all pixels in the current block gradient mean value S (i, j), wherein,
And in the corresponding blocks in reference frame all pixels gradient mean value S ' (i, j), wherein,
Relatively S (i, j) and S ' (i, the j) size of residual absolute value also is | S (i, j)-S ' (i, j).Be shown below:
In formula, m * n is a block size.
4) calculated threshold CgThreshold value CgDetermine according to following formula:
In the formula, N is the number that image is divided into the piece of non-overlapping copies, G
iBe the brightness residual (calculating) of i piece in the image according to formula 1,
Represent the brightness residual average of present frame.If the brightness residual G of current block
BLess than C
g, then current block is judged as the local motion region unit, rejects away from the global motion set of macroblocks.Consider threshold value critical point C
gValue excessively will cause global motion parameter Estimation failure, we determine that the value of k in the formula 2 is: under low code check situation, as the video sequence of encode CIF, QCIF form, k=1.1; Under high code check situation, as coding 4CIF, high definition, panoramic video sequence, k=1.2 also promptly is shown below:
Cg=1.1GAv, under the low code check situation (3)
Cg=1.2GAv, under the high code check situation
2. in second step, carry out motion vector residual error classification thresholds method.
Motion vector residual error ratio juris mainly is based on the difference of global motion vector and local motion vector, is the key point of this method to the tolerance of this difference.The present invention adopts a kind of classification thresholds method to realize the accurate division of this tolerance.The main thought of this algorithm is: in the starting stage of iteration, remove the exterior point of the overwhelming majority earlier with a big percentage threshold.Because at the beginning, the ratio that the exterior point that differs greatly with interior point accounts in image is maximum (local motion zone particularly, often comparatively significantly kinetic property difference is arranged) with the global motion zone, adopt a big percentage threshold can remove the big exterior point of these othernesses rapidly, in case got rid of the interference of the bigger exterior point of otherness earlier, then whole iterative process restrains sooner; For the first time after the iteration, obtained a rough overall motion estimation result, the pending exterior point that be left in the image this time is and the interior some pixel that difference is less, the ratio that accounts in image is little, in ensuing iteration several times, we can classification reduce the value of percentage threshold, get rid of the little exterior point of these othernesses gradually, the accurately set of point in the refinement, some set in exterior point as much as possible is all excluded.The specific algorithm step is as follows:
1) use block matching algorithm to estimate the local motion displacement of each piece of present frame.This step is carried out in the threshold method of a last link-based on brightness residual.
2) estimate motion model parameters.Consider that the global motion zone generally concentrates on image background regions, edge of image part just, we choose the motion vector of central block (block size is 16 * 16) of the image upper left corner, the upper right corner, three 48 * 48 image-regions in the lower left corner as the initialization input value of Gauss's Newton iteration estimation model parametric procedure first time, by Gauss's Newton iterative calculation, can draw initialized several motion model parameters values.
3) global motion vector of each piece (Δ x ', Δ y ') in the computed image.In the image, the piece motion of background area belongs to global motion, and the motion of the piece of foreground area belongs to local motion, but we still can be by in the motion model parameters value substitution Gauss again Newton iteration that obtains in rapid previous step, coordinate (x according to each piece central pixel point, y) value calculates respectively " global motion vector " of each piece.For the local motion piece, this motion vector is pseudo-global motion vector.
4) calculating kinematical vector residual error.For same, the motion vector (Δ x ', Δ y ') of this piece that draws in the motion vector (Δ x, Δ y) of this piece that step (1) is drawn and the step (3) is made variance, as shown in Equation 4.The purpose of calculating kinematical vector residual error is for the actual motion vector of judging this block of pixels and the difference of global motion vector, if the motion vector residual error is bigger, illustrate that this piece probably is the local motion piece, otherwise this piece probably is the global motion piece.
5) percentage threshold is set and gets rid of the local motion piece.We adopt the percentage threshold P of a hierarchical subtractive clustering to come progressively meticulous global motion zone, and the motion vector threshold residual value T that a hierarchical subtractive clustering is set simultaneously judges whether this iteration can finish.In first time iterative process, the initial value that we are provided with P is 50.It is 0.04 that T is set simultaneously, that is:
The piece of the P percentage that is no more than image block number summation at most that satisfies the following formula condition is labeled as the local motion piece, and the remaining global motion piece that is labeled as is as the set of blocks of overall motion estimation iterative computation next time.If the motion vector residual error of all pieces does not satisfy the following formula condition in this overall motion estimation set of blocks, then finish this iteration, generate final motion model parameters, simultaneously can be partitioned into the local motion zone according to the local motion set of blocks of each iteration institute mark.The rule of successively decreasing of P and T: before at every turn entering the iterative computation of a new round, P is updated to 1/4th (P=P/4) of P, promptly in the iterative process second time, P is made as 12.5, and in the iterative process, P is made as 3.125 for the third time ... this is because of the increase along with iterations, interior some set more and more tends towards stability, the exterior point that is comprised is fewer and feweri, so the P value needs linear decrease, in order to avoid iteration convergence is in the part of interior some set.Simultaneously T is updated to T=T-0.01, because after each iteration end, the motion vector residual error of remaining piece is littler, wherein some is the local motion piece littler with the global motion attribute difference for this, need differentiate them with a littler T.When the iteration result tends to stable, can reach the quickening iteration convergence simultaneously with the T that successively decreases, lower computation complexity and guarantee the progressively meticulous purpose of overall motion estimation result.After Gauss's Newton iteration finishes for the first time, a new cover motion model parameters value will be obtained.The input value of this cover motion model parameters value as next round Gauss Newton iteration.
6) repeating step 3), 4), 5), all equal 4 up to the motion vector residual error of all pieces, then the finishing iteration process less than T or iterations.Experiment showed, that working as iterations surpasses 4 times, the accuracy increase of separating of model parameter is extremely limited, that is to say, 4th, the result of the 5th, the 6th iteration is very approximate, even is as good as, model parameter separate a limit that has reached this classification thresholds iterative method accuracy.
It should be noted last that above embodiment is only unrestricted in order to technical scheme of the present invention to be described.Although the present invention is had been described in detail with reference to embodiment, those of ordinary skill in the art is to be understood that, technical scheme of the present invention is made amendment or is equal to replacement, do not break away from the spirit and scope of technical solution of the present invention, it all should be encompassed in the claim of the present invention.