roundness ( Regions : : : Distance, Sigma, Roundness, Sides )

Shape factors from contour.

The operator roundness examines the distance between the contour and the center of the area. In particular the mean distance (Distance), the deviation from the mean distance (Sigma) and two shape features derived therefrom are determined. Roundness is the relation between mean value and standard deviation, and Sides indicates the number of polygon pieces if a regular polygon is concerned.

The contour for calculating the features is determined depending on the global neighbourhood (see set_system).

Calculation:

If $p$ is the center of the area, $pi$ the pixels
and $F$ the area of the contour.
 Distance  = sum(||p - pi||) / F
 Sigma^2   = sum(||p - pi|| - Distance)\right^2 / F
 Roundness = 1 - Sigma / Distance
 Sides     = 1.4111 *
(Distance/Sigma)^0.4724

If more than one region is passed the results are stored in tuples, the index of a value in the tuple corresponding to the index of a region in the input. 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
Region(s) to be examined.

Distance (output_control)
real(-array) -> real
Mean distance from the center.
Assertion: Distance >= 0.0

Sigma (output_control)
real(-array) -> real
Standard deviation of Distance.
Assertion: Sigma >= 0.0

Roundness (output_control)
real(-array) -> real
Shape factor for roundness.
Assertion: Roundness <= 1.0

Sides (output_control)
real(-array) -> real
Number of polygon sides.
Assertion: Sides >= 0


Complexity

If F is the area of a region the mean runtime complexity is O(F).


Result

The operator roundness 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 is set via set_system(::'empty_region_result',<Result>:). If necessary an exception is raised.


Possible Predecessors

threshold__, regiongrowing__, connection


Alternatives

compactness


See also

contlength


References

R. Haralick, L. Shapiro "Computer and Robot Vision" Addison-Wesley, 1992, Seite 61



Copyright © 1996-1997 MVTec Software GmbH