acldvppSetResizeConfigInterpolation

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

x

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

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 products, 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.
For the Atlas inference products, the following resizing algorithms are supported:
  • 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.
For the Atlas 200I/500 A2 inference products, Atlas A2 training products/Atlas A2 inference products, and Atlas A3 training products/Atlas A3 inference products, the following resizing algorithms are supported:
  • 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 × 6 to 8192 × 8192 and an output image resolution ranging from 10 × 6 to 4096 × 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; else, failure. For details, see aclError.