acl.himpi.vpc_resize

C Prototype

hi_s32 hi_mpi_vpc_resize (hi_vpc_chn chn, const hi_vpc_pic_info *source_pic, hi_vpc_pic_info *dest_pic, hi_double fx, hi_double fy, hi_u32 interpolation, hi_u32 *task_id, hi_s32 milli_sec);

Python Function

task_id, ret = acl.himpi.vpc_resize(chn, source_pic, dest_pic, fx, fy, interpolation, milli_sec)

Function Usage

Resizes an input image with the aspect ratio preserved or to specific width and height. This API is asynchronous.

The Atlas 200/300/500 Inference Product does not support this API in the current version.

The Atlas Training Series Product does not support this API in the current version.

Input Description

chn: int, image processing channel ID.

source_pic: dict, source image information. For details about the restrictions, see #EN-US_TOPIC_0000002163318045/section1676152117452.

dest_pic: dict, destination image information.

fx: resize factor for the width.

fy: resize factor for the height.

interpolation: int, resizing algorithm. You are advised to use the same resizing algorithm as in model training.

milli_sec: timeout interval (ms).
  • -1: blocking mode.
  • 0: non-blocking mode.
  • > 0: timeout interval (timeout mode). The timeout interval varies with the operating system. The deviation is generally within a time slice of an operating system. For example, if the time slice of an operating system is 4 ms and the value of milli_sec is set to 1, the actual timeout interval ranges from 1 ms to 5 ms. When the CPU load is high, the timeout interval may fluctuate.

Return Value

ret: int, error code.

task_id: int, used to identify a task.