convert_format

Function Usage

CSC API of the ImageProcessor class. The Image memory allocated by this API does not need to be managed or destroyed by users. Only Atlas inference product and Atlas 800I A2 inference product support this API.

Prototype

1
convert_format(inputImage: Image, outputFormat: image_format)

Parameters

Parameter

Type

Description

inputImage

Image class

Image class before conversion.

The Image class obtained by the decode API and other VPC APIs can be directly used as inputs.

  • The input image size range is [32 x 6, 4096 x 4096].
  • Supported input formats of the Image class: YUV_SP_420, YVU_SP_420, RGB_888, and BGR_888.

outputFormat

image_format enumeration

Target formats for CSC can be YUV_SP_420, YVU_SP_420, RGB_888, and BGR_888.

  • The output width of the Image class is a multiple of 16, and its output height is a multiple of 2. So the size range is [32 x 6, 4096 x 4096].
  • The output width and height of the Image class must be the same as the input Image class.
  • Ensure that the formats before and after the conversion are different.

Response Parameters

Returns the Image object after conversion.