Skip to main content

resize(inputImage, resize, interpolation)

模块说明

dvpp模块预计于2024年退出,建议使用ImageProcessor类

父主题: dvpp模块

read_image(inputPath, deviceId, decodeFormat)

函数功能

解码读取图片。

输入输出格式及对齐方式请参见decode(inputPath, decodeFormat)

输入参数说明

参数名类型说明
inputPathstring图片路径。
deviceIdintDevice设备的ID号。
decodeFormatimage_format枚举类输入图片的解码格式。

返回参数说明

Image对象。

抛异常接口

创建ImageProcessor失败、图片解码失败,抛出runtime异常。

父主题: dvpp模块

resize(inputImage, resize, interpolation)

函数功能

图像缩放。输入输出范围及对齐方式请参见resize(inputImage, resize, interpolation)

输入参数说明

参数名类型说明
inputImageImage类输入缩放前的Image类。
resizeSize类输入图像缩放的宽高。
interpolationInterpolation参数枚举类输入图像的缩放方式,默认为“HUAWEI_HIGH_ORDER_FILTER” 。

返回参数说明

Image对象。

抛异常接口

创建ImageProcessor失败、图片缩放失败,抛出runtime异常。

父主题: dvpp模块

batch_concat(inputs)

函数功能

将多个Tensor进行组batch,按照第0维组装,内存连续。

输入参数说明

参数名类型说明
inputsList[base.Tensor]Tensor列表。

输出参数说明

Tensor对象。

抛异常接口

传入Tensor异常、组Tensor后输出的Tensor异常,抛出runtime异常。

父主题: 媒体数据处理

image(inputPath, deviceId, decodeFormat)

函数功能

解码读取图片。

输入输出格式及对齐方式请参见decode(inputPath, decodeFormat)

输入参数说明

参数名类型说明
inputPathstring图片路径。
deviceIdintDevice设备的ID号。
decodeFormatimage_format枚举类输入图片的解码格式。

输出参数说明

Image对象。

抛异常接口

创建ImageProcessor失败、图片解码失败,抛出runtime异常。

父主题: 媒体数据处理

resize_info(image, resize_height, resize_width, resize_type)

函数功能

设置缩放信息。

输入参数说明

参数名类型说明
imageImage对象图像信息。
resize_heightInt缩放高度。
resize_weightInt缩放宽度。
resize_typeResizeType缩放类型。

输出参数说明

ResizedImageInfo对象。

父主题: 媒体数据处理

在线提单