Resize
Function Usage
Image resizing API of the ImageProcessor class. Atlas inference product and Atlas 800I A2 inference product support asynchronous execution. The Image memory allocated using this API does not need to be managed by the user and is released internally. For details about the resizing effect, see Figure 1.
For details, see Resizing.
- Supported input/output formats of the Image class:
Atlas 200/300/500 inference product supports YUV_SP_420 and YVU_SP_420 (nv12 and nv21).Atlas 200I/500 A2 inference product supports YUV_SP_420 and YVU_SP_420 (nv12 and nv21).- Atlas inference product and Atlas 800I A2 inference product support YUV_SP_420, YVU_SP_420, RGB_888 and BGR_888 (nv12, nv21, rgb, and bgr). The resolution of the RGB (BGR) image format cannot exceed 4096 x 4096.
- inputImage: The actual image resolution range is [18 × 6, 4096 × 4096]. The size of YUV_SP_420 or YVU_SP_420 image can reach 8192 x 8192.
- resize: Its maximum resolution is 4096 x 4096, and the minimum resolution is 32 x 6.
- outputImage: The width is automatically aligned by 16, and the height is automatically aligned by 2. So the size range is [32 x 6, 4096 x 4096].
- The width and height of the resized image cannot exceed a multiple of [1/32, 16] of the actual width and height.
Prototype
1
|
APP_ERROR ImageProcessor::Resize(const Image& inputImage, const Size& resize, Image& outputImage, const Interpolation interpolation, AscendStream& stream = AscendStream::DefaultStream()); |
Parameters
|
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
|
inputImage |
Input |
Image class before resizing. The Image class obtained by the Decode API and other VPC APIs can be directly used as inputs. If the user-defined Image class is used, set the original and aligned image widths and heights. |
||
|
resize |
Input |
Height and width for resizing |
||
|
interpolation |
Input |
Resizing mode of an input image:
The following algorithms are supported by the
The following algorithms are supported by the
Atlas inference product and Atlas 800I A2 inference product support the following algorithms (defaulted to 0 during synchronous execution):
|
||
|
outputImage |
Output |
Image class after resizing |
||
|
stream |
Input |
AscendStream type. The default value is AscendStream::DefaultStream(). When the parameter value is the default value, the API calling is a synchronous operation. In other cases, the API calling is an asynchronous operation. |
Response Parameters
|
Data Structure |
Description |
|---|---|
|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |
