vpc_crop_resize_make_border
Applicable Products
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
x |
|
√ |
|
√ |
Description
Crops one or more ROIs from an image, resizes the crop ROIs, and then pads each ROI based on the specific type to form one or more destination images. This API is mainly used for resizing with the aspect ratio preserved. This is an asynchronous API.
Prototype
- C Prototype
1hi_s32 hi_mpi_vpc_crop_resize_make_border(hi_vpc_chn chn, const hi_vpc_pic_info *source_pic, hi_vpc_crop_resize_border_region crop_resize_make_border_info[], hi_u32 count, hi_u32 *task_id, hi_s32 milli_sec);
- Python Function
1task_id, ret = acl.himpi.vpc_crop_resize_make_border(chn, source_pic, crop_resize_make_border_info, count, milli_sec)
Parameters
Parameter |
Description |
|---|---|
chn |
Int, channel ID for image processing. |
source_pic |
Dict, source image information. For details, see hi_vpc_pic_info. For details about constraints, see Constraints. |
crop_resize_make_border_info |
List, list for crop, resize, and border making information. You need to set the buffer address of the destination image for storing this information. For details, see hi_vpc_crop_resize_border_region. If the data of multiple padding results points to the same buffer address, the data of the later result overwrites that of the previous one. Consequently, the output image is inconsistent with the desired image. Currently, only the HI_BORDER_CONSTANT and HI_BORDER_REPLICATE types are supported, which allow padding to 4096 x 4096. The length of the crop_resize_make_border_info array must be the same as that of the count value. |
count |
Int, number of crop, resize, and padding ROIs. Must be in the range of [1, 256]. |
milli_sec |
Int, timeout interval, in milliseconds. |
Return Values
Return Value |
Description |
|---|---|
task_id |
Int, task ID, used to identify a task. |
ret |
Int, error code.
|
Constraints
Version |
Restriction |
|---|---|
|
|
|