inner_circle ( Regions : : : Row, Column, Radius )

Largest inner circle of a region.

The operator inner_circle determines the largest inner circle of a region. This is the biggest discrete circle region that completely fits into the region. For this circle the center (Row, Column) and the radius (Radius) are calculated. If the position of the circle is ambiguous, the "first possible" position (as far upper left as possible) is returned.

The output of the procedure is chosen in such a way that it can be used as an input for the HALCON procedures disp_circle, gen_circle, and gen_ellipse_contour_xld.

If several regions are passed in Regions corresponding tuples are returned as output parameters. In case of an empty input region all parameters have the value 0.0 if no other behavior was set with set_system.


Attention

If several inner circles are present at a region only the most upper left solution is returned.


Parameters

Regions (input_object)
region(-array) -> object
Regions to be examined.

Row (output_control)
circle.center.y(-array) -> real
Line index of the center.

Column (output_control)
circle.center.x(-array) -> real
Column index of the center.

Radius (output_control)
circle.radius(-array) -> real
Radius of the inner circle.
Assertion: Radius >= 0


Example
read_image(Image,'fabrik')
open_window(0,0,-1,-1,'root','visible','',WindowHandle)
regiongrowing(Image,Seg,5,5,6,100)
select_shape(Seg,H,'area','and',100,2000)
inner_circle(H,Row,Column,Radius)
gen_circle(Circles,Row,Column,Radius:)
set_draw(WindowHandle,'margin')
disp_region(Circles,WindowHandle)

Complexity

If F is the area of the region and R is the radius of the inner circle the runtime complexity is O(sqrt(F) * R).


Result

The operator inner_circle returns the value 2 (H_MSG_TRUE) if the input is not empty. The behavior in case of empty input (no input regions available) is set via the operator set_system('no_object_result',<Result>), the behavior in case of empty region is set via set_system('empty_region_result',<Result>). If necessary an exception handling is raised.


Parallelization Information

inner_circle is reentrant and automatically parallelized (on tuple level).


Possible Predecessors

threshold, regiongrowing, connection, runlength_features


Possible Successors

gen_circle, disp_circle


Alternatives

erosion_circle


See also

set_shape, select_shape, smallest_circle


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH