Batch image cropping and resizing function. Before calling this API, call Init to initialize this function.
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. For example, if cropRect is set to {1, 1, 1287, 1287}, the actual width and height of the cropped ROI are ((1287 + 1) - (1 - 1)) = 1288, and the resolution is 1288 x 1288.
1 | APP_ERROR DvppWrapper::VpcBatchCropResize(DvppDataInfo& inputDataInfo, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec, ResizeConfig& resizeConfig, AscendStream& stream); |
1 | APP_ERROR DvppWrapper::VpcBatchCropResize(DvppDataInfo& inputDataInfo, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec, ResizeConfig& resizeConfig); |
1 | APP_ERROR DvppWrapper::VpcBatchCropResize(DvppDataInfo& inputDataInfo, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec, std::vector<ResizeConfig>& resizeConfigVec, AscendStream& stream); |
1 | APP_ERROR DvppWrapper::VpcBatchCropResize(DvppDataInfo& inputDataInfo, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec, std::vector<ResizeConfig>& resizeConfigVec); |
1 | APP_ERROR DvppWrapper::VpcBatchCropResize(std::vector<DvppDataInfo>& inputDataInfoVec, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec, std::vector<ResizeConfig>& resizeConfigVec, AscendStream& stream); |
1 | APP_ERROR DvppWrapper::VpcBatchCropResize(std::vector<DvppDataInfo>& inputDataInfoVec, std::vector<DvppDataInfo>& outputDataInfoVec, std::vector<CropRoiConfig>& cropConfigVec, std::vector<ResizeConfig>& resizeConfigVec); |
Parameter |
Input/Output |
Description |
|---|---|---|
inputDataInfo |
Input |
Data to be cropped or resized. |
inputDataInfoVec |
Input |
A group of data to be cropped and scaled. The length must be the same as that of cropConfigVec. |
cropConfigVec |
Input |
Cropping configuration group. The length cannot be 0. For details, see CropRoiConfig. |
resizeConfigVec |
Input |
Resizing configuration group. The length must be the same as that of cropConfigVec. |
outputDataInfoVec |
Output |
Data group output after cropping. The length must be the same as that of cropConfigVec. The requirement of a single configuration item in the array must be the same as that of cropConfig of VpcCrop. |
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. |
Data Structure |
Description |
|---|---|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |