Skip to main content

acl.himpi.vpc_get_affine_transform

acl.himpi.vpc_gaussian_blur

c函数原型hi_s32 hi_mpi_vpc_gaussian_blur(hi_vpc_chn chn, const hi_gaussian_blur_param* gaussian_blur****_param, hi_u32 *task_id, hi_s32 milli_sec)
Python函数task_id, ret = acl.himpi.vpc_gaussian_blur(chn, gaussian_blur_param, milli_sec**)**
函数功能对输入图片做高斯滤波处理。
输入说明- chn:int,图片处理通道号。
- Atlas 200/500 A2推理产品,该参数的取值范围:[0, 128),通道总数最多128。
- gaussian_blur_param:dict,高斯滤波信息字典。 在hi_gaussian_blur_param字典内配置输入、输出图片信息,以及高斯滤波参数。
- milli_sec:超时时间配置,单位是毫秒,取值范围如下。
- “-1”:阻塞方式。
- “0”:非阻塞方式。
- >0:超时方式,配置具体的超时时间。超时时间受操作系统影响,一般偏差在操作系统的一个时间片内,例如,操作系统的一个时间片为4ms,用户设置的milli_sec参数值为1,则实际的超时时间在1ms到5ms范围内。在CPU负载高场景下,超时时间仍可能存在波动。
返回值说明- ret:int,错误码。
- 返回0表示成功。
- 返回非0表示失败,参见VPC图像处理返回码
- task_id:任务分配的ID,用来区分任务。

约束说明

版本约束
Atlas 200/500 A2推理产品- 输入、输出图片分辨率的取值范围为:10*6~4096*8192,且输入、输出图片的分辨率需保持一致。
- 支持如下输入图片格式(输出图片格式与输入保持一致):
text<br> HI_PIXEL_FORMAT_YUV_400 = 0, // YUV400 8bit<br> HI_PIXEL_FORMAT_YUV_SEMIPLANAR_420 = 1, // YUV420SP NV12 8bit <br> HI_PIXEL_FORMAT_YVU_SEMIPLANAR_420 = 2, // YUV420SP NV21 8bit <br> HI_PIXEL_FORMAT_YUV_SEMIPLANAR_422 = 3, // YUV422SP 8bit<br> HI_PIXEL_FORMAT_YVU_SEMIPLANAR_422 = 4, // YVU422SP 8bit<br> HI_PIXEL_FORMAT_YUYV_PACKED_422 = 7, // YUV422Packed YUYV 8bit<br> HI_PIXEL_FORMAT_YVYU_PACKED_422 = 9, // YUV422Packed YVYU 8bit<br> HI_PIXEL_FORMAT_YUV_PACKED_444 = 11, // YUV444 Package 8bit<br> HI_PIXEL_FORMAT_RGB_888 = 12, // RGB888<br> HI_PIXEL_FORMAT_BGR_888 = 13, // BGR888<br> HI_PIXEL_FORMAT_YVU_PACKED_444 = 58, // YVU444 Package 8bit<br> HI_PIXEL_FORMAT_RGB_888_PLANAR = 69, // RGB888 Planar<br> HI_PIXEL_FORMAT_BGR_888_PLANAR = 70, // BGR888 Planar<br>
- 实现原理和opencv一致,浮点转定点运算部分有差异,精度不能完全对标。
- 由于YUV格式图像下采样约束,当输出图片格式为YUV420SP或YUV422SP格式时,在配置边界填充类型时,建议设置为“边界复制模式”,避免输出图片边缘异常数据。

父主题: VPC图像处理接口

acl.himpi.vpc_get_affine_lut

c函数原型hi_s32 hi_mpi_vpc_get_affine_lut(hi_point_pair_info *point_pair_info, hi_u32 interpolation, hi_remap_lut *remap_lut)
Python函数remap_lut, ret = acl.himpi.vpc_get_affine_lut(point_pair_info, interpolation, remap_lut)
函数功能根据输入、输出图片中的像素位置坐标点,获取仿射变换像素位置重映射表。同步接口。
输入说明- point_pair_info:dict,包含三对输入、输出图片中的像素点坐标信息的字典,每对中分别包含一个输入图片像素点坐标、一个输出图片像素点坐标。
- **interpolation:**int,缩放算法。支持如下缩放算法:
- 0:业界通用的Bilinear算法(与OpenCV算法的计算过程类似)。
- 1:业界通用的Nearest neighbor 算法(与OpenCV算法的计算过程类似)。
- **remap_lut:**dict,仿射变换像素位置重映射表信息字典。字典中的lut属性需由用户提前申请内存,内存大小“lut_size”属性可调用acl.himpi.vpc_get_lut_mem_size接口获取。
返回值说明- remap_lut:dict,仿射变换像素位置重映射表信息字典。在成功调用本接口后,用户可通过lut属性中的地址获取仿射变换LUT表信息。
- ret:int,错误码。
- 返回0表示成功。
- 返回非0表示失败,参见VPC图像处理返回码

父主题: VPC图像处理接口

acl.himpi.vpc_get_affine_transform

c函数原型**hi_s32 hi_mpi_vpc_get_affine_transform(**hi_point_pair_info *point_pair_info, hi_transform_matrix *matrix)
Python函数matrix**, ret = acl.himpi.vpc_get_affine_transform(point_pair_info)**
函数功能获取仿射变换需要的变换矩阵。
输入说明point_pair_info:dict,包含三对输入、输出图片中的像素点坐标信息的字典,每对中分别包含一个输入图片像素点坐标、一个输出图片像素点坐标。
返回值说明matrix:dict,仿射变换需要的变换矩阵信息字典,其中“matrix_type”参数值请参考实际输入矩阵进行配置,具体参见hi_transform_matrixret:int,错误码。
- 返回0表示成功。
- 返回非0表示失败,参见VPC图像处理返回码

父主题: VPC图像处理接口

acl.himpi.vpc_get_lut_mem_size

c函数原型hi_s32 **hi_mpi_vpc_get_lut_mem_size(**hi_u32 width, hi_u32 height, hi_u32 *lut_size)
Python函数lut_size**, ret = acl.himpi.vpc_get_lut_mem_size(width, height)**
函数功能根据输出图片宽高信息获取像素位置重映射表所需的内存大小。同步接口。
输入说明- width:int,输出图像宽度。
- height:int,输出图像高度。
返回值说明- lut_size:int,像素位置重映射表的内存大小,单位Byte。
- ret:int,错误码。
- 返回0表示成功。
- 返回非0表示失败,参见VPC图像处理返回码
约束说明调用本接口时,width * height的取值范围为:10*6~4096*8192。

父主题: VPC图像处理接口

acl.himpi.vpc_get_perspective_lut

c函数原型hi_s32 hi_mpi_vpc_get_perspective_lut(hi_point_pair_info *point_pair_info, hi_u32 interpolation, hi_remap_lut *remap_lut)
Python函数remap_lut, ret = acl.himpi.vpc_get_perspective_lut(point_pair_info, interpolation**,** remap_lut**)**
函数功能根据输入、输出图片中的像素位置坐标点,获取透视变换像素位置重映射表。同步接口。
输入说明- point_pair_info:dict,包含四对输入、输出图片中的像素点坐标信息字典,每对中分别包含一个输入图片像素点坐标、一个输出图片像素点坐标。
- interpolation:int,支持如下缩放算法。
- 0:业界通用的Bilinear算法(与OpenCV算法的计算过程类似)。
- 1:业界通用的Nearest neighbor 算法(与OpenCV算法的计算过程类似)。
- remap_lut:dict,透视变换像素位置重映射表字典,具体请参见hi_remap_lut。字典中的lut属性需由用户提前申请内存,内存大小“lut_size”属性可调用acl.himpi.vpc_get_lut_mem_size接口获取。
返回值说明- remap_lut:dict,透视变换像素位置重映射表字典。在成功调用本接口后,用户可通过lut属性中的地址获取仿射变换LUT表信息。
- ret:int,错误码。
- 返回0表示成功。
- 返回非0表示失败,参见VPC图像处理返回码

父主题: VPC图像处理接口

acl.himpi.vpc_get_remap_lut

c函数原型hi_s32 hi_mpi_vpc_get_remap_lut(hi_map_param *map_param, hi_remap_lut *remap_lut)
Python函数remap_lut, ret =acl.himpi.vpc_get_remap_lut(map_param, remap_lut**)**
函数功能根据用户输入的Remap表(例如仿射、透视、鱼眼等),获取系统使用的像素位置重映射表。同步接口。
输入说明- map_param:dict,用户原始map表信息字典。请参见hi_map_param
- remap_lut:dict,透视变换像素位置重映射表字典,具体请参见hi_remap_lut。字典中的lut属性需由用户提前申请内存,内存大小“lut_size”属性可调用acl.himpi.vpc_get_lut_mem_size接口获取。
返回值说明- remap_lut:dict,透视变换像素位置重映射表字典。在成功调用本接口后,用户可通过lut属性中的地址获取仿射变换LUT表信息。
- ret:int,错误码。
- 返回0表示成功。
- 返回非0表示失败,参见VPC图像处理返回码

父主题: VPC图像处理接口

在线提单