crop_partcrop_partCropPartCropPartcrop_part裁剪部分(算子)
名称
crop_partcrop_partCropPartCropPartcrop_part — 剪切一个或多个矩形图像区域。
签名
Herror crop_part(const Hobject Image, Hobject* ImagePart, const Hlong Row, const Hlong Column, const Hlong Width, const Hlong Height)
Herror T_crop_part(const Hobject Image, Hobject* ImagePart, const Htuple Row, const Htuple Column, const Htuple Width, const Htuple Height)
void CropPart(const HObject& Image, HObject* ImagePart, const HTuple& Row, const HTuple& Column, const HTuple& Width, const HTuple& Height)
HImage HImage::CropPart(const HTuple& Row, const HTuple& Column, const HTuple& Width, const HTuple& Height) const
HImage HImage::CropPart(Hlong Row, Hlong Column, Hlong Width, Hlong Height) const
static void HOperatorSet.CropPart(HObject image, out HObject imagePart, HTuple row, HTuple column, HTuple width, HTuple height)
HImage HImage.CropPart(HTuple row, HTuple column, HTuple width, HTuple height)
HImage HImage.CropPart(int row, int column, int width, int height)
def crop_part(image: HObject, row: MaybeSequence[int], column: MaybeSequence[int], width: MaybeSequence[int], height: MaybeSequence[int]) -> HObject
描述
算子 crop_partcrop_partCropPartCropPartCropPartcrop_part 从每张输入图像中裁剪一个或多个矩形区域。这些区域由矩形表示,矩形通过其左上角的坐标及其尺寸来定义。矩形的左上角必须位于图像内部。在右侧和底部,矩形可能超出图像范围,但输出图像的域会被设置为仅包含可从输入图像中提取的部分。如果矩形区域完全位于图像内部,则每个生成的图像尺寸即为对应矩形的尺寸。
执行信息
- 支持 OpenCL 计算设备。
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在元组级别上自动并行化。
参数
ImageImageImageImageimageimage (输入对象) (multichannel-)image(-array) → objectHImageHObjectHImageHobject (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / int8 / real*) *允许用于计算设备
输入图像。
ImagePartImagePartImagePartImagePartimagePartimage_part (输出对象) (multichannel-)image(-array) → objectHImageHObjectHImageHobject * (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / int8 / real*) *允许用于计算设备
图像区域。
RowRowRowRowrowrow (输入控制) rectangle.origin.y(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
图像区域左上角的行索引。
默认值:
100
建议值:
10, 20, 50, 100, 200, 300, 500
值范围:
0
≤
Row
Row
Row
Row
row
row
≤
1024
ColumnColumnColumnColumncolumncolumn (输入控制) rectangle.origin.x(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
图像区域左上角的列索引。
默认值:
100
建议值:
10, 20, 50, 100, 200, 300, 500
值范围:
0
≤
Column
Column
Column
Column
column
column
≤
1024
WidthWidthWidthWidthwidthwidth (输入控制) rectangle.extent.x(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
新图像的宽度。
默认值:
128
建议值:
32, 64, 128, 256, 512, 768
值范围:
0
≤
Width
Width
Width
Width
width
width
≤
1024
HeightHeightHeightHeightheightheight (输入控制) rectangle.extent.y(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
新图像的高度。
默认值:
128
建议值:
32, 64, 128, 256, 512, 525
值范围:
0
≤
Height
Height
Height
Height
height
height
≤
1024
可能的后继
disp_imagedisp_imageDispImageDispImageDispImagedisp_image
替代
crop_rectangle1crop_rectangle1CropRectangle1CropRectangle1CropRectangle1crop_rectangle1,
crop_domaincrop_domainCropDomainCropDomainCropDomaincrop_domain,
change_formatchange_formatChangeFormatChangeFormatChangeFormatchange_format,
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain
另见
zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSizezoom_image_size,
zoom_image_factorzoom_image_factorZoomImageFactorZoomImageFactorZoomImageFactorzoom_image_factor
模块
基础