runlength_featuresRunlengthFeaturesRunlengthFeaturesrunlength_featuresrunlength_features
説明
runlength_featuresRunlengthFeaturesRunlengthFeaturesrunlength_featuresrunlength_features — 領域のランレングスコードのための特性値。
書式
runlength_features( region Regions, out integer NumRuns, out real KFactor, out real LFactor, out real MeanLength, out integer Bytes )void RunlengthFeatures( const HObject& Regions, HTuple* NumRuns, HTuple* KFactor, HTuple* LFactor, HTuple* MeanLength, HTuple* Bytes )static void HOperatorSet.RunlengthFeatures( HObject regions, out HTuple numRuns, out HTuple KFactor, out HTuple LFactor, out HTuple meanLength, out HTuple bytes )def runlength_features( regions: HObject ) -> Tuple[Sequence[int], Sequence[float], Sequence[float], Sequence[float], Sequence[int]]
def runlength_features_s( regions: HObject ) -> Tuple[int, float, float, float, int]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 )
HTuple HRegion::RunlengthFeatures( HTuple* KFactor, HTuple* LFactor, HTuple* MeanLength, HTuple* Bytes ) const
Hlong HRegion::RunlengthFeatures( double* KFactor, double* LFactor, double* MeanLength, Hlong* Bytes ) const
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 )
説明
オペレーター runlength_featuresRunlengthFeatures は、Regionsregionsregions
の入力領域すべてに対して、ランレングスコーディングに基づき、領域
を保存するために必要なランの数を計算します。
さらに、いわゆる “K-factor” が決定されます。これはランの数が理想
的な正方 (この場合 1.0 となる) からどのくらい異なるのかを示しま す。
K-factor (KFactorKFactorkfactor) は、次に示す公式にしたがって計算されま す。
\[\begin{eqnarray*} \textrm{KFactor} = \frac{\textrm{NumRuns}}{\sqrt{Area}} \end{eqnarray*}\]
ここで、\(Area\) は領域の面積を示しています。
(水平に長い領域の場合) K-factor は 1.0 よりも小さいことに注意すべ
きです。
L-factor (LFactorLFactorlfactor) は、領域内に生じる各ラインインデックス
に対して、ランの平均数を示しています。
MeanLengthmeanLengthmean_length は、ランの平均長さを示します。
パラメーター Bytesbytesbytes は、ランレングスで領域をコード化するの
にどれくらいのバイト数が必要なのかを示します。
注意
オペレーター runlength_featuresRunlengthFeatures によって計算されたすべての
特徴は回転不変ではありません。これは、ランレングスコーディングが方
向に依存するためです。
オペレーター runlength_featuresRunlengthFeatures は、形状特徴の計算はしませ
んが、ランレングスコーディングの効率を制御および分析します。
実行情報
実行情報
パラメーター
Regionsregionsregions (input_object) region(-array) → objectHObjectHRegionHObjectHobject
対象となる領域
NumRunsnumRunsnum_runs (output_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)
ランの数
制限: 0 <= NumRuns
KFactorKFactorkfactor (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
square に関する要素の保存
制限: 0 <= KFactor
LFactorLFactorlfactor (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
ラインごとのランの平均数
制限: 0 <= LFactor
MeanLengthmeanLengthmean_length (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
ランの平均長さ
制限: 0 <= MeanLength
Bytesbytesbytes (output_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)
領域をコード化するために必要なバイト数
制限: 0 <= Bytes
複雑性
平均実行時間は \(O(1)\) です。
結果
入力が空でない場合、オペレーター runlength_featuresRunlengthFeatures は、
値 2 (H_MSG_TRUE) を返します。
必要に応じて、例外が発生します。
他のオペレーターとの組み合わせ
組み合わせ
前処理の候補
thresholdThreshold, regiongrowingRegiongrowing, connectionConnection
関連項目
runlength_distributionRunlengthDistribution
モジュール
Foundation