Updated on 2022-02-22 GMT+08:00

Changing the Image Size

This API is used to change the size of an image.

  • API calling

    hilens.Preprocessor.resize(src, w, h, t)

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Type

    Description

    src

    Yes

    <class'numpy.ndarray'> object

    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.

    w

    Yes

    Positive integer

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

    h

    Yes

    Positive integer

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

    t

    Yes

    Integer 0 or 1

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

  • Return value

    If the resize operation is successful, the resized image is returned, which is a <class'numpy.ndarray'> object.

    If the resize operation fails, "ValueError" is reported.