fast_thresholdFastThresholdFastThresholdfast_thresholdfast_threshold
説明
fast_thresholdFastThresholdFastThresholdfast_thresholdfast_threshold — グローバルなしきい値を使って、画像の高速二値化をする。
書式
fast_threshold( image Image, out region Region, number MinGray, number MaxGray, number MinSize )void FastThreshold( const HObject& Image, HObject* Region, const HTuple& MinGray, const HTuple& MaxGray, const HTuple& MinSize )static void HOperatorSet.FastThreshold( HObject image, out HObject region, HTuple minGray, HTuple maxGray, HTuple minSize )def fast_threshold( image: HObject, min_gray: Union[int, float], max_gray: Union[int, float], min_size: int ) -> HObject
Herror fast_threshold( const Hobject Image, Hobject* Region, double MinGray, double MaxGray, const Hlong MinSize )
Herror T_fast_threshold( const Hobject Image, Hobject* Region, const Htuple MinGray, const Htuple MaxGray, const Htuple MinSize )
HRegion HImage::FastThreshold( const HTuple& MinGray, const HTuple& MaxGray, Hlong MinSize ) const
HRegion HImage::FastThreshold( double MinGray, double MaxGray, Hlong MinSize ) const
HRegion HImage.FastThreshold( HTuple minGray, HTuple maxGray, int minSize )
HRegion HImage.FastThreshold( double minGray, double maxGray, int minSize )
説明
fast_thresholdFastThreshold は、グレイ値 \(g\) が以下に示す条件を満足する
ピクセルを入力画像から選択します。
\[\begin{eqnarray*}
\textrm{MinGray} \le g \le \textrm{MaxGray} \enspace .
\end{eqnarray*}\]
処理時間を短縮するために、しきい値の選択は 2 つのステップで行われます。
最初に、距離 MinSizeminSizemin_size によって特定される水平方向の線上に並ぶ
すべての点が処理されます。
次に、すべての前もって選択された点の近傍(大きさ (2MinSize+1)
x (2MinSize+1))が処理されます。
注意
SSE2をサポートしているマルチコアコンピュータでは、thresholdThresholdは
fast_thresholdFastThresholdよりも高速になる可能性があります。
fast_thresholdFastThresholdは組み込みプラットフォームのように、この機能が使えない
環境においてのみthresholdThresholdより優れているかもしれません。
実行情報
実行情報
パラメーター
Imageimageimage (input_object) singlechannelimage(-array) → object (byte / uint2 / direction / cyclic / real)HObject (byte / uint2 / direction / cyclic / real)HImage (byte / uint2 / direction / cyclic / real)HObject (byte / uint2 / direction / cyclic / real)Hobject (byte / uint2 / direction / cyclic / real)
入力画像
Regionregionregion (output_object) region(-array) → objectHObjectHRegionHObjectHobject *
抽出された結果領域
MinGrayminGraymin_gray (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)
グレイ値に対するしきい値の下限
初期値: 128128
推奨値: 0.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.00.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.0
値域: 0.0 ≤ MinGray ≤ 255.0 (lin)
最小増分: 1
推奨増分: 5.0
MaxGraymaxGraymax_gray (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)
グレイ値に対するしきい値の上限
初期値: 255.0255.0
推奨値: 0.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.00.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.0
値域: 0.0 ≤ MaxGray ≤ 255.0 (lin)
最小増分: 1
推奨増分: 5.0
MinSizeminSizemin_size (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)
抽出されたオブジェクトの最小サイズ
初期値: 2020
推奨値: 5, 10, 15, 20, 25, 30, 40, 50, 60, 70, 1005, 10, 15, 20, 25, 30, 40, 50, 60, 70, 100
値域: 2 ≤ MinSize ≤ 200 (lin)
最小増分: 1
推奨増分: 2
複雑性
出力領域の面積を \(A\)、Imageimageimageの高さを
\(height\) とします。その場合、
実行時間は \(O(A + height / \textrm{MinSize})\) です
結果
fast_thresholdFastThreshold は、すべてのパラメーターが正しい場合に
2 (H_MSG_TRUE) を返します。
入力画像と出力領域に関する動作は、set_systemSetSystem でフラグ
'no_object_result'"no_object_result"、'empty_region_result'"empty_region_result"、およ
び 'store_empty_region'"store_empty_region" の値を設定することによって決定さ
れます。
必要に応じて、例外が発生します。
他のオペレーターとの組み合わせ
組み合わせ
前処理の候補
histo_to_threshHistoToThresh, min_max_grayMinMaxGray, sobel_ampSobelAmp, binomial_filterBinomialFilter, gauss_filterGaussFilter, reduce_domainReduceDomain, fill_interlaceFillInterlace
後処理の候補
connectionConnection, dilation1Dilation1, erosion1Erosion1, openingOpening, closingClosing, rank_regionRankRegion, shape_transShapeTrans, skeletonSkeleton
他の選択候補
thresholdThreshold, gen_grid_regionGenGridRegion, dilation_rectangle1DilationRectangle1, dyn_thresholdDynThreshold
関連項目
class_2dim_supClass2dimSup, hysteresis_thresholdHysteresisThreshold
モジュール
Foundation