aclmdlSetAIPPCropParams

Applicability

Product

Supported

Atlas 350 Accelerator Card

×

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Usage

Sets cropping parameters in the dynamic AIPP scenario.

Prototype

1
2
3
4
aclError aclmdlSetAIPPCropParams(aclmdlAIPP *aippParmsSet, int8_t cropSwitch,
int32_t cropStartPosW, int32_t cropStartPosH,
int32_t cropSizeW, int32_t cropSizeH,
uint64_t batchIndex)

Parameters

Parameter

Input/Output

Description

aippParmsSet

Output

Pointer to the dynamic AIPP parameter object

Call aclmdlCreateAIPP in advance to create data of the aclmdlAIPP type.

cropSwitch

Input

Cropping switch

  • 0: disabled. When set to 0, cropStartPosW, cropStartPosH, cropSizeW, and cropSizeH are invalid.
  • 1: enabled

cropStartPosW

Input

Horizontal coordinate of the crop start

For YUV420SP_U8, the value must be an even number.

Value range: [0, 4095]

cropStartPosH

Input

Vertical coordinate of the crop start

For YUV420SP_U8, the value must be an even number.

Value range: [0, 4095]

cropSizeW

Input

Width of the crop ROI

Value range: [1, 4096]

cropSizeH

Input

Height of the crop ROI

Value range: [1, 4096]

batchIndex

Input

Index of batch for image cropping

Value range: [0, batchSize)

batchSize is set when data of the aclmdlAIPP type is created by the aclmdlCreateAIPP call.

Returns

0 on success; else, failure. For details, see aclError.

Restrictions

If the cropping function is enabled, the following conditions must be met for the arguments passed to the aclmdlSetAIPPSrcImageSize call and aclmdlSetAIPPCropParams call:

  • cropSizeW+cropStartPosW ≤ srcImageSizeW
  • cropSizeH+cropStartPosH ≤ srcImageSizeH