Abstract:
In a global motion estimation, profiles (Prof 1 , Prof 2 , ProO, Prof 4 ) are determined of frames (FR 1 , FR 2 , FR 3 , FR 4 ) of an input video signal. Each profile comprises a value, for each pixel in a first direction of the frame, which is obtained by combining pixels in a second direction of the frame. The profiles are updated (Upd Prof) with a first shift (Δx′ 12 , Δx′ 2 , Δx′ 34 ) to obtain updated profiles (Prof 1 ′, Prof′, Pro 3 ′, and the updated profiles are matched (S/M) to obtain a secondary shift (Δx′ 12 , Δx′ 23 ). Preferably, the first shift is a zero shift. The updating may be effected by shifting one of the profiles over the first shift to obtain a shifted profile, and subtracting another one of the profiles from the shifted profile. If the second direction is the vertical direction, the profile may comprise a vertically combined (e.g. averaged) pixel value for each pixel in the horizontal direction.

Description:
FIELD OF THE INVENTION 
       [0001]    The invention relates to a method and device for global motion estimation. 
       BACKGROUND OF THE INVENTION 
       [0002]    Motion estimation in general, and global motion estimation in particular, is a common field of activity within video processing. Global motion estimation usually serves as an enabling technology to a wide variety of algorithms, such as temporal interpolation and camera stabilization. Global motion estimation is sometimes used as a cost-effective alternative to block/pixel accurate motion estimation. 
         [0003]    A fundamental problem in global motion estimation is to distinguish between global and non-global motion. Global motion estimation assumes that all motion in an image can be summarized in a few parameters. When the assumption of global motion estimation does not hold, then a global motion estimation will come up with unreliable answers, as it is designed to come up with a simple answer, one that does not explain, say, a globally moving scene with one or more independently moving objects in it. 
         [0004]    Problems that are not yet satisfactorily solved relate to whether global motion estimation can be used to reliably find background motion in the presence of foreground objects, whether global motion estimation can be used to estimate the motion of the foreground objects, and how to know when the motion is global. 
       SUMMARY OF THE INVENTION 
       [0005]    It is, inter alia, an object of the invention to provide improved global motion estimation. The invention is defined in the independent claims. Advantageous embodiments are defined in the dependent claims. 
         [0006]    In a global motion estimation in accordance with the present invention, profiles are determined of frames of an input video signal. Each profile comprises a value, for each pixel in a first direction of the frame, which is obtained by combining pixels in a second direction of the frame. The profiles are updated with a first shift to obtain updated profiles, and the updated profiles are matched to obtain a second shift. Preferably, the first or second shift is a zero shift. This is particularly advantageous at removing static structures such as subtitles or other on-screen graphics which remain static between frames. The zero shift can be automatically applied at one of the stages of the method or the method can test for the presence of a minimum in the difference between profiles at a zero value of shift before applying the zero shift to the profiles. More generally, the first shift is obtained by matching the profiles of mutually different frames. The updating may be effected by shifting one of the profiles over the shift to obtain a shifted profile, and subtracting another one of the profiles from the shifted profile. If the second direction is the vertical direction, the profile may comprise a vertically combined (e.g. averaged) pixel value for each pixel in the horizontal direction. Pairs of updated profiles can be compared in the same manner, at different values of shift, to find a shift which results in minimal error. 
         [0007]    One aspect of this invention presents a way to use simple global motion estimation in an iterative way to reliably estimate the background motion in the presence of foreground objects, and also to estimate the motion of the foreground objects in the video, i.e. to find foreground objects in addition to the larger background. 
         [0008]    Another aspect of this invention presents a way to quantify the quality of solutions found by the global motion estimation, so that one can judge how global the solution is, or how prominent an additional foreground object is present. 
         [0009]    In an embodiment of the invention, profile matching is applied. For each horizontal position separately, vertically averaged pixel values (thus averaging all video lines) are determined. In this manner, a horizontal profile is created for each frame. Such a horizontal profile can be used to detect a horizontal shift by comparing the profile of one frame with respect to another, e.g. by determining a mean absolute difference for each possible shift: the shift at which the minimum difference occurs represents the (main) horizontal shift. In a similar manner, vertical profiles can be obtained by horizontally averaging all pixels of a line, which vertical profile can be used to detect a vertical shift or vertical motion component. So, to obtain both horizontal and vertical motion components, the invention is carried out twice. Clearly, instead of averaging, another operation like adding may be used. 
         [0010]    In accordance with an aspect of the invention, to determine a secondary shift, a residue is computed by subtracting the profiles at the optimal shift, thus eliminating the first solution from the data. Then the secondary shift can be found by matching the residual profiles, using the same matching procedure as used to determine the main shift. 
         [0011]    Preferably, once the secondary shift has been determined, the original profiles are updated with the secondary shift, and the main shift is estimated again. In this manner it is possible to obtain a more accurate estimate for the main shift, as the data are no longer polluted by the secondary shift. 
         [0012]    In an embodiment, zero motion components (static structures like subtitles) are eliminated first, where after background motion can be reliably detected. Static structures are common issues in TV images, which advocates checking the presence of a zero shift always, as the additional computational costs seem limited. The second stage global motion detection then comes down to matching profiles of frame differences. 
         [0013]    The frames that are operated on can be directly adjacent to one another in the video signal. For example, if an input video signal has frames numbered  1 ,  2 ,  3  . . . the method can operate on frames  1  and  2 , frames  2  and  3 , etc. However, the frames that are operated on could be more widely spaced within the input video signal, such as every fourth or eighth frame. The temporal spacing of the frames that are operated upon will be based on factors such as the processing resources available to perform the method and the speed of motion to be estimated. 
         [0014]    The functionality of this invention can be implemented in software, hardware or a combination of these. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed processor. Accordingly, another aspect of the invention provides software comprising instructions (code) which, when executed by a computer or processor, implements the method. The software may be tangibly embodied on an electronic memory device, hard disk, optical disk or other machine-readable storage medium or it may be downloaded to a processing device via a network connection. 
         [0015]    These and other aspects of the invention will be apparent from and elucidated with reference to the embodiments described hereinafter. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0016]      FIG. 1  shows profiles of line-averaged pixel value for two frames mutually shifted by 10 pixels; 
           [0017]      FIG. 2  shows the match error between the two profiles of  FIG. 1 ; 
           [0018]      FIG. 3  shows profiles of two subsequent frames in a real scene; 
           [0019]      FIG. 4  shows the match error as a function of the pixel shift for the case of  FIG. 3 ; 
           [0020]      FIG. 5  shows residuals of the profiles shown in  FIG. 3 ; 
           [0021]      FIG. 6  shows the match error as a function of the pixel shift of the residual profile of  FIG. 5 ; 
           [0022]      FIG. 7  shows a block diagram of the iterative matching procedure; and 
           [0023]      FIG. 8  illustrates a confidence metric. 
       
    
    
     DETAILED DESCRIPTION OF EMBODIMENTS 
       [0024]      FIG. 1  shows profiles (line average LA vs. pixel index PI) of line-averaged pixel value for two frames mutually shifted by 10 pixels. The first frame is represented by a dotted line, whereas the second frame is represented by a solid line. The curves are identical, apart from a horizontal shift by 10 pixels. 
         [0025]      FIG. 2  shows the match error ME between the two profiles of  FIG. 1  (as a mean-absolute difference) as a function of the horizontal pixel shift PS from the first frame relative to the second frame. The match error is zero at a pixel shift (Δx) of precisely 10 pixels. Furthermore, the match error exhibits a well-defined sharp profile and thus a clear global minimum of the match error. 
         [0026]      FIG. 3  shows profiles (line average LA vs. pixel index PI) of two subsequent frames (frame FR n shown with a dotted line, and frame FR n+1 shown with a solid line) in a real scene with a rightward moving background BG, and a static foreground FG, dominated by high-contrast edges of subtitles. In this case, one can see portions of the profiles that coincide (indicating no horizontal motion), whereas other portions do not coincide but seem shifted by about 10 pixels. Here there are, at least, two solutions, rather than only one to the global (horizontal) motion. 
         [0027]      FIG. 4  shows the match error ME as a function of the pixel shift PS for the case of  FIG. 3 . Note that this curve shows two minima: a global minimum caused by the background motion at +10 pixels (BG), and a local minimum caused by the static foreground at 0 pixels (FG). Thus, in contrast to  FIG. 2 , this profile does not define a single sharp and clear minimum. 
         [0028]      FIG. 5  shows residuals (differential line average DIF-LA vs. pixel index PI) of the profiles shown in  FIG. 3 . The first solution, at a shift of Δx=0 pixels, has been eliminated by subtracting the profiles of consecutive frames. The dotted line shows the residual profile of two frames, say frame FR n and frame FR n+1, whereas the solid line shows the residual profile of the next frame pair, i.e. frame FR n+1 and frame FR n+2. Note that, in contrast to the profiles in  FIG. 3 , the residual profiles are very similar in shape and differ only by a horizontal shift. 
         [0029]      FIG. 6  shows the match error ME as a function of the pixel shift PS of the residual profile of  FIG. 5 . Compared to  FIG. 4 , the solution at shift Δx=0 has been subtracted from the profiles. Matching of the residuals now clearly shows the second solution at a well-defined minimum at Δx being about 10 pixels. See also the match error ideal for ‘pure’ global motion in  FIG. 2 . 
         [0030]      FIG. 7  shows a flowchart of the iterative matching procedure. Consecutive frames FR 1 , FR 2 , FR 3 , FR 4  serve as the initial input for computation (Comp Prof) of profiles (Prof 1 /Prof 2 /Prof 3 /Prof 4 ). Next, the profiles are compared in shift/matching operations S/M, resulting in an optimal match and corresponding shifts Δx 12 , Δx 23  and Δx 34 . On the third row from the top, the profiles are updated in update profile operations Upd Prof: the profiles are subtracted from each other after being shifted by the optimal shift Δx 12 , Δx 23  and Δx 34 . Finally, the updated profiles are matched in a second shift/matching operation S/M resulting a second solution, thus a second set of optimal shifts Δx′ 12  and Δx′ 23 . In theory, this process can be repeated until all solutions are found. For each additional iteration the block diagram is extended downward by adding a further row of Update Profile (Upd Prof) operations and shift/matching operations (S/M). 
         [0031]    A confidence metric may be applied to quantify the quality of the solution (i.e. of the minimum), and to decide whether to accept/discard global motion vectors that result from the proposed method. The metric expresses that confidence is high if the global minimum is well defined (i.e. is the minimum value a ‘sharp dip’?) and that local minima are not prominent. To illustrate the confidence metric,  FIG. 8  shows a plot of match error (ME) vs. pixel shift (PS) graph. Firstly, the height of the response is examined at pixel shifts which are offset by the values ±d from the position of the global minimum (positioned at a shift PS=10 pixels). The vertical distances Δy 1 , Δy 2  at these ±d points should be large if the minimum is sharply defined. Secondly, the height of any other minimum points (Δy 3 ) is examined. The height of these other local minimum points should be large. The minimum of these 3 values can be remapped to a range [0.1], resulting in a confidence metric, with 0 meaning ‘no confidence’ and 1 meaning ‘full confidence’. Alternatively, some other operation can be performed based on one or more of these values. In this example, the confidence would be low as the local minimum is too prominent (i.e. Δy 3  is too small). 
         [0032]    The confidence metric can also be used to select a shift value. During the shift/matching operation, a value of match error is obtained for a range of possible shift values, as shown in  FIG. 4 . The graph of match error vs. shift value may have multiple possible minima. A confidence metric can be calculated for each of the possible minima and the confidence metrics can be used to select the ‘best’ quality minima and the shift value corresponding to that minima. That shift value is then used when subsequently updating the profiles. 
         [0033]    A preferred embodiment of the invention can be summarized as follows. Match profiles by shifting, which results in a first solution at minimum match error. Then update the profile by subtracting profiles after shifting with the first solution. Then match the updated profiles by shifting to obtain a second solution at minimum match error. The quality of both solutions is calculated using a confidence metric (‘is the minimum a well-defined minimum?’). This scheme enables finding foreground objects in a predominantly (# pixels=large) background scene, which occurs often e.g. when an object/actor is being followed by the camera, thus being static on the camera image, yet creating background movement on the acquired video. 
         [0034]    In a special case thereof, the algorithm first updates the profiles by subtracting profiles with zero shift (i.e. to eliminate static structures). Then match updated profiles by shifting to find any solution. The quality of both solutions is calculated using a confidence metric. This special case is a meaningful, easier case. Static structures are common issues in TV images, which advocates checking the presence of a zero shift always, as the additional computational costs seem limited. Although it is preferred to apply the zero shift first, to remove static structures, the zero shift can alternatively be used at the second stage of updating the profiles. 
         [0035]    In the flowchart of  FIG. 7 , the method proceeds in the downward direction to determine first, second, third etc. shift values. At each stage, updated profiles are used. In an alternative embodiment of the invention, once the second shift has been determined, the original profiles (i.e. the profiles of FR 1 , FR 2 , FR 3 ) are updated with the second shift value. That is, one of the original profiles is shifted by the second shift value, and then subtracted from another of the original profiles. This has the effect of removing the secondary motion (the second shift value). The updated profiles resulting from this operation are then compared at varying shift values to determine a shift value that gives a minimum in a difference between the updated profiles. This minimum should represent the main shift due to global motion. This embodiment has an advantage that it is possible to determine the main shift with greater accuracy, since the data in the updated profiles is no longer polluted by the secondary motion. 
         [0036]    It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. The notion of a ‘frame’ includes the notion of a ‘field’. This specification may be used to program a video processor for use in a television set or other video signal-processing device to obtain an enhanced video signal. Such an enhanced video signal may have an increased number of fields per second in comparison with the input video signal, or may be a non-interlaced version of an interlaced input video signal, or may have been subjected to processing to eliminate artifacts resulting from a film-to-video signal conversion, or may have been compensated for unintended hand-held camera movements. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word “comprising” does not exclude the presence of elements or steps other than those listed in a claim. The word “a” or “an” preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and/or by means of a suitably programmed processor. In the device claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.