roundnessπ
Short descriptionπ
roundness β Shape factors from contour.
Signatureπ
roundness( region Regions, out real Distance, out real Sigma, out real Roundness, out real Sides )
Descriptionπ
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.
In the documentation of this chapter (Regions / Features), you can find an image illustrating regions which vary in their mean distance, distance deviation, roundness and number of polygon pieces.
The contour for calculating the features is determined depending on the
global neighborhood (see set_system).
Calculation:
If \(p\) is the center of the area, \(p_{i}\) the pixels and \(F\) the area of the contour.
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).
Execution informationπ
Execution information
-
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
-
Multithreading scope: global (may be called from any thread).
-
Automatically parallelized on tuple level.
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(\sqrt{F})\).
Resultπ
The operator roundness 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 is raised.
Combinations with other operatorsπ
Referencesπ
R. Haralick, L. Shapiro βComputer and Robot Visionβ Addison-Wesley, 1992, pp. 61
Moduleπ
Foundation