跳到主要内容

crop(inputImageVec, cropRectVec)

padding(inputImage, padDim, color, borderType)

函数功能

ImageProcessor类的图像处理补边接口,输入输出格式、分辨率范围请参见Padding

输入参数说明

参数名类型说明
inputImageImage类输入补边前的Image类。
padDimDim类输入图像补边的尺寸。
colorColor类输入补边三通道颜色,仅在“borderType”设置为“BORDER_CONSTANT”时有效。
borderTypeBorderType参数枚举类输入补边方式。具体请参见BorderType补边方式枚举类型

返回参数说明

返回补边后的Image类。

抛异常接口

补边失败,抛出runtime异常。

父主题: ImageProcessor类

crop(inputImage, cropRectVec)

函数功能

ImageProcessor类的图像抠图接口,输入输出格式、分辨率范围、对齐方式请参见Crop

输入参数说明

参数名类型说明
inputImageImage类输入抠图前的Image类。
cropRectVecList[Rect]输入图像的抠图坐标框列表。

返回参数说明

返回抠图后的Image类列表List[Image]。

抛异常接口

抠图失败,抛出runtime异常。

父主题: ImageProcessor类

crop(inputImageVec, cropRectVec)

函数功能

ImageProcessor类的图像抠图接口,输入输出格式、分辨率范围、对齐方式请参见Crop

输入参数说明

参数名类型说明
inputImageVecList[Image]输入抠图前的Image类列表。
cropRectVecList[Rect]输入图像的抠图坐标框列表。

返回参数说明

返回抠图后的Image类列表List[Image]。

抛异常接口

抠图失败,抛出runtime异常。

父主题: ImageProcessor类

crop_resize(inputImage, cropResizeVec)

函数功能

ImageProcessor类的图像抠图并缩放接口,输入输出格式、分辨率范围、对齐方式请参见CropResize

输入参数说明

参数名类型说明
inputImageImage类输入抠图缩放前的Image类。
cropResizeVecList[tuple(Rect, Size)]输入图像的抠图缩放参数列表。Rect为抠图坐标框,Size为缩放宽高。

返回参数说明

返回抠图缩放后的Image类列表List[Image]。

抛异常接口

抠图缩放失败,抛出runtime异常。

父主题: ImageProcessor类

crop_paste(inputImage, cropPasteRect, pastedImage)

函数功能

ImageProcessor类的图像抠图并贴图接口。

  1. 从“inputImage”中抠取一块图像,缩放至指定贴图区域的大小。
  2. 将抠图后的图片贴到“pastedImage”的指定贴图区域。输入输出格式、分辨率范围、对齐方式请参见CropAndPaste

输入参数说明

参数名类型说明
inputImageImage类输入抠图前的Image类。
cropPasteRecttuple(Rect, Rect)输入图像的抠图参数。 第一个Rect对应抠图参数,第二个Rect对应贴图参数。
pastedImageImage类被贴图的Image类。

返回参数说明

抛异常接口

抠图并贴图失败,抛出runtime异常。

父主题: ImageProcessor类

在线提单