Method for stabilizing a first sequence of digital image frames and image stabilization unit
A method for stabilizing a first sequence of digital image frames is provided including determining a dominant motion vector of a dominant motion layer of said sequence; determining a first part of the dominant motion vector representative of an intended motion in said sequence; determining a second part of the dominant motion vector representative of an unintended motion in said sequence; and generating a second sequence from the first sequence based on the second part. A corresponding image stabilization unit is provided as well.
1. A method for stabilizing a first sequence of digital image frames comprising:
determining a dominant motion vector of a dominant motion layer of said first sequence;
determining a first part of the dominant motion vector representative of an intended motion in said first sequence;
determining a second part of the dominant motion vector representative of an unintended motion in said first sequence;
generating a second sequence from the first sequence based on the second part, the dominant motion vector being determined based on a weighted combination of all vectors that constitute the dominant motion layer;
refining a current estimate of the dominant motion layer by weighting out motion vectors that are beyond a predetermined distance from the dominant motion vector, the dominant motion layer being represented as a matrix including values between a first value and a second value, the first value in the matrix indicating an outlier, and the second value in the matrix indicating an inlier;
setting a third value in the matrix to the first value when the third value is below a first predetermined threshold; and
setting a fourth value in the matrix to the second value when the fourth value is above a second predetermined threshold.
2. The method according to claim 1 wherein said determining the first part includes
applying a low pass filter to the dominant motion vector.
3. The method according to claim 2 , wherein said applying the low pass filter includes
applying a moving average to the dominant motion vector.
4. An image stabilization apparatus for stabilizing a first sequence of digital image frames comprising:
a processor configured:
to determine a dominant motion vector of a dominant motion layer of said first sequence;
to determine a first part of the dominant motion vector representative of an intended motion in said first sequence;
to determine a second part of the dominant motion vector representative of an unintended motion in said first sequence;
to refine a current estimate of the dominant motion layer by weighting out motion vectors that are beyond a predetermined distance from the dominant motion vector, the dominant motion layer being represented as a matrix including values between a first value and a second value, the first value in the matrix indicating an outlier, and the second value in the matrix indicating an inlier;
to set a third value in the matrix to the first value when the third value is below a first predetermined threshold; and
to set a fourth value in the matrix to the second value when the fourth value is above a second predetermined threshold; and
a frame renderer configured to generate a second sequence from the first sequence based on the second part,
wherein the dominant motion vector is determined based on a weighted combination of all vectors that constitute the dominant motion layer.
5. A non-transitory computer-readable storage medium including computer-program instructions, which when executed by a computer, cause the computer to perform a method comprising:
determining a dominant motion vector of a dominant motion layer of a first sequence of digital images;
determining a first part of the dominant motion vector representative of an intended motion in said first sequence;
determining a second part of the dominant motion vector representative of an unintended motion in said first sequence;
generating a second sequence from the first sequence based on the second part, the dominant motion vector being determined based on a weighted combination of all vectors that constitute the dominant motion layer;
refining a current estimate of the dominant motion layer by weighting out motion vectors that are beyond a predetermined distance from the dominant motion vector, the dominant motion layer being represented as a matrix including values between a first value and a second value, the first value in the matrix indicating an outlier, and the second value in the matrix indicating an inlier;
setting a third value in the matrix to the first value when the third value is below a first predetermined threshold; and
setting a fourth value in the matrix to the second value when the fourth value is above a second predetermined threshold.
6. The method according to claim 1 ,
wherein the first value is 0 and the second value is 1,
wherein the first predetermined threshold is 0.25, and
wherein the second predetermined threshold is 0.75.
7. The method according to claim 1 ,
wherein the first predetermined threshold and the second predetermined threshold are values between the first value and the second value.