VpcBatchCropMN

Function Usage

Batch cropping function for image processing. Before calling this API, call Init to initialize this function.

  • Supported image formats of the input/output data:
    • Atlas 200/300/500 inference product: 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: 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.
  • The actual resolution range of each input data segment is [18 x 6, 4096 x 4096]. The resolution range of YUV_SP_420 and YVU_SP_420 is [18 x 6, 8192 x 8192].
  • The cropped ROI cannot exceed the input image region. It is recommended that the four values of each input cropped coordinate box be even numbers. If odd numbers are included (excluding RGB and BGR formats), the coordinate of the upper left corner is automatically rounded down to an even number, and the coordinate of the lower right corner is automatically rounded up to an even number.
  • The maximum resolution of the cropped ROI is 4096 x 4096, and the minimum resolution is 18 x 6. For example, if cropConfig is set to {1, 1, 1287, 1287}, the actual width and height of the cropped image are ((1287 + 1) - (1 - 1)) = 1288, and the resolution is 1288 x 1288.

Prototype

1
APP_ERROR DvppWrapper::VpcBatchCropMN(std::vector<DvppDataInfo>& inputDataInfoVec, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec, AscendStream& stream);
1
APP_ERROR DvppWrapper::VpcBatchCropMN(std::vector<DvppDataInfo>& inputDataInfoVec,  std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec);

Parameters

Parameter

Input/Output

Description

inputDataInfoVec

Input

A group of data to be cropped. The array length cannot exceed 12 characters.

outputDataInfoVec

Output

A group of data output after image cropping.

The length is not 0, but the product of inputDataInfoVec and cropConfigVec. The array length cannot exceed 256 characters.

cropConfigVec

Input

Cropping configuration group. The array length cannot exceed 256 characters. For details, see CropRoiConfig.

stream

Input

AscendStream type. When AscendStream& stream is not specified or the value is AscendStream::DefaultStream(), the API performs a synchronous operation. In other cases, the API performs asynchronous operations.

Response Parameters

Data Structure

Description

APP_ERROR

For details about the returned error codes, see APP_ERROR Description.