Updated on 2023-06-15 GMT+08:00

Changing the Image Size

This section describes how to resize an image.

API Calling

HiLensEC hilens::Preprocessor::Resize(const cv::Mat & src, cv::Mat & dst, unsigned int w, unsigned int h, int type = 0)

Parameter Description

Table 1 Parameters

Parameter

Description

src

Source image, which must be in the NV21 format. Width range: [64, 1920], a multiple of 2; Height range: [64, 1080], a multiple of 2.

If the input is not in the NV21 format, convert the input source image to the NV21 format. Refer to Converting the Image Color Format for details.

dst

Target image

w

Width of the image after zoom-in/out. Value range: [64, 1920], a multiple of 2.

h

Height of the image after zoom-in/out. Value range: [64, 1080], a multiple of 2.

type

Format of the target image. The value 0 indicates NV21, and value 1 indicates NV12. The default value is 0.

Return Value

If the return value is 0, the operation is successful. Otherwise, the operation fails. Refer to Error Codes for details about the failure response parameters.