crop_rectangle2crop_rectangle2CropRectangle2CropRectangle2crop_rectangle2剪裁矩形2(算子)
名称
crop_rectangle2crop_rectangle2CropRectangle2CropRectangle2crop_rectangle2 — 剪切一个或多个任意方向的矩形图像区域。
签名
Herror crop_rectangle2(const Hobject Image, Hobject* ImagePart, double Row, double Column, double Phi, double Length1, double Length2, const char* AlignToAxis, const char* Interpolation)
Herror T_crop_rectangle2(const Hobject Image, Hobject* ImagePart, const Htuple Row, const Htuple Column, const Htuple Phi, const Htuple Length1, const Htuple Length2, const Htuple AlignToAxis, const Htuple Interpolation)
void CropRectangle2(const HObject& Image, HObject* ImagePart, const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2, const HTuple& AlignToAxis, const HTuple& Interpolation)
HImage HImage::CropRectangle2(const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2, const HString& AlignToAxis, const HString& Interpolation) const
HImage HImage::CropRectangle2(double Row, double Column, double Phi, double Length1, double Length2, const HString& AlignToAxis, const HString& Interpolation) const
HImage HImage::CropRectangle2(double Row, double Column, double Phi, double Length1, double Length2, const char* AlignToAxis, const char* Interpolation) const
HImage HImage::CropRectangle2(double Row, double Column, double Phi, double Length1, double Length2, const wchar_t* AlignToAxis, const wchar_t* Interpolation) const
(
Windows only)
static void HOperatorSet.CropRectangle2(HObject image, out HObject imagePart, HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2, HTuple alignToAxis, HTuple interpolation)
HImage HImage.CropRectangle2(HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2, string alignToAxis, string interpolation)
HImage HImage.CropRectangle2(double row, double column, double phi, double length1, double length2, string alignToAxis, string interpolation)
def crop_rectangle2(image: HObject, row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]], phi: MaybeSequence[Union[int, float]], length_1: MaybeSequence[Union[int, float]], length_2: MaybeSequence[Union[int, float]], align_to_axis: str, interpolation: str) -> HObject
描述
crop_rectangle2crop_rectangle2CropRectangle2CropRectangle2CropRectangle2crop_rectangle2 从每张输入图像中裁剪一个或多个矩形区域。这些区域由矩形表示,矩形通过中心点(RowRowRowRowrowrow, ColumnColumnColumnColumncolumncolumn)、方向角 PhiPhiPhiPhiphiphi 以及半边长 Length1Length1Length1Length1length1length_1 和 Length2Length2Length2Length2length2length_2 来定义。PhiPhiPhiPhiphiphi 以弧度为单位,沿数学正方向给出,表示水平轴与第一条边(长度为 Length1Length1Length1Length1length1length_1)之间的夹角。矩形参数使用以像素为中心的、亚像素精度的坐标,详见 变换 / 二维变换。
参数 AlignToAxisAlignToAxisAlignToAxisAlignToAxisalignToAxisalign_to_axis 决定输出图像的对齐方式。可能的取值:
执行信息
- 支持 OpenCL 计算设备。
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在元组级别上自动并行化。
参数
ImageImageImageImageimageimage (输入对象) (multichannel-)image(-array) → objectHImageHObjectHImageHobject (byte / int2 / uint2 / real)
输入图像。
ImagePartImagePartImagePartImagePartimagePartimage_part (输出对象) (multichannel-)image(-array) → objectHImageHObjectHImageHobject * (byte / int2 / uint2 / real)
裁剪后的图像部分。
RowRowRowRowrowrow (输入控制) rectangle2.center.y(-array) → HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
图像裁剪中心的行索引。
默认值:
300.0
建议值:
10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
值范围:
Row
Row
Row
Row
row
row
(lin)
建议增量:
10.0
ColumnColumnColumnColumncolumncolumn (输入控制) rectangle2.center.x(-array) → HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
图像裁剪中心的列索引。
默认值:
200.0
建议值:
10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
值范围:
Column
Column
Column
Column
column
column
(lin)
建议增量:
10.0
PhiPhiPhiPhiphiphi (输入控制) rectangle2.angle.rad(-array) → HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
矩形的方向(弧度)。
默认值:
0.0
建议值:
-1.178097, -0.785398, -0.392699, 0.0, 0.392699, 0.785398, 1.178097
值范围:
-1.178097
≤
Phi
Phi
Phi
Phi
phi
phi
≤
1.178097 (lin)
Length1Length1Length1Length1length1length_1 (输入控制) rectangle2.hwidth(-array) → HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
矩形第一半边的长度。
默认值:
100.0
建议值:
3.0, 5.0, 10.0, 15.0, 20.0, 50.0, 100.0, 200.0, 300.0, 500.0
值范围:
Length1
Length1
Length1
Length1
length1
length_1
(lin)
建议增量:
10.0
Length2Length2Length2Length2length2length_2 (输入控制) rectangle2.hheight(-array) → HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
矩形第二半边的长度。
默认值:
20.0
建议值:
1.0, 2.0, 3.0, 5.0, 10.0, 15.0, 20.0, 50.0, 100.0, 200.0
值范围:
Length2
Length2
Length2
Length2
length2
length_2
(lin)
建议增量:
10.0
AlignToAxisAlignToAxisAlignToAxisAlignToAxisalignToAxisalign_to_axis (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
确定裁剪后的图像部分是否与坐标轴对齐。
默认值:
'true'
"true"
"true"
"true"
"true"
"true"
值列表:
'false'"false""false""false""false""false", 'true'"true""true""true""true""true"
InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
插值方法。
默认值:
'constant'
"constant"
"constant"
"constant"
"constant"
"constant"
值列表:
'bicubic'"bicubic""bicubic""bicubic""bicubic""bicubic", 'bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear", 'constant'"constant""constant""constant""constant""constant", 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor", 'weighted'"weighted""weighted""weighted""weighted""weighted"
可能的后继
disp_imagedisp_imageDispImageDispImageDispImagedisp_image
替代
crop_domaincrop_domainCropDomainCropDomainCropDomaincrop_domain,
crop_rectangle1crop_rectangle1CropRectangle1CropRectangle1CropRectangle1crop_rectangle1,
crop_partcrop_partCropPartCropPartCropPartcrop_part,
change_formatchange_formatChangeFormatChangeFormatChangeFormatchange_format,
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain
另见
zoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSizeZoomImageSizezoom_image_size,
zoom_image_factorzoom_image_factorZoomImageFactorZoomImageFactorZoomImageFactorzoom_image_factor
模块
基础