Function: set_aipp_crop_params
Applicability
|
Product |
Supported (√/x) |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Prototype
- C Prototype
1aclError aclmdlSetAIPPCropParams(aclmdlAIPP *aippParmsSet, int8_t cropSwitch,int32_t cropStartPosW, int32_t cropStartPosH, int32_t cropSizeW, int32_t cropSizeH,uint64_t batchIndex)
- Python Function
1ret = acl.mdl.set_aipp_crop_params(aipp_parms_set, crop_switch, crop_start_pos_w, crop_start_pos_h, crop_size_w, crop_size_h, batch_index)
Parameter Description
|
Parameter |
Description |
|---|---|
|
aipp_parms_set |
Int, pointer address of the dynamic AIPP configuration object. The aclmdlAIPP data must be created by the acl.mdl.create_aipp call in advance. |
|
crop_switch |
Int, whether to crop an image. Value range:
|
|
crop_start_pos_w |
Int, horizontal coordinate of the crop start. For the YUV420SP_U8 format, the value must be an even number. The value range is [0, 4095]. |
|
crop_start_pos_h |
Int, vertical coordinate of the crop start. For the YUV420SP_U8 format, the value must be an even number. The value range is [0, 4095]. |
|
crop_size_w |
Int, width of the crop ROI. Value range: [1, 4096] |
|
crop_size_h |
Int, height of the crop ROI. Value range: [1, 4096] |
|
batch_index |
Int, index of the batch for image cropping. The default value is 0. The value range is [0, batch_size). batch_size is set when acl.mdl.create_aipp is called to create data of the aclmdlAIPP type. |
Return Value Description
|
Return Value |
Description |
|---|---|
|
ret |
Int, error code.
|
Restrictions
If the cropping function is enabled, the following conditions must be met for the arguments passed to the acl.mdl.set_aipp_src_image_size call and acl.mdl.set_aipp_crop_params call:
- srcImageSizeW ≥ cropSizeW + cropStartPosW
- srcImageSizeH ≥ cropSizeH + cropStartPosH