Operator Reference

roundnessroundnessRoundnessRoundnessroundness (Operator)

roundnessroundnessRoundnessRoundnessroundness — Shape factors from contour.

Signature

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

Herror roundness(const Hobject Regions, double* Distance, double* Sigma, double* Roundness, double* Sides)

Herror T_roundness(const Hobject Regions, Htuple* Distance, Htuple* Sigma, Htuple* Roundness, Htuple* Sides)

void Roundness(const HObject& Regions, HTuple* Distance, HTuple* Sigma, HTuple* Roundness, HTuple* Sides)

HTuple HRegion::Roundness(HTuple* Sigma, HTuple* Roundness, HTuple* Sides) const

double HRegion::Roundness(double* Sigma, double* Roundness, double* Sides) const

static void HOperatorSet.Roundness(HObject regions, out HTuple distance, out HTuple sigma, out HTuple roundness, out HTuple sides)

HTuple HRegion.Roundness(out HTuple sigma, out HTuple roundness, out HTuple sides)

double HRegion.Roundness(out double sigma, out double roundness, out double sides)

def roundness(regions: HObject) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

def roundness_s(regions: HObject) -> Tuple[float, float, float, float]

Description

The operator roundnessroundnessRoundnessRoundnessroundness examines the distance between the contour and the center of the area. In particular the mean distance (DistanceDistanceDistancedistancedistance), the deviation from the mean distance (SigmaSigmaSigmasigmasigma) and two shape features derived therefrom are determined. RoundnessRoundnessRoundnessroundnessroundness is the relation between mean value and standard deviation, and SidesSidesSidessidessides 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_systemset_systemSetSystemSetSystemset_system).

Calculation:

If p is the center of the area, 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_systemset_systemSetSystemSetSystemset_system).

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

RegionsRegionsRegionsregionsregions (input_object)  region(-array) objectHRegionHObjectHObjectHobject

Region(s) to be examined.

DistanceDistanceDistancedistancedistance (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Mean distance from the center.

Assertion: Distance >= 0.0

SigmaSigmaSigmasigmasigma (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Standard deviation of DistanceDistanceDistancedistancedistance.

Assertion: Sigma >= 0.0

RoundnessRoundnessRoundnessroundnessroundness (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Shape factor for roundness.

Assertion: Roundness <= 1.0

SidesSidesSidessidessides (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

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 roundnessroundnessRoundnessRoundnessroundness 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>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>), the behavior in case of empty region is set via set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>). If necessary an exception is raised.

Possible Predecessors

thresholdthresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionconnection

Alternatives

compactnesscompactnessCompactnessCompactnesscompactness

See also

contlengthcontlengthContlengthContlengthcontlength

References

R. Haralick, L. Shapiro “Computer and Robot Vision” Addison-Wesley, 1992, pp. 61

Module

Foundation