store_polygon ( : Region : Rows, Columns : )

Store a polygon as an image object.

The operator store_polygon 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 automatically closed and not filled. The gray values of the output regions are undefined. All base points must be located within the image format. If no pixels are passed an empty region is created.


Parameters

Region (output_object)
region -> object
Created region.

Rows (input_control)
polygon.y-array -> integer
Line indices of the base points of the region contour.
Default value: 100
Suggested values: 0, 10, 30, 50, 100, 200, 300, 500
Range of values: 0 <= Rows <= 511 (lin)
Minimum increment: 1
Recommended increment: 1

Columns (input_control)
polygon.x-array -> integer
Colum indices of the base points of the region contour.
Default value: 100
Suggested values: 0, 10, 30, 50, 100, 200, 300, 500
Range of values: 0 <= Columns <= 511 (lin)
Minimum increment: 1
Recommended increment: 1
Number of elements: Columns == Rows


Example
/* Polygon-approximation*/
fetch_polygon(Region::7:Row,Column) >
/* store it as a region */
store_polygon(:Pol:Row,Column:) >
/* fill up the hole */
fill_up(Pol:Filled::).

Result

If the base points are correct the operator store_polygon returns the value TRUE. Otherwise an exception is raised. The clipping of the current image format is set via the operator set_system(::'clip_region',<true/false>:). If an empty region is created the operator set_system(::'store_empty_region',<true/false>:) determines whether the region is returned.


Possible Predecessors

fetch_polygon, draw_polygon


Alternatives

store_filled_polygon, store_coord, store_chord


See also

fill_up, reduce_domain, fetch_polygon, draw_polygon



Copyright © 1996-1997 MVTec Software GmbH