ClassesClassesClassesClasses | | | | Operators

runlength_featuresrunlength_featuresRunlengthFeaturesrunlength_featuresRunlengthFeaturesRunlengthFeatures (Operator)

Name

runlength_featuresrunlength_featuresRunlengthFeaturesrunlength_featuresRunlengthFeaturesRunlengthFeatures — Characteristic values for runlength coding of regions.

Signature

runlength_features(Regions : : : NumRuns, KFactor, LFactor, MeanLength, Bytes)

Herror runlength_features(const Hobject Regions, Hlong* NumRuns, double* KFactor, double* LFactor, double* MeanLength, Hlong* Bytes)

Herror T_runlength_features(const Hobject Regions, Htuple* NumRuns, Htuple* KFactor, Htuple* LFactor, Htuple* MeanLength, Htuple* Bytes)

Herror runlength_features(Hobject Regions, Hlong* NumRuns, double* KFactor, double* LFactor, double* MeanLength, Hlong* Bytes)

Herror runlength_features(Hobject Regions, HTuple* NumRuns, HTuple* KFactor, HTuple* LFactor, HTuple* MeanLength, HTuple* Bytes)

Hlong HRegion::RunlengthFeatures(double* KFactor, double* LFactor, double* MeanLength, Hlong* Bytes) const

HTuple HRegionArray::RunlengthFeatures(HTuple* KFactor, HTuple* LFactor, HTuple* MeanLength, HTuple* Bytes) const

void RunlengthFeatures(const HObject& Regions, HTuple* NumRuns, HTuple* KFactor, HTuple* LFactor, HTuple* MeanLength, HTuple* Bytes)

HTuple HRegion::RunlengthFeatures(HTuple* KFactor, HTuple* LFactor, HTuple* MeanLength, HTuple* Bytes) const

Hlong HRegion::RunlengthFeatures(double* KFactor, double* LFactor, double* MeanLength, Hlong* Bytes) const

void HOperatorSetX.RunlengthFeatures(
[in] IHUntypedObjectX* Regions, [out] VARIANT* NumRuns, [out] VARIANT* KFactor, [out] VARIANT* LFactor, [out] VARIANT* MeanLength, [out] VARIANT* Bytes)

VARIANT HRegionX.RunlengthFeatures(
[out] VARIANT* KFactor, [out] VARIANT* LFactor, [out] VARIANT* MeanLength, [out] VARIANT* Bytes)

static void HOperatorSet.RunlengthFeatures(HObject regions, out HTuple numRuns, out HTuple KFactor, out HTuple LFactor, out HTuple meanLength, out HTuple bytes)

HTuple HRegion.RunlengthFeatures(out HTuple KFactor, out HTuple LFactor, out HTuple meanLength, out HTuple bytes)

int HRegion.RunlengthFeatures(out double KFactor, out double LFactor, out double meanLength, out int bytes)

Description

The operator runlength_featuresrunlength_featuresRunlengthFeaturesrunlength_featuresRunlengthFeaturesRunlengthFeatures calculates for every input region from RegionsRegionsRegionsRegionsRegionsregions the number of runs necessary for storing this region with the aid of runlength coding. Furthermore the so-called “K-factor” is determined, which indicates by how much the number of runs differs from the ideal of the square in which this value is 1.0.

The K-factor (KFactorKFactorKFactorKFactorKFactorKFactor) is calculated according to the formula:

wherein Area indicates the area of the region. It should be noted that the K-factor can be smaller than 1.0 (in case of long horizontal regions).

The L-factor (LFactorLFactorLFactorLFactorLFactorLFactor) indicates the mean number of runs for each line index occurring in the region.

MeanLengthMeanLengthMeanLengthMeanLengthMeanLengthmeanLength indicates the mean length of the runs. The parameter BytesBytesBytesBytesBytesbytes indicates how many bytes are necessary for coding the region with runlengths.

Attention

All features calculated by the operator runlength_featuresrunlength_featuresRunlengthFeaturesrunlength_featuresRunlengthFeaturesRunlengthFeatures are not rotation invariant because the runlength coding depends on the direction. The operator runlength_featuresrunlength_featuresRunlengthFeaturesrunlength_featuresRunlengthFeaturesRunlengthFeatures does not serve for calculating shape features but for controlling and analysing the efficiency of the runlength coding.

Parallelization

Parameters

RegionsRegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Regions to be examined.

NumRunsNumRunsNumRunsNumRunsNumRunsnumRuns (output_control)  integer(-array) HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Number of runs.

Assertion: 0 <= NumRuns

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

Storing factor in relation to a square.

Assertion: 0 <= KFactor

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

Mean number of runs per line.

Assertion: 0 <= LFactor

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

Mean length of runs.

Assertion: 0 <= MeanLength

BytesBytesBytesBytesBytesbytes (output_control)  integer(-array) HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Number of bytes necessary for coding the region.

Assertion: 0 <= Bytes

Complexity

The mean runtime complexity is O(1).

Result

The operator runlength_featuresrunlength_featuresRunlengthFeaturesrunlength_featuresRunlengthFeaturesRunlengthFeatures returns the value 2 (H_MSG_TRUE) if the input is not empty. If necessary an exception is raised.

Possible Predecessors

thresholdthresholdThresholdthresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing, connectionconnectionConnectionconnectionConnectionConnection

See also

runlength_distributionrunlength_distributionRunlengthDistributionrunlength_distributionRunlengthDistributionRunlengthDistribution

Module

Foundation


ClassesClassesClassesClasses | | | | Operators