acldvppSetResizeConfigInterpolation

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function

Sets the image resizing algorithm.

Prototype

1
aclError acldvppSetResizeConfigInterpolation(acldvppResizeConfig *resizeConfig, uint32_t interpolation)

Parameters

Parameter

Input/Output

Description

resizeConfig

Output

Pointer to resizing configuration to be set.

Call acldvppCreateResizeConfig to create data of the acldvppResizeConfig type in advance.

interpolation

Input

Resizing algorithm. You are advised to use the same resizing algorithm as in model training.

For the Atlas training product, the following resizing algorithms are supported:
  • 0 (default): high-order filtering algorithm developed by Huawei.
  • 1: conventional bilinear algorithm, whose compute process is close to that of OpenCV.
  • 2: conventional nearest neighbor algorithm, whose compute process is close to that of OpenCV.
  • 3: conventional bilinear algorithm, whose compute process is close to that of TensorFlow.
  • 4: conventional nearest neighbor algorithm, whose compute process is close to that of TensorFlow.
The following resizing algorithms are supported for Atlas inference product. :
  • 0: The system automatically uses the value 1 (even if 0 is set).
  • 1: conventional bilinear algorithm, whose compute process is close to that of OpenCV.

    When this algorithm is set and the input and output images are in RGB format, the maximum difference between the pixel value of the algorithm and that of OpenCV is ±1 within the resizing range of [1/32, 512].

  • 2: conventional nearest neighbor algorithm, whose compute process is close to that of OpenCV.
The following resizing algorithms are supported for Atlas 200I/500 A2 inference product, Atlas A2 training product/Atlas A2 inference product, and Atlas A3 training product/Atlas A3 inference product:
  • 0: The system automatically uses the value 1 (even if 0 is set).
  • 1: conventional bilinear algorithm, whose compute result is close to that of OpenCV-3.4.2.
  • 2: conventional nearest neighbor algorithm, whose compute result is close to that of OpenCV-3.4.2.
  • 3: conventional bilinear algorithm (same as 1).
  • 4: conventional nearest neighbor algorithm (same as 2).
  • 5: high-order filtering algorithm developed by Huawei.

    This resizing algorithm supports only an input image resolution ranging from 10 x 6 to 8192 x 8192 and an output image resolution ranging from 10 x 6 to 4096 x 8192. The input image format must be YUV, excluding the Planner, YUV400, and YUV440 formats. The output image format must be YUV420SP NV12 8-bit or YUV420SP NV21 8-bit. The resizing range of the width or height is [1/32, 16].

Returns

0 on success; otherwise, failure. For details, see aclError.