gen_circle ( : Circle : Row, Column, Radius : )

Create a circle.

The operator gen_circle generates one or more circles described by the center and Radius. If several circles shall be generated the coordinates must be passed in the form of tuples.

gen_circle only creates symmetric circles. To achieve this, the radius is internally rounded down to a multiple of 0.5. If an integer number is specified for the radius (i.e., 1, 2, 3, ...) an even diameter is obtained, and hence the circle can only be symmetric with respect to a center with coordinates that have a fractional part of 0.5. Consequently, internally the coordinates of the center are adapted to the closest coordinates that have a fractional part of 0.5. Here, integer coordinates are rounded down to the next smaller values with a fractional part of 0.5. For odd diameters (i.e., radius = 1.5, 2.5, 3.5, ...), the circle can only be symmetric with respect to a center with integer coordinates. Hence, internally the coordinates of the center are rounded to the nearest integer coordinates. It should be noted that the above algorithm may lead to the fact that circles with an even diameter are not contained in circles with the next larger odd diameter, even if the coordinates specified in Row and Column are identical.

If the circle extends beyond the image edge it is clipped to the current image format if the value of the system flag 'clip_region' is set to 'true' (set_system).


Parameters

Circle (output_object)
region(-array) -> object
Generated circle.

Row (input_control)
circle.center.y(-array) -> real / integer
Line index of center.
Default value: 200.0
Suggested values: 0.0, 10.0, 50.0, 100.0, 200.0, 300.0
Typical range of values: 1.0 <= Row <= 1024.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Column (input_control)
circle.center.x(-array) -> real / integer
Column index of center.
Default value: 200.0
Suggested values: 0.0, 10.0, 50.0, 100.0, 200.0, 300.0
Typical range of values: 1.0 <= Column <= 1024.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Radius (input_control)
circle.radius(-array) -> real / integer
Radius of circle.
Default value: 100.5
Suggested values: 1.0, 1.5, 2.0, 2.5, 3, 3.5, 4, 4.5, 5.5, 6.5, 7.5, 9.5, 11.5, 15.5, 20.5, 25.5, 31.5, 50.5
Typical range of values: 1.0 <= Radius <= 1024.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Radius > 0.0


Example
open_window(0,0,-1,-1,'root','visible','',WindowHandle) 
read_image(Image,'meer') 
gen_circle(Circle,300.0,200.0,150.5) 
reduce_domain(Image,Circle,Mask) 
disp_color(Mask,WindowHandle).

Complexity

Runtime complexity: O(Radius * 2)

Storage complexity (byte): O(Radius * 8)


Result

If the parameter values are correct, the operator gen_circle returns the value 2 (H_MSG_TRUE). Otherwise an exception handling is raised. The clipping according to the current image format is set via the operator set_system('clip_region',<'true'/'false'>). If an empty region is created by clipping (the circle is completely outside of the image format) the operator set_system('store_empty_region',<true/false>) determines whether the empty region is put out.


Parallelization Information

gen_circle is reentrant and processed without parallelization.


Possible Successors

paint_region, reduce_domain


Alternatives

gen_ellipse, gen_region_polygon_filled, gen_region_points, gen_region_runs, draw_circle


See also

disp_circle, set_shape, smallest_circle, reduce_domain


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH