ImageProcessor类的图像缩放接口,Atlas 推理系列产品支持异步执行,使用该接口申请的Image内存无需用户管理,由内部管理释放,缩放效果示意图请参见图1。
相关使用流程请参考缩放。
原型1(预计2025年3月正式删除,请使用该接口其他函数原型):
1
|
APP_ERROR ImageProcessor::Resize(const Image& inputImage, const Size& resize, Image& outputImage, const Interpolation interpolation = Interpolation::HUAWEI_HIGH_ORDER_FILTER); |
原型2:
1
|
APP_ERROR ImageProcessor::Resize(const Image& inputImage, const Size& resize, Image& outputImage, const Interpolation interpolation, AscendStream& stream); |
参数名 |
输入/输出 |
说明 |
||
---|---|---|---|---|
inputImage |
输入 |
输入缩放前的Image类。Decode接口和其他VPC接口获取的Image类可以直接作为输入。若是用户自定义构造的Image类,则需要设置图像宽高和图像对齐后的宽高。 |
||
resize |
输入 |
输入图像缩放的宽高。 |
||
interpolation |
输入 |
输入图像的缩放方式,可选参数参见如下。
Atlas 200/300/500 推理产品支持以下算法(默认为0)。
Atlas 200I/500 A2 推理产品支持以下算法(默认为0)。
Atlas 推理系列产品支持以下算法(同步执行时默认为0)。
|
||
outputImage |
输出 |
输出缩放后的Image类。 |
||
stream |
输入 |
输入用于异步执行的Stream,具体请参见AscendStream。 |
数据结构 |
说明 |
---|---|
APP_ERROR |
程序执行返回的错误码,请参考APP_ERROR说明。 |