VpcBatchCrop
Function Usage
Batch image cropping function. 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 inputDataInfo resolution range is [18 x 6, 4096 x 4096]. The resolution range of a YUV_SP_420 or YVU_SP_420 image is [18 x 6, 8192 x 8192].
- The cropped ROI cannot exceed the input image region. It is recommended that the four coordinates of the cropConfig 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::VpcBatchCrop(DvppDataInfo& inputDataInfo, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec, AscendStream& stream); |
1 | APP_ERROR DvppWrapper::VpcBatchCrop(DvppDataInfo& inputDataInfo, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec); |
1 | APP_ERROR DvppWrapper::VpcBatchCrop(std::vector<DvppDataInfo>& inputDataInfoVec, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec, AscendStream& stream); |
1 | APP_ERROR DvppWrapper::VpcBatchCrop(std::vector<DvppDataInfo>& inputDataInfoVec, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec); |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
inputDataInfo |
Input |
Data to be cropped. |
inputDataInfoVec |
Input |
A group of data to be cropped. |
outputDataInfoVec |
Output |
A group of data output after image cropping. The length cannot be 0. |
cropConfigVec |
Input |
Cropping configuration group. The length must be the same as that of outputDataInfoVec. The requirement of a single configuration item in the array must be the same as that of cropConfig of VpcCrop. 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. |