gen_random_regions
— Create random regions like circles, rectangles and ellipses.
gen_random_regions( : Regions : Type, WidthMin, WidthMax, HeightMin, HeightMax, PhiMin, PhiMax, NumRegions, Width, Height : )
The operator 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
(output_object) region-array →
object
Created regions.
Type
(input_control) string →
(string)
Type of regions to be created.
Default value: 'circle'
List of values: 'circle' , 'ellipse' , 'rectangle1' , 'rectangle2' , 'ring'
WidthMin
(input_control) number →
(real / integer)
Minimum object characteristic, depending on type and value.
Default value: 10.0
Suggested values: 1.0, 3.0, 5.0, 10.0, 20.0, 40.0, 80.0
Typical range of values: 1.0
≤
WidthMin
≤
511.0
(lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: WidthMin > 0
WidthMax
(input_control) number →
(real / integer)
Maximum object characteristic, depending on type and value.
Default value: 20.0
Suggested values: 1.0, 3.0, 5.0, 10.0, 20.0, 40.0, 80.0
Typical range of values: 1.0
≤
WidthMax
≤
511.0
(lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: WidthMax > 0
HeightMin
(input_control) number →
(real / integer)
Minimum object characteristic, depending on type and value.
Default value: 10.0
Suggested values: 1.0, 3.0, 5.0, 10.0, 20.0, 40.0, 80.0
Typical range of values: 1.0
≤
HeightMin
≤
511.0
(lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: HeightMin > 0
HeightMax
(input_control) number →
(real / integer)
Maximum object characteristic, depending on type and value.
Default value: 30.0
Suggested values: 1.0, 3.0, 5.0, 10.0, 20.0, 40.0, 80.0
Typical range of values: 1.0
≤
HeightMax
≤
511.0
(lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: HeightMax > 0
PhiMin
(input_control) number →
(real / integer)
Minimum rotation angle of the region.
Default value: -0.7854
Suggested values: 0.0, 0.1, 0.3, 0.6, 0.9, 1.2, 1.5
Typical range of values: 0.0
≤
PhiMin
≤
6.28
(lin)
Restriction: PhiMin > 0
PhiMax
(input_control) number →
(real / integer)
Maximum rotation angle of the region.
Default value: 0.7854
Suggested values: 0.0, 0.1, 0.3, 0.6, 0.9, 1.2, 1.5
Typical range of values: 0.0
≤
PhiMax
≤
6.28
(lin)
Restriction: PhiMax > 0
NumRegions
(input_control) integer →
(integer)
Number of regions.
Default value: 100
Suggested values: 1, 5, 20, 100, 200, 500, 1000, 2000
Typical range of values: 1
≤
NumRegions
≤
2000
(lin)
Minimum increment: 1
Recommended increment: 10
Restriction: NumRegions > 0
Width
(input_control) integer →
(integer)
Maximum horizontal expansion of the centers.
Default value: 512
Suggested values: 128, 256, 512, 1024
Typical range of values: 1
≤
Width
≤
1024
(lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Width > 0
Height
(input_control) integer →
(integer)
Maximum vertical expansion of the centers.
Default value: 512
Suggested values: 128, 256, 512, 1024
Typical range of values: 1
≤
Height
≤
1024
(lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Height > 0
If the parameter values are correct gen_random_regions
returns
the value 2 (H_MSG_TRUE).
Otherwise an exception is raised.
The clipping according to the current image format is determined by
the operator set_system('clip_region',<'true'/'false'>)
.
Foundation