shape_histo_all🔗
説明🔗
shape_histo_all — すべてのしきい値に沿って特徴量のヒストグラムを定義する。
書式🔗
shape_histo_all( region Region, image Image, string Feature, out histogram AbsoluteHisto, out histogram RelativeHisto )
説明🔗
オペレーター shape_histo_allは、Image のグレイ値
をもつ Region 内で、0から255 のしきい値演算を実行します。ヒス
トグラムの中の要素 \(i\) は、しきい値 \(i\) で分割された画像の連結成分
またはホールの数 (Feature =
'connected_components', 'holes') あるいは、この
方法で分割された領域の特徴の平均値 (Feature =
'convexity', 'compactness',
'anisometry') に対応します。
注意🔗
オペレーター shape_histo_all は、入力として 1 つの領域と正
確に一つのグレイ値画像予想します。shape_histo_all の実行時
間が長くなる場合があります。
オペレータshape_histo_allは与えられたRegionのみを考慮し、
入力画像Imageよりも前に設定されたドメインを無視することに注意してください。
実行情報🔗
実行情報
-
マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)
-
マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)
-
並列演算処理には未対応
パラメーター🔗
Region (input_object) region → object
特徴検査領域
Image (input_object) singlechannelimage → object (byte)
グレイ値画像
Feature (input_control) string → (string)
調査する特徴
初期値: 'connected_components'
値のリスト: 'anisometry', 'compactness', 'connected_components', 'convexity', 'holes'
AbsoluteHisto (output_control) histogram-array → (real / integer)
特徴の絶対分布
RelativeHisto (output_control) histogram-array → (real)
特徴の相対的分布
例🔗
(HDevelop)
* Simulation of shape_histo_all with feature 'connected_components':
* my_shape_histo_all(Region,Image,AbsHisto,RelHisto):
reduce_domain(Region,Image,RegionGray)
for i := 0 to 255 by 1
threshold(RegionGray,Seg,i,255)
connect_and_holes (Seg, NumConnected, _)
AbsHisto[i] := NumConnected
endfor
Sum := 0
for i := 0 to 255 by 1
Sum := Sum+AbsHisto[i]
endfor
for i := 0 to 255 by 1
RelHisto[i] := AbsHisto[i]/Sum
endfor
(C)/* Simulation of shape_histo_all with feature 'connected_components': */
my_shape_histo_all(Hobject Region,Hobject Image,
Hlong AbsHisto[], double RelHisto[])
{
Hlong i,sum\;
Hobject RegionGray,Seg\;
reduce_domain(Region,Image,&RegionGray)\;
for (i=0\; i<256\; i++) {
threshold(RegionGray,&Seg,(double)i,255.0)\;
connect_and_holes(Seg,&AbsHisto[i],NULL)\;
}
for (i=0\; i<256\; i++)
sum += AbsHisto[i]\;
for (i=0\; i<256\; i++)
RelHist[i] = (double)AbsHisto[i]/Sum\;
}
複雑性🔗
\(F\) を入力領域の面積、\(N\) を連結要素の平均数であるとすると、実行時 間は \(O(255 (F + \sqrt{F} \sqrt{N}))\) となります。
結果🔗
定義されたグレイ値をもつ画像が入力されるならば、オペレーター
shape_histo_all は、値 2 (H_MSG_TRUE) を返します。入力が空の場合(入
力画像が得られない場合)の動作は、オペレーター
set_system(::'no_object_result',<Result>:) によって設定さ
れます。領域が空の場合の動作は、オペレーター
set_system(::'empty_region_result',<Result>:) によって設定
されます。
必要に応じて、例外が発生します。
他のオペレーターとの組み合わせ🔗
組み合わせ
後処理の候補
histo_to_thresh, threshold, gen_region_histo
他の選択候補
関連項目
compactness, connection, connect_and_holes, convexity, count_obj, entropy_gray, gray_histo
モジュール🔗
Foundation