Skip to content

moments_region_centralmoments_region_centralMomentsRegionCentralMomentsRegionCentralmoments_region_centralmoments_region_central🔗

Short description🔗

moments_region_centralmoments_region_centralMomentsRegionCentralMomentsRegionCentralmoments_region_centralmoments_region_central — Geometric moments of regions.

Signature🔗

moments_region_central( region Regions, out real I1, out real I2, out real I3, out real I4 )moments_region_central( Regions : : : I1, I2, I3, I4 )void MomentsRegionCentral( const HObject& Regions, HTuple* I1, HTuple* I2, HTuple* I3, HTuple* I4 )static void HOperatorSet.MomentsRegionCentral( HObject regions, out HTuple i1, out HTuple i2, out HTuple i3, out HTuple i4 )def moments_region_central( regions: HObject ) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

def moments_region_central_s( regions: HObject ) -> Tuple[float, float, float, float]Herror moments_region_central( const Hobject Regions, double* I1, double* I2, double* I3, double* I4 )

Herror T_moments_region_central( const Hobject Regions, Htuple* I1, Htuple* I2, Htuple* I3, Htuple* I4 )

HTuple HRegion::MomentsRegionCentral( HTuple* I2, HTuple* I3, HTuple* I4 ) const

double HRegion::MomentsRegionCentral( double* I2, double* I3, double* I4 ) const

HTuple HRegion.MomentsRegionCentral( out HTuple i2, out HTuple i3, out HTuple i4 )

double HRegion.MomentsRegionCentral( out double i2, out double i3, out double i4 )

Description🔗

The operator moments_region_centralMomentsRegionCentral calculates the central moments (I1i1i1, I2i2i2, I3i3i3, I4i4i4).

Calculation: Then the moments \(I_{i}\) are defined by:

\[\begin{eqnarray*} I_{1} &=& \mu_{20}\mu_{02}-{\mu_{11}^2} \\ I_{2} &=& {(\mu_{30}\mu_{03}-\mu_{21}\mu_{12})^2} -4(\mu_{30}\mu_{12}- {\mu_{21}^2})(\mu_{21}\mu_{03}-{\mu_{12}^2}) \\ I_{3} &=& \mu_{20}(\mu_{21}\mu_{03}-{\mu_{12}^2})- \mu_{11}(\mu_{30}\mu_{03}-\mu_{21}\mu_{12}) + \mu_{02}(\mu_{30}\mu_{12}-{\mu_{21}^2}) \\ I_{4} &=& {\mu_{30}^2}{\mu_{02}^3}- 6\mu_{30}\mu_{21}\mu_{11}{\mu_{02}^2}+ 6\mu_{30}\mu_{12}\mu_{02}(2{\mu_{11}^2}-\mu_{20}\mu_{02}) \\ && +\mu_{30}\mu_{03}(6\mu_{20}\mu_{11}\mu_{02}-8{\mu_{11}^3})+ 9{\mu_{21}^2}\mu_{20}{\mu_{02}^2}- 18\mu_{21}\mu_{12}\mu_{20}\mu_{11}\mu_{02} \\ && +6\mu_{21}\mu_{03}\mu_{20}(2{\mu_{11}^2}-\mu_{20}\mu_{02})+ 9{\mu_{12}^2}{\mu_{20}^2}\mu_{02}- 6\mu_{12}\mu_{03}\mu_{11}{\mu_{20}^2}+ {\mu_{03}^2}{\mu_{20}^3} \end{eqnarray*}\]

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_systemSetSystem).

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) → objectobjectHObjectHRegionHObjectHobject

Regions to be examined.

I1i1i1 (output_control) real(-array) → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Moment of 2nd order.

I2i2i2 (output_control) real(-array) → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Moment of 2nd order.

I3i3i3 (output_control) real(-array) → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Moment of 2nd order.

I4i4i4 (output_control) real(-array) → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Moment of 3rd order.

Complexity🔗

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

Result🔗

The operator moments_region_centralMomentsRegionCentral 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

Alternatives

moments_region_2ndMomentsRegion2nd

See also

elliptic_axisEllipticAxis

Module🔗

Foundation