HALCON Reference Manual 10.0.2
Table of Contents / Regions / Creation ClassesClassesClasses | | | Operators

gen_random_regionsgen_random_regionsgen_random_regionsGenRandomRegionsGenRandomRegions (Operator)

Name

gen_random_regionsgen_random_regionsgen_random_regionsGenRandomRegionsGenRandomRegions — Create random regions like circles, rectangles and ellipses.

Signature

gen_random_regions( : Regions : Type, WidthMin, WidthMax, HeightMin, HeightMax, PhiMin, PhiMax, NumRegions, Width, Height : )

Herror gen_random_regions(Hobject* Regions, const char* Type, double WidthMin, double WidthMax, double HeightMin, double HeightMax, double PhiMin, double PhiMax, const Hlong NumRegions, const Hlong Width, const Hlong Height)

Herror T_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)

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)

void HOperatorSetX.GenRandomRegions(
[out] IHUntypedObjectX*Regions, [in] VARIANT Type, [in] VARIANT WidthMin, [in] VARIANT WidthMax, [in] VARIANT HeightMin, [in] VARIANT HeightMax, [in] VARIANT PhiMin, [in] VARIANT PhiMax, [in] VARIANT NumRegions, [in] VARIANT Width, [in] VARIANT Height)

void HRegionX.GenRandomRegions(
[in] BSTR Type, [in] VARIANT WidthMin, [in] VARIANT WidthMax, [in] VARIANT HeightMin, [in] VARIANT HeightMax, [in] VARIANT PhiMin, [in] VARIANT PhiMax, [in] Hlong NumRegions, [in] Hlong Width, [in] Hlong Height)

static void HOperatorSet.GenRandomRegions(out HObject regions, HTuple type, HTuple widthMin, HTuple widthMax, HTuple heightMin, HTuple heightMax, HTuple phiMin, HTuple phiMax, HTuple numRegions, HTuple width, HTuple height)

void HRegion.GenRandomRegions(string type, HTuple widthMin, HTuple widthMax, HTuple heightMin, HTuple heightMax, HTuple phiMin, HTuple phiMax, int numRegions, int width, int height)

void HRegion.GenRandomRegions(string type, double widthMin, double widthMax, double heightMin, double heightMax, double phiMin, double phiMax, int numRegions, int width, int height)

Description

The operator gen_random_regionsgen_random_regionsgen_random_regionsGenRandomRegionsGenRandomRegions 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 NumRegionsNumRegionsNumRegionsNumRegionsnumRegions indicates how many regions shall be created.

Parallelization

Parameters

RegionsRegionsRegionsRegionsregions (output_object)  region-array objectHRegionHRegionArrayHRegionXHobject *

Created regions.

TypeTypeTypeTypetype (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Type of regions to be created.

Default value: 'circle' "circle" "circle" "circle" "circle"

List of values: 'circle'"circle""circle""circle""circle", 'ring'"ring""ring""ring""ring", 'ellipse'"ellipse""ellipse""ellipse""ellipse", 'rectangle1'"rectangle1""rectangle1""rectangle1""rectangle1", 'rectangle2'"rectangle2""rectangle2""rectangle2""rectangle2"

WidthMinWidthMinWidthMinWidthMinwidthMin (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

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 WidthMin WidthMin WidthMin widthMin ≤ 511.0 (lin)

Minimum increment: 1.0

Recommended increment: 10.0

Restriction: WidthMin > 0

WidthMaxWidthMaxWidthMaxWidthMaxwidthMax (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

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 WidthMax WidthMax WidthMax widthMax ≤ 511.0 (lin)

Minimum increment: 1.0

Recommended increment: 10.0

Restriction: WidthMax > 0

HeightMinHeightMinHeightMinHeightMinheightMin (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

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 HeightMin HeightMin HeightMin heightMin ≤ 511.0 (lin)

Minimum increment: 1.0

Recommended increment: 10.0

Restriction: HeightMin > 0

HeightMaxHeightMaxHeightMaxHeightMaxheightMax (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

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 HeightMax HeightMax HeightMax heightMax ≤ 511.0 (lin)

Minimum increment: 1.0

Recommended increment: 10.0

Restriction: HeightMax > 0

PhiMinPhiMinPhiMinPhiMinphiMin (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

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 PhiMin PhiMin PhiMin phiMin ≤ 6.28 (lin)

Minimum increment: 0.001

Recommended increment: 0.10

Restriction: PhiMin > 0

PhiMaxPhiMaxPhiMaxPhiMaxphiMax (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

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 PhiMax PhiMax PhiMax phiMax ≤ 6.28 (lin)

Minimum increment: 0.001

Recommended increment: 0.10

Restriction: PhiMax > 0

NumRegionsNumRegionsNumRegionsNumRegionsnumRegions (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Number of regions.

Default value: 100

Suggested values: 1, 5, 20, 100, 200, 500, 1000, 2000

Typical range of values: 1 ≤ NumRegions NumRegions NumRegions NumRegions numRegions ≤ 2000 (lin)

Minimum increment: 1

Recommended increment: 10

Restriction: NumRegions > 0

WidthWidthWidthWidthwidth (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Maximum horizontal expansion.

Default value: 512

Suggested values: 128, 256, 512, 1024

Typical range of values: 1 ≤ Width Width Width Width width ≤ 1024 (lin)

Minimum increment: 1

Recommended increment: 10

Restriction: Width > 0

HeightHeightHeightHeightheight (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Maximum vertical expansion.

Default value: 512

Suggested values: 128, 256, 512, 1024

Typical range of values: 1 ≤ Height Height Height Height height ≤ 1024 (lin)

Minimum increment: 1

Recommended increment: 10

Restriction: Height > 0

Result

If the parameter values are correct gen_random_regionsgen_random_regionsgen_random_regionsGenRandomRegionsGenRandomRegions 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'>)set_system("clip_region",<"true"/"false">)set_system("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">).

Possible Successors

paint_regionpaint_regionpaint_regionPaintRegionPaintRegion

Module

Foundation


Table of Contents / Regions / Creation ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH