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

Smallest surrounding circle of a region.

The operator smallest_circle determines the smallest surrounding circle of a region, i.e. the circle with the smallest area of all circles containing the region. For this circle the center (Row,Column) and the radius (Radius) are calculated. The procedure is applied when, for example, the location and size of circular objects (e.g. coins) which, however, are not homogeneous inside or have broken edges due to bad segmentation, has to be determined. The output of the procedure is selected in such a way that it can be used as input for the HORUS procedures disp_circle and circle. If several regions are passed in Regions corresponding tuples are returned as output parameter. In case of empty region all parameters have the value 0.0 if no other behavior was set (see set_system).


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 surrounding circle.
Assertion: Radius >= 0


Example
read_image(:Image:'fabrik':) >
open_window(::0,0,-1,-1,'root','visible','':) >
regiongrowing__(Image:Seg:5,5,6,100:) >
select_shape(Seg:H:'area','and',100,2000:) >
smallest_circle(H:::Row,Column,Radius) >
circle(:Circles:Row,Column,Radius:) >
set_draw(::'margin':) >
disp_region(Circles:::).

Complexity

If F is the area of the region and N is the number of supporting points of the convex hull, the mean runtime complexity is O(F + N^3).


Result

The operator smallest_circle returns the value 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 (the region is the empty set) is set via set_system(::'empty_region_result',<Result>:). If necessary an exception is raised.


Possible Predecessors

threshold__, regiongrowing__, connection, fetch_chord


Possible Successors

circle, disp_circle


Alternatives

elliptic_axis, smallest_rectangle1, smallest_rectangle2


See also

set_shape, select_shape, inner_circle



Copyright © 1996-1997 MVTec Software GmbH