gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2gen_rectangle2 (算子)
名称
gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2gen_rectangle2 — 创建任意方向的矩形。
签名
Herror gen_rectangle2(Hobject* Rectangle, double Row, double Column, double Phi, double Length1, double Length2)
Herror T_gen_rectangle2(Hobject* Rectangle, const Htuple Row, const Htuple Column, const Htuple Phi, const Htuple Length1, const Htuple Length2)
void GenRectangle2(HObject* Rectangle, const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2)
void HRegion::GenRectangle2(const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2)
void HRegion::GenRectangle2(double Row, double Column, double Phi, double Length1, double Length2)
static void HOperatorSet.GenRectangle2(out HObject rectangle, HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2)
void HRegion.GenRectangle2(HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2)
void HRegion.GenRectangle2(double row, double column, double phi, double length1, double length2)
def gen_rectangle2(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]]) -> HObject
描述
算子 gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2gen_rectangle2 generates one or more rectangles
with the center
(RowRowRowRowrowrow, ColumnColumnColumnColumncolumncolumn) , the orientation PhiPhiPhiPhiphiphi and
the half edge lengths Length1Length1Length1Length1length1length_1 and Length2Length2Length2Length2length2length_2.
The orientation is given in arc measure and indicates the angle between
the horizontal axis and the edge (with Length1Length1Length1Length1length1length_1)
(mathematically positive).
The coordinate system runs from (0,0) (upper left corner) to
(Width-1,Height-1). See get_systemget_systemGetSystemGetSystemGetSystemget_system and
reset_obj_dbreset_obj_dbResetObjDbResetObjDbResetObjDbreset_obj_db in this context.
More than one region can be created by passing one tuple of corner points.
注意
The gray values of the output objects are undefined. For speed
reasons, the resulting region may contain additional pixels at the
border and some individual pixels at the border may be missing.
This may lead to an inconsistency between the operators
smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2 and gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2gen_rectangle2.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
RectangleRectangleRectangleRectanglerectanglerectangle (输出对象) region(-array) → objectHRegionHObjectHRegionHobject *
Created rectangle.
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)
最小增量:
1.0
建议增量:
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)
最小增量:
1.0
建议增量:
10.0
PhiPhiPhiPhiphiphi (输入控制) rectangle2.angle.rad(-array) → HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Angle of the first edge to the horizontal (in radians).
默认值:
0.0
建议值:
-1.178097, -0.785398, -0.392699, 0.0, 0.392699, 0.785398, 1.178097
值范围:
Phi
Phi
Phi
Phi
phi
phi
(lin)
限制:
- pi / 2 < Phi && Phi <= pi / 2
Length1Length1Length1Length1length1length_1 (输入控制) rectangle2.hwidth(-array) → HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Half width.
默认值:
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)
最小增量:
1.0
建议增量:
10.0
Length2Length2Length2Length2length2length_2 (输入控制) rectangle2.hheight(-array) → HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Half height.
默认值:
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)
最小增量:
1.0
建议增量:
10.0
结果
如果参数值正确,算子 gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2gen_rectangle2 返回值 2 ( H_MSG_TRUE )。否则将抛出异常。
The clipping according to the current image format is set via the
operator set_system('clip_region',<'true'/'false'>)set_system("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)set_system("clip_region",<"true"/"false">)。
可能的后继
paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region,
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain
替代
gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1,
gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilledGenRegionPolygonFilledgen_region_polygon_filled,
gen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygonGenRegionPolygongen_region_polygon,
gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPointsgen_region_points,
fill_upfill_upFillUpFillUpFillUpfill_up
另见
draw_rectangle2draw_rectangle2DrawRectangle2DrawRectangle2DrawRectangle2draw_rectangle2,
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain,
smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2,
gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipsegen_ellipse
模块
基础