Function: dvpp_set_resize_config_interpolation

Applicable Products

Product

Supported (√/x)

Ascend 950PR&950DT products

x

Atlas A3 products

√

Atlas A2 products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Description

Sets the image resizing algorithm.

Prototype

  • C Prototype
    1
    aclError acldvppSetResizeConfigInterpolation(acldvppResizeConfig *resizeConfig, uint32_t interpolation)
    
  • Python Function
    1
    ret = acl.media.dvpp_set_resize_config_interpolation(dvpp_resize_config,  interpolation)
    

Parameters

Parameter

Description

dvpp_resize_config

Int, pointer address of the resizing configuration data to be set. Call acl.media.dvpp_create_resize_config to create data of the acldvppResizeConfig type in advance.

interpolation

Int, resizing algorithm. You are advised to use the same resizing algorithm as that in model training.

Atlas training products support the following resizing algorithms:
  • 0 (default): proprietary high-order filtering algorithm.
  • 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.
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.
Atlas 200I/500 A2 inference products support the following resizing algorithms:
  • 0 (default): proprietary high-order filtering algorithm.
  • 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: proprietary high-order filtering algorithm.

    The resizing algorithm supports only the input image resolution ranging from 10 x 6 to 8192 x 8192 and the output image resolution ranging from 10 x 6 to 4096 x 8192.

    The input image format must be YUV (excluding Planar, YUV400, and YUV440). The output image format must be YUV420SP (NV12) 8-bit or YUV420SP (NV21) 8-bit.

    Width and height resizing range: [1/32, 16]

Atlas A2 products support the following resizing algorithms:
  • 0 (default): proprietary high-order filtering algorithm.
  • 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: proprietary high-order filtering algorithm.

    The resizing algorithm supports only the input image resolution ranging from 10 x 6 to 8192 x 8192 and the output image resolution ranging from 10 x 6 to 4096 x 8192.

    The input image format must be YUV (excluding Planar, YUV400, and YUV440). The output image format must be YUV420SP (NV12) 8-bit or YUV420SP (NV21) 8-bit.

    Width and height resizing range: [1/32, 16]

Atlas A3 products support the following resizing algorithms:
  • 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: proprietary high-order filtering algorithm.

    The resizing algorithm supports only the input image resolution ranging from 10 x 6 to 8192 x 8192 and the output image resolution ranging from 10 x 6 to 4096 x 8192.

    The input image format must be YUV (excluding Planar, YUV400, and YUV440). The output image format must be YUV420SP (NV12) 8-bit or YUV420SP (NV21) 8-bit.

    Width and height resizing range: [1/32, 16]

Return Values

Return Value

Description

ret

Int, error code: 0 on success; else, failure.