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

gen_region_polygonT_gen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygon (Operator)

Name

gen_region_polygonT_gen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygon — Store a polygon as a region.

Signature

gen_region_polygon( : Region : Rows, Columns : )

Herror T_gen_region_polygon(Hobject* Region, const Htuple Rows, const Htuple Columns)

Herror gen_region_polygon(Hobject* Region, const HTuple& Rows, const HTuple& Columns)

HRegion HRegion::GenRegionPolygon(const HTuple& Rows, const HTuple& Columns)

void HOperatorSetX.GenRegionPolygon(
[out] IHUntypedObjectX*Region, [in] VARIANT Rows, [in] VARIANT Columns)

void HRegionX.GenRegionPolygon(
[in] VARIANT Rows, [in] VARIANT Columns)

static void HOperatorSet.GenRegionPolygon(out HObject region, HTuple rows, HTuple columns)

void HRegion.GenRegionPolygon(HTuple rows, HTuple columns)

Description

The operator gen_region_polygongen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygon creates a region from a polygon row described by a series of line and column coordinates. The created region consists of the pixels of the routes defined thereby, wherein it is linearily interpolated between the base points.

Attention

The region is not automatically closed and not filled.

Parallelization

Parameters

RegionRegionRegionRegionregion (output_object)  region objectHRegionHRegionHRegionXHobject *

Created region.

RowsRowsRowsRowsrows (input_control)  polygon.y-array HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Line indices of the base points of the region contour.

Default value: 100

Suggested values: 0, 10, 30, 50, 100, 200, 300, 500

Typical range of values: Rows Rows Rows Rows rows (lin)

Minimum increment: 1

Recommended increment: 1

ColumnsColumnsColumnsColumnscolumns (input_control)  polygon.x-array HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Colum indices of the base points of the region contour.

Number of elements: Columns == Rows

Default value: 100

Suggested values: 0, 10, 30, 50, 100, 200, 300, 500

Typical range of values: Columns Columns Columns Columns columns (lin)

Minimum increment: 1

Recommended increment: 1

Example (HDevelop)

* Polygon-approximation
get_region_polygon(Region,7,Row,Column)
* store it as a region
gen_region_polygon(Pol,Row,Column)
* fill up the hole
fill_up(Pol,Filled)

Example (C)

/* Polygon-approximation */
T_get_region_polygon(Region,7,&Row,&Column);
/* store it as a region */
T_gen_region_polygon(&Pol,Row,Column);
destroy_tuple(Row);
destroy_tuple(Column);
/* fill up the hole */
fill_up(Pol,&Filled);

Example (HDevelop)

* Polygon-approximation
get_region_polygon(Region,7,Row,Column)
* store it as a region
gen_region_polygon(Pol,Row,Column)
* fill up the hole
fill_up(Pol,Filled)

Example (HDevelop)

* Polygon-approximation
get_region_polygon(Region,7,Row,Column)
* store it as a region
gen_region_polygon(Pol,Row,Column)
* fill up the hole
fill_up(Pol,Filled)

Example (HDevelop)

* Polygon-approximation
get_region_polygon(Region,7,Row,Column)
* store it as a region
gen_region_polygon(Pol,Row,Column)
* fill up the hole
fill_up(Pol,Filled)

Result

If the base points are correct the operator gen_region_polygongen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygon returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised. The clipping according to the current image format is set via 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">). If an empty region is created (by the clipping or by an empty input) the operator set_system('store_empty_region',<true/false>)set_system("store_empty_region",<true/false>)set_system("store_empty_region",<true/false>)SetSystem("store_empty_region",<true/false>)SetSystem("store_empty_region",<true/false>) determines whether the region is returned or an empty object tuple.

Possible Predecessors

get_region_polygonget_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygon, draw_polygondraw_polygondraw_polygonDrawPolygonDrawPolygon

Alternatives

gen_region_polygon_filledgen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilled, gen_region_pointsgen_region_pointsgen_region_pointsGenRegionPointsGenRegionPoints, gen_region_runsgen_region_runsgen_region_runsGenRegionRunsGenRegionRuns

See also

fill_upfill_upfill_upFillUpFillUp, reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain, get_region_polygonget_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygon, draw_polygondraw_polygondraw_polygonDrawPolygonDrawPolygon

Module

Foundation


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