Resize
Function Usage
Image resizing API of the ImageProcessor class. The memory allocated by this API does not need to be managed or destroyed by users.
- For details about the input and output image formats of the Image class, see ImageFormat.
- The original width and height of the input Image class range from 18 x 6 to 4096 x 4096. For images in YUV_SP_420 and YVU_SP_420 formats, the width and height can be 8192 x 8192.
- The maximum resolution (resize) of the output image is 4096 x 4096, and the minimum resolution is 32 x 6.
- The width of the output image automatically becomes a multiple of 16, and the height becomes a multiple of 2. Therefore, the width and height range from 32 x 6 to 4096 x 4096.
- The width and height of the resized image cannot exceed a multiple of [1/32,16] of the original width and height.
Prototype
APP_ERROR Resize(const Image& inputImage, const Size& resize, Image& outputImage,
const Interpolation interpolation = Interpolation::HUAWEI_HIGH_ORDER_FILTER);
Parameter Description
Parameter |
Input/Output |
Description |
|---|---|---|
inputImage |
Input |
Image class before resizing. The Image classes 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. The default value is HUAWEI_HIGH_ORDER_FILTER. |
outputImage |
Output |
Image class after resizing |
Return Parameter Description
Data Structure |
Description |
|---|---|
APP_ERROR |
Error code returned during program execution. For details, see the MxBase/ErrorCode/ErrorCode.h file. |
Parent topic: ImageProcessor