gen_random_regionsgen_random_regionsGenRandomRegionsGenRandomRegionsgen_random_regions (算子)

名称

gen_random_regionsgen_random_regionsGenRandomRegionsGenRandomRegionsgen_random_regions — 创建圆形、矩形和椭圆形等随机区域。

签名

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)

void GenRandomRegions(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)

void HRegion::GenRandomRegions(const HString& Type, const HTuple& WidthMin, const HTuple& WidthMax, const HTuple& HeightMin, const HTuple& HeightMax, const HTuple& PhiMin, const HTuple& PhiMax, Hlong NumRegions, Hlong Width, Hlong Height)

void HRegion::GenRandomRegions(const HString& Type, double WidthMin, double WidthMax, double HeightMin, double HeightMax, double PhiMin, double PhiMax, Hlong NumRegions, Hlong Width, Hlong Height)

void HRegion::GenRandomRegions(const char* Type, double WidthMin, double WidthMax, double HeightMin, double HeightMax, double PhiMin, double PhiMax, Hlong NumRegions, Hlong Width, Hlong Height)

void HRegion::GenRandomRegions(const wchar_t* Type, double WidthMin, double WidthMax, double HeightMin, double HeightMax, double PhiMin, double PhiMax, Hlong NumRegions, Hlong Width, Hlong Height)   ( Windows only)

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)

def gen_random_regions(type: str, width_min: Union[float, int], width_max: Union[float, int], height_min: Union[float, int], height_max: Union[float, int], phi_min: Union[float, int], phi_max: Union[float, int], num_regions: int, width: int, height: int) -> HObject

描述

算子 gen_random_regionsgen_random_regionsGenRandomRegionsGenRandomRegionsGenRandomRegionsgen_random_regions generates regions, whose parameters are determined at random within the given limits, and returns them in RegionsRegionsRegionsRegionsregionsregions

The parameter NumRegionsNumRegionsNumRegionsNumRegionsnumRegionsnum_regions 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 TypeTypeTypeTypetypetype defines the type of the regions. The meaning of the lower and upper limits depends on TypeTypeTypeTypetypetype:

执行信息

参数

RegionsRegionsRegionsRegionsregionsregions (输出对象)  region-array objectHRegionHObjectHRegionHobject *

Created regions.

TypeTypeTypeTypetypetype (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Type of regions to be created.

默认值: 'circle' "circle" "circle" "circle" "circle" "circle"

值列表: 'circle'"circle""circle""circle""circle""circle", 'ellipse'"ellipse""ellipse""ellipse""ellipse""ellipse", 'rectangle1'"rectangle1""rectangle1""rectangle1""rectangle1""rectangle1", 'rectangle2'"rectangle2""rectangle2""rectangle2""rectangle2""rectangle2", 'ring'"ring""ring""ring""ring""ring"

WidthMinWidthMinWidthMinWidthMinwidthMinwidth_min (输入控制)  number HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

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

最小增量: 1.0

建议增量: 10.0

WidthMaxWidthMaxWidthMaxWidthMaxwidthMaxwidth_max (输入控制)  number HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

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

最小增量: 1.0

建议增量: 10.0

限制: WidthMin <= WidthMax

HeightMinHeightMinHeightMinHeightMinheightMinheight_min (输入控制)  number HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

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

最小增量: 1.0

建议增量: 10.0

HeightMaxHeightMaxHeightMaxHeightMaxheightMaxheight_max (输入控制)  number HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

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

最小增量: 1.0

建议增量: 10.0

限制: HeightMin <= HeightMax

PhiMinPhiMinPhiMinPhiMinphiMinphi_min (输入控制)  number HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

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

限制: PhiMin > 0

PhiMaxPhiMaxPhiMaxPhiMaxphiMaxphi_max (输入控制)  number HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

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

限制: PhiMax > 0

NumRegionsNumRegionsNumRegionsNumRegionsnumRegionsnum_regions (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of regions.

默认值: 100

建议值: 1, 5, 20, 100, 200, 500, 1000, 2000

值范围: 1 ≤ NumRegions NumRegions NumRegions NumRegions numRegions num_regions (lin)

最小增量: 1

建议增量: 10

WidthWidthWidthWidthwidthwidth (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximum horizontal expansion of the centers.

默认值: 512

建议值: 128, 256, 512, 1024

值范围: 1 ≤ Width Width Width Width width width (lin)

最小增量: 1

建议增量: 10

HeightHeightHeightHeightheightheight (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximum vertical expansion of the centers.

默认值: 512

建议值: 128, 256, 512, 1024

值范围: 1 ≤ Height Height Height Height height height (lin)

最小增量: 1

建议增量: 10

结果

If the parameter values are correct gen_random_regionsgen_random_regionsGenRandomRegionsGenRandomRegionsGenRandomRegionsgen_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'>)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

模块

基础