Herror ::gen_random_regions (
    Hobject *Regions,
    const HTuple &Type,
    const HTuple &WidthMin,
    const HTuple &WidthMax,
    const HTuple &HeightMin,
    const HTuple &HeightMax,
    const HTuple &PhiMin,
    const HTuple &PhiMax,
    const HTuple &NumRegions,
    const HTuple &Width,
    const HTuple &Height
)
HRegionArray HRegionArray::GenRandomRegions (
    const HTuple &Type,
    const HTuple &WidthMin,
    const HTuple &WidthMax,
    const HTuple &HeightMin,
    const HTuple &HeightMax,
    const HTuple &PhiMin,
    const HTuple &PhiMax,
    const HTuple &NumRegions,
    const HTuple &Width,
    const HTuple &Height
)

Create random regions like circles, rectangles and ellipses.

The operator ::gen_random_region generates circles, rectangles and ellipses whose parameters are determined at random. In each case only one lower, upper limit respectively, is given. The position is always random and cannot be determined by parameters. The parameter NumRegions indicates how many regions shall be created.


Parameters

Regions (output_object)
region-array -> Hobject * : HRegionArray
Created regions.

Type (input_control)
string -> HTuple.char *
Type of regions to be created.
Default value: 'circle'
List of values: 'circle', 'ring', 'ellipse', 'rectangle1', 'rectangle2'

WidthMin (input_control)
number -> HTuple.double / long
Minimum width of the region.
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 -> HTuple.double / long
Maximum width of the region.
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 -> HTuple.double / long
Minimum height of the region.
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 -> HTuple.double / long
Maximum height of the region.
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 -> HTuple.double / long
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)
Minimum increment: 0.001
Recommended increment: 0.10
Restriction: PhiMin > 0

PhiMax (input_control)
number -> HTuple.double / long
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)
Minimum increment: 0.001
Recommended increment: 0.10
Restriction: PhiMax > 0

NumRegions (input_control)
integer -> HTuple.long
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 -> HTuple.long
Maximum horizontal expansion.
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 -> HTuple.long
Maximum vertical expansion.
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


Result

If the parameter values are correct ::gen_random_regions returns the value H_MSG_TRUE. Otherwise an exception handling is raised. The clipping according to the current image format is determined by the operator ::set_system('clip_region',<'true'/'false'>).


Possible Successors

::paint_region


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH