gen_random_regions — 创建圆形、矩形和椭圆形等随机区域。
gen_random_regions( : Regions : Type, WidthMin, WidthMax, HeightMin, HeightMax, PhiMin, PhiMax, NumRegions, Width, Height : )
算子 gen_random_regions generates regions,
whose parameters are determined at random within the given limits,
and returns them in Regions。
The parameter NumRegions determines how many regions are created.
The position is always random and cannot be determined by parameters, but the center of every region lies in the pixel area [0...Width-1][0...Height-1].
The parameter Type defines the type of the regions.
The meaning of the lower and upper limits depends on Type:
'rectangle1':Minimum/maximum width/height.
'rectangle2':Minimum/maximum half edge lengths,
minimum/maximum rotation angle.
Thereby the larger value is used for the first half edge length.
The parameters correspond to the parameters Length1,
Length2, and Phi of gen_rectangle2。
'circle':WidthMin and WidthMax determine
the minimum and maximum radii.
The parameters correspond to the parameter Radius in
gen_circle。
HeightMin and HeightMax as well as
PhiMin and PhiMax are without further significance.
'ellipse':Minimum/maximum half-radii and minimal/maximum
rotation angle.
Thereby the larger value is used for the first half-radius.
The parameters correspond to the parameters Radius1,
Radius2, and Phi in gen_ellipse。
'ring':Minimum/maximum radii, whereby the larger one determines the radius of the larger circle and the smaller one the radius of the hole.
Regions (输出对象) region-array → object
Created regions.
Type (输入控制) string → (string)
Type of regions to be created.
默认值: 'circle'
值列表: 'circle', 'ellipse', 'rectangle1', 'rectangle2', 'ring'
WidthMin (输入控制) number → (real / integer)
Minimum object characteristic, depending on type and value.
默认值: 10.0
建议值: 1.0, 3.0, 5.0, 10.0, 20.0, 40.0, 80.0
值范围:
0
≤
WidthMin
(lin)
最小增量: 1.0
建议增量: 10.0
WidthMax (输入控制) number → (real / integer)
Maximum object characteristic, depending on type and value.
默认值: 20.0
建议值: 1.0, 3.0, 5.0, 10.0, 20.0, 40.0, 80.0
值范围:
WidthMax
(lin)
最小增量: 1.0
建议增量: 10.0
限制:
WidthMin <= WidthMax
HeightMin (输入控制) number → (real / integer)
Minimum object characteristic, depending on type and value.
默认值: 10.0
建议值: 1.0, 3.0, 5.0, 10.0, 20.0, 40.0, 80.0
值范围:
0
≤
HeightMin
(lin)
最小增量: 1.0
建议增量: 10.0
HeightMax (输入控制) number → (real / integer)
Maximum object characteristic, depending on type and value.
默认值: 30.0
建议值: 1.0, 3.0, 5.0, 10.0, 20.0, 40.0, 80.0
值范围:
HeightMax
(lin)
最小增量: 1.0
建议增量: 10.0
限制:
HeightMin <= HeightMax
PhiMin (输入控制) number → (real / integer)
Minimum rotation angle of the region.
默认值: -0.7854
建议值: 0.0, 0.1, 0.3, 0.6, 0.9, 1.2, 1.5
值范围:
0.0
≤
PhiMin
≤
6.28 (lin)
限制:
PhiMin > 0
PhiMax (输入控制) number → (real / integer)
Maximum rotation angle of the region.
默认值: 0.7854
建议值: 0.0, 0.1, 0.3, 0.6, 0.9, 1.2, 1.5
值范围:
0.0
≤
PhiMax
≤
6.28 (lin)
限制:
PhiMax > 0
NumRegions (输入控制) integer → (integer)
Number of regions.
默认值: 100
建议值: 1, 5, 20, 100, 200, 500, 1000, 2000
值范围:
1
≤
NumRegions
(lin)
最小增量: 1
建议增量: 10
Width (输入控制) integer → (integer)
Maximum horizontal expansion of the centers.
默认值: 512
建议值: 128, 256, 512, 1024
值范围:
1
≤
Width
(lin)
最小增量: 1
建议增量: 10
Height (输入控制) integer → (integer)
Maximum vertical expansion of the centers.
默认值: 512
建议值: 128, 256, 512, 1024
值范围:
1
≤
Height
(lin)
最小增量: 1
建议增量: 10
If the parameter values are correct gen_random_regions 返回值 2 ( H_MSG_TRUE )。否则将抛出异常。
The clipping according to the current image format is determined by
the operator set_system('clip_region',<'true'/'false'>)。
基础