Skip to content

orientation_regionOrientationRegionOrientationRegionorientation_regionorientation_region🔗

Short description🔗

orientation_regionOrientationRegionOrientationRegionorientation_regionorientation_region — Orientation of a region.

Signature🔗

orientation_region( region Regions, out angle.rad Phi )void OrientationRegion( const HObject& Regions, HTuple* Phi )static void HOperatorSet.OrientationRegion( HObject regions, out HTuple phi )def orientation_region( regions: HObject ) -> Sequence[float]

def orientation_region_s( regions: HObject ) -> floatHerror orientation_region( const Hobject Regions, double* Phi )

Herror T_orientation_region( const Hobject Regions, Htuple* Phi )

HTuple HRegion::OrientationRegion( ) const

HTuple HRegion.OrientationRegion( )

Description🔗

The operator orientation_regionOrientationRegion calculates the orientation of the region. The operator is based on elliptic_axisEllipticAxis. In addition the point on the contour with maximal distance to the center of gravity is calculated. If, in the rotated coordinate system, the column coordinate of this point is less than the column coordinate of the center of gravity, the value of \(\pi\) is added to the angle.

In the documentation of this chapter (Regions / Features), you can find an image illustrating regions which vary in their orientation.

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('no_object_result',<Result>)).

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🔗

Regionsregionsregions (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Region(s) to be examined.

Phiphiphi (output_control) angle.rad(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Orientation of region (arc measure).

Assertion: -pi <= Phi && Phi < pi

Complexity🔗

If \(F\) is the area of a region the mean runtime complexity is \(O(\sqrt{F})\).

Result🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection

Possible successors

disp_arrowDispArrow

Alternatives

elliptic_axisEllipticAxis, smallest_rectangle2SmallestRectangle2

See also

moments_region_2ndMomentsRegion2nd, line_orientationLineOrientation

Module🔗

Foundation