Key Parameters for DIS Tuning

Before using the DIS, you need to set DIS configuration and attributes. The DIS effect varies depending on the parameter values. This section describes how to set several important parameters that may affect the DIS effect.

Key Parameters of Hi_mpi_vi_set_chn_dis_config

  • crop_ratio

    Cropping ratio of the DIS output image. The value range is [50, 98]. Generally, this parameter is set to 80, which means only 80% of the image is output after DIS processing. For example, crop_ratio is set to 80 for an input image of 1920 (width) x 1080 (height) pixels, that is, 10% of the left, right, top, and bottom edges of the input image are cropped, the width of the cropped image is 1536 (1920 - 2 x 1920 x 10%) and the height is 864 (1080 - 2 x 1080 x 10%). Note: If the width and height are not 4-pixel aligned after cropping, make them 4-pixel aligned downwards.

    • When the video input resolution is greater than or equal to 1920 x 1080, the minimum value of crop_ratio is 50.
    • When the input resolution is less than 1920 x 1080, you are advised to set crop_ratio to a value greater than or equal to 70.
  • mode

    The DIS algorithm involves the concept of degree of freedom (DoF). From the user's perspective, the DoF concept indicates the three-dimensional space, where each of the X, Y, and Z axes can be translated and rotated. That is, there are a total of six motions, which is also called 6DoF DIS. From the algorithm's perspective, DoF indicates the number of operators used in the 3x3 matrix of affine transformation. The affine transformation operation varies with the DoF numbers.

    The differences between 4DoF and 6DoF are as follows:

    • 4DoF: Four operators are used in the algorithm to perform translation, rotation, and zoom-in operations on images. Compared with 6_DOF, 6_DOF has two fewer operators. The fewer the operators, the less the possibility of misjudgment. 6_DOF can prevent background dragging caused by large-scale object movement. The rolling shutter phenomenon is obvious.
    • 6DoF: Six operators are used in the algorithm to translate, rotate, zoom in, shear, and change the aspect ratio of images. Compared with 4DoF, 6DoF has a better DIS effect and can calibrate parallelograms, but may cause background ghosting.
  • motion_level

    Camera motion levels include HI_DIS_MOTION_LEVEL_LOW, HI_DIS_MOTION_LEVEL_NORMAL, and HI_DIS_MOTION_LEVEL_HIGH. This parameter is generally set to HI_DIS_MOTION_LEVEL_NORMAL. You can adjust it as required.

    • HI_DIS_MOTION_LEVEL_LOW: The camera moves slightly. It is not supported by the current version.
    • HI_DIS_MOTION_LEVEL_NORMAL: The camera moves normally.
    • HI_DIS_MOTION_LEVEL_HIGH: The camera moves greatly.
  • pdt_type

    Product type supported by the DIS. The current version supports IP cameras (IPCs), DVs, and drones. Set the product type based on the product in use.

  • camera_steady

    Switch for determining whether the camera is fixed and static. This parameter takes effect only when IPC products are used. In case of DV and UAV products, this parameter is invalid, and the default value is HI_FALSE.

Key Parameters of hi_mpi_vi_set_chn_dis_attr

  • moving_subject_level

    Determines whether an object is moving. The value range is [0, 6]. This parameter is used to prevent background ghosting. This parameter represents the balance between background ghosting and DIS effect.

    • A smaller value indicates higher stability during the motion process but proneness to background ghosting.
    • A larger value can prevent background ghosting but compromise the DIS effect.
  • rolling_shutter_coef

    Calibrates the rolling shutter strength. The value range is [0, 1000]. This parameter is applicable to scenarios where the camera keeps moving in one direction for a long time, for example, shooting an outdoor scene on a train. For the rolling shutter caused by shakes, you are advised to set this parameter to 0 because the algorithm adaptively detects and corrects the rolling shutter.

  • horizontal_limit and vertical_limit

    Indicate the horizontal and vertical offset limits respectively. The value range is [0, 1000]. When the horizontal offset of the background ghosting caused by a large object exceeds a certain amplitude, the DIS is not performed. The offset amplitude is calculated as follows: 2047 x horizontal_limit/1000.

    This parameter must be used with camera_steady and is valid only when camera_steady is set to HI_TRUE. When camera_steady is set to HI_FALSE, the value is set to 1000 by default.

  • still_crop

    Disables the DIS while retaining the original cropping ratio for output. If this parameter is set to HI_TRUE, the output image has no DIS effect, but the cropping ratio of the output image is the same as that with the DIS effect. Typically this parameter is set to HI_FALSE. It can be set to HI_TRUE if required.

Key Parameters of hi_mpi_vi_set_chn_dis_param

large_motion_stable_coef, low_freq_motion_preserve, and low_freq_motion_freq take effect only in GME mode.

  • large_motion_stable_coef

    In the case of large jitter, if the DIS is enabled too strong, the DIS requirements may fail to be met even if the image is cropped to the edge, leading to frame freezing.

    This parameter is used to perform DIS attenuation on large motions to reduce the frame freezing caused by image cropping to the edge. The value range is [0, 100]. When the value is set to 100, the DIS is not attenuated. In normal cases, the DIS effect is the best. However, the image may be cropped to the edge when the jitter is large. Decreasing the value of this parameter can attenuate the DIS effect with large jitter. In this way, the DIS effect can be balanced with frame freezing caused by image cropping to the edge. Setting this parameter to 0 will compromise all DIS effects. The default value is 100.

  • low_freq_motion_preserve

    With low-frequency motion estimation, the action DV preserves active low-frequency motion while eliminating high-frequency jitter. This parameter is used to adjust the degree of preserving low-frequency motion. The value range is [0, 100]. If this parameter is set to 100, all low-frequency motions are preserved. If this parameter is set to 0, no low-frequency motion is preserved. If the jitter range does not exceed the cropping ratio, the image is expected to be still. However, once a large amount of active motion is accumulated, the image is easily cropped to the edge, causing frame freezing. The default value is 10.

  • low_freq_motion_freq

    With low-frequency motion estimation, the action DV preserves active low-frequency motion while eliminating high-frequency jitter. This parameter specifies the low-frequency motion frequency. The value range is [0, 100]. If this parameter is set to 0, the minimum amount of low-frequency motion is preserved and the best DIS effect can be achieved theoretically. However, the image is easily cropped to the edge, causing frame freezing. If this parameter is set to 100, the cutoff frequency of low-frequency motion is the highest, and the maximum amount of low-frequency motion is preserved. The default value is 100.