ClassesClassesClassesClasses | | | | Operators

rectangularityrectangularityRectangularityrectangularityRectangularityRectangularity (Operator)

Name

rectangularityrectangularityRectangularityrectangularityRectangularityRectangularity — Shape factor for the rectangularity of a region.

Signature

rectangularity(Regions : : : Rectangularity)

Herror rectangularity(const Hobject Regions, double* Rectangularity)

Herror T_rectangularity(const Hobject Regions, Htuple* Rectangularity)

Herror rectangularity(Hobject Regions, double* Rectangularity)

Herror rectangularity(Hobject Regions, HTuple* Rectangularity)

double HRegion::Rectangularity() const

HTuple HRegionArray::Rectangularity() const

void Rectangularity(const HObject& Regions, HTuple* Rectangularity)

HTuple HRegion::Rectangularity() const

void HOperatorSetX.Rectangularity(
[in] IHUntypedObjectX* Regions, [out] VARIANT* Rectangularity)

VARIANT HRegionX.Rectangularity()

static void HOperatorSet.Rectangularity(HObject regions, out HTuple rectangularity)

HTuple HRegion.Rectangularity()

Description

The operator rectangularityrectangularityRectangularityrectangularityRectangularityRectangularity calculates the rectangularity of the input regions.

To determine the rectangularity, first a rectangle is computed that has the same first and second order moments as the input region. The computation of the rectangularity measure is finally based on the area of the difference between the computed rectangle and the input region normalized with respect to the area of the rectangle.

For rectangles rectangularityrectangularityRectangularityrectangularityRectangularityRectangularity returns the value 1. The more the input region deviates from a perfect rectangle, the less the returned value for RectangularityRectangularityRectangularityRectangularityRectangularityrectangularity will be.

In case of an empty region the operator rectangularityrectangularityRectangularityrectangularityRectangularityRectangularity returns the value 0 (if no other behavior was set (see set_systemset_systemSetSystemset_systemSetSystemSetSystem)). If more than one region is passed the numerical values of the rectangularity are stored in a tuple, the position of a value in the tuple corresponding to the position of the region in the input tuple.

Attention

For input regions which orientation cannot be computed by using second order moments (as it is the case for square regions, for example), the returned RectangularityRectangularityRectangularityRectangularityRectangularityrectangularity is underestimated by up to 10% depending on the orientation of the input region.

Parallelization

Parameters

RegionsRegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Region(s) to be examined.

RectangularityRectangularityRectangularityRectangularityRectangularityrectangularity (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Rectangularity of the input region(s).

Assertion: 0 <= Rectangularity && Rectangularity <= 1.0

Result

The operator rectangularityrectangularityRectangularityrectangularityRectangularityRectangularity 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>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("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>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>). If necessary an exception is raised.

Possible Predecessors

thresholdthresholdThresholdthresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing, connectionconnectionConnectionconnectionConnectionConnection

Alternatives

circularitycircularityCircularitycircularityCircularityCircularity, compactnesscompactnessCompactnesscompactnessCompactnessCompactness, convexityconvexityConvexityconvexityConvexityConvexity, eccentricityeccentricityEccentricityeccentricityEccentricityEccentricity

See also

contlengthcontlengthContlengthcontlengthContlengthContlength, area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter, select_shapeselect_shapeSelectShapeselect_shapeSelectShapeSelectShape

References

P. L. Rosin: “Measuring rectangularity”; Machine Vision and Applications; vol. 11; pp. 191-196; Springer-Verlag, 1999.

Module

Foundation


ClassesClassesClassesClasses | | | | Operators