DIS Introduction

The digital image stabilization (DIS) technology is used to correct motion blur due to motion of a camera. The motion offset of the image is calculated by using the DIS algorithm, and then the image is panned or tilted based on the motion offset to prevent a blurry image.

Video jitter or instability occurs due to the environment or human factors during video capturing by using a camera. For example, the camera may be affected by vibrations caused by the wind or passed cars, the handheld DV may be affected by human movement, and the event data recorder may be affected by car vibrations. Video jitters need to be eliminated to reduce the blurring and ensure video quality.

Principles

The DIS in essence is the two-dimensional affine transformation process on images based on the motion offset. Affine transformation includes translation, rotation, scaling, and shearing (parallelogram transformation) of images. The transformation can be illustrated by using a 3x3 matrix.

The 3x3 matrix is the motion offset to be calculated by the DIS algorithm. (x,y) indicate the coordinates of the original image, and (x';,y';) indicate the coordinates after transformation.

When transformation is performed on an image, the positions of image pixels are changed. The image edges may exceed the width and height of the original image, and pixels may be translated out of the entire image. Therefore, the image must be cropped and enlarged during DIS operations. Image edges are cropped based on certain cropping ratio after the transformation, and then the cropped image is enlarged based on the original width and height. See the following figure.

Figure 1 DIS working principle

There are two algorithms for calculating the DIS motion offset:

  • Global motion estimation (GME) algorithm

    The GME algorithm calculates the motion offset between the current frame and the reference frame by extracting image features. The image is stabler after being processed by the GME algorithm. However, background ghosting appears if a large area of objects in the image is moving. This is because the GME algorithm cannot completely differentiate object movement and camera movement, which may result in misjudgment. In addition, the DIS effect of the GME algorithm may deteriorate due to blurred image features in low light.

  • Gyroscope algorithm

    The gyroscope algorithm calculates the motion offset of the current frame based on the data generated by the gyroscope. Using this algorithm helps eliminate misjudgment and achieve good DIS effect for images taken in low light.

API Call Sequence

Debugging the DIS function involves adjustment of parameters for the following APIs. For details about the APIs and their parameters, see the API description in "VI".

  • hi_mpi_vi_set_chn_dis_config
  • hi_mpi_vi_set_chn_dis_attr
  • hi_mpi_vi_set_chn_dis_param

The DIS function is integrated in the VI module. The following figure shows the functional block diagram of VI channels.

Figure 2 Functional block diagram of VI channels
  • DIS works only on physical channels.
  • The DIS video input image format can be linear semi-planar 420 and single-component. Only uncompressed images are supported.
  • The supported range of the aspect ratio for the DIS input image is 16:3 to 16:27.
  • During DIS processing, the VGS or GDC module is required. When multiple modules are calling the VGS or GDC module, frame loss may be caused due to insufficient VGS or GDC performance.

Basic Concepts

An inertial measurement unit (IMU) is an apparatus for measuring three-axis posture angles (or angular velocities) and accelerations of an object, like a gyroscopes or an accelerometer.