Skip to content

gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilledgen_region_polygon_filledT_gen_region_polygon_filledπŸ”—

Short descriptionπŸ”—

gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilledgen_region_polygon_filledT_gen_region_polygon_filled β€” Store a polygon as a β€œfilled” region.

SignatureπŸ”—

gen_region_polygon_filled( out region Region, polygon.y Rows, polygon.x Columns )gen_region_polygon_filled( : Region : Rows, Columns : )void GenRegionPolygonFilled( HObject* Region, const HTuple& Rows, const HTuple& Columns )static void HOperatorSet.GenRegionPolygonFilled( out HObject region, HTuple rows, HTuple columns )def gen_region_polygon_filled( rows: Sequence[Union[int, float]], columns: Sequence[Union[int, float]] ) -> HObject

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

void HRegion::GenRegionPolygonFilled( const HTuple& Rows, const HTuple& Columns )

void HRegion.GenRegionPolygonFilled( HTuple rows, HTuple columns )

DescriptionπŸ”—

The operator gen_region_polygon_filledGenRegionPolygonFilled creates a region from a polygon containing the corner points of the region (line and column coordinates) either clockwise or anti-clockwise. Contrary to gen_region_polygonGenRegionPolygon a β€œfilled” region is returned here. Note that for subpixel coordinates Rowsrowsrows and Columnscolumnscolumns the coordinates are rounded before the polygon containing the corner points is determined. Therefore there might be pixels in the Regionregionregion which do not lie on the original (subpixel) polygon. An simple alternative in the case of polygons without holes would be to use the operators gen_region_polygonGenRegionPolygon and fill_upFillUp.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

Regionregionregion (output_object) region β†’ objectobjectHObjectHRegionHObjectHobject *

Created region.

Rowsrowsrows (input_control) polygon.y-array β†’ (integer / real)(integer / real)HTuple (Hlong / double)HTuple (int / long / double)Sequence[Union[int, float]]Htuple (Hlong / double)

Line indices of the base points of the region contour.

Default: 100100
Suggested values: 0, 10, 30, 50, 100, 200, 300, 5000, 10, 30, 50, 100, 200, 300, 500
Value range: Rows (lin)
Minimum increment: 1
Recommended increment: 1

Columnscolumnscolumns (input_control) polygon.x-array β†’ (integer / real)(integer / real)HTuple (Hlong / double)HTuple (int / long / double)Sequence[Union[int, float]]Htuple (Hlong / double)

Column indices of the base points of the region contour.

Number of elements: Columns == Rows
Default: 100100
Suggested values: 0, 10, 30, 50, 100, 200, 300, 5000, 10, 30, 50, 100, 200, 300, 500
Value range: Columns (lin)
Minimum increment: 1
Recommended increment: 1

ExampleπŸ”—

(C)

/* Polygon approximation */
T_get_region_polygon(Region,7,&Row,&Column)\;
T_gen_region_polygon_filled(&Pol,Row,Column)\;
/* fill up with original gray value */
reduce_domain(Image,Pol,&New)\;

ResultπŸ”—

If the base points are correct the operator gen_region_polygon_filledGenRegionPolygonFilled returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised. The clipping according to the global image size is set via the operator set_system('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'>) determines whether the region is returned or an empty object tuple.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

get_region_polygonGetRegionPolygon, draw_polygonDrawPolygon

Alternatives

gen_region_polygonGenRegionPolygon, gen_region_pointsGenRegionPoints, draw_polygonDrawPolygon

See also

gen_region_polygonGenRegionPolygon, reduce_domainReduceDomain, get_region_polygonGetRegionPolygon, gen_region_runsGenRegionRuns

ModuleπŸ”—

Foundation