runlength_featuresrunlength_featuresRunlengthFeaturesRunlengthFeaturesrunlength_features (算子名称)

名称

runlength_featuresrunlength_featuresRunlengthFeaturesRunlengthFeaturesrunlength_features — Characteristic values for runlength coding of regions.

参数签名

runlength_features(区域 : : : NumRuns, KFactor, LFactor, MeanLength, Bytes)

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

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

void RunlengthFeatures(const HObject& 区域, 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

static void HOperatorSet.RunlengthFeatures(HObject 区域, 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)

def runlength_features(区域: HObject) -> Tuple[Sequence[int], Sequence[float], Sequence[float], Sequence[float], Sequence[int]]

def runlength_features_s(区域: HObject) -> Tuple[int, float, float, float, int]

描述

The operator runlength_featuresrunlength_featuresRunlengthFeaturesRunlengthFeaturesRunlengthFeaturesrunlength_features calculates for every input region from 区域区域区域区域区域区域 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.

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

注意

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

运行信息

参数表

区域区域区域区域区域区域 (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Regions to be examined.

NumRunsNumRunsNumRunsNumRunsnumRunsnum_runs (output_control)  integer(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of runs.

Assertion: 0 <= NumRuns

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

Storing factor in relation to a square.

Assertion: 0 <= KFactor

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

Mean number of runs per line.

Assertion: 0 <= LFactor

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

Mean length of runs.

Assertion: 0 <= MeanLength

BytesBytesBytesBytesbytesbytes (output_control)  integer(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of bytes necessary for coding the region.

Assertion: 0 <= Bytes

Complexity

The mean runtime complexity is O(1).

结果

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

可能的前置算子

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection

参考其它

runlength_distributionrunlength_distributionRunlengthDistributionRunlengthDistributionRunlengthDistributionrunlength_distribution

模块

Foundation