closing🔗
説明🔗
closing — 領域に対してクロージング処理を実行する。
書式🔗
closing( region Region, region StructElement, out region RegionClosing )
説明🔗
closing 演算は、膨張処理後にMinkowski 差を実行します。
closing を領域に適用することによって、隣接する領域間の小さ
なギャップと StructElement より小さい穴が閉じられ、より大
きい構造はそのまま残ります。また、領域の境界がなめらかになります。
すべての closing 変量は、分離した領域が結合されずに別のオ
ブジェクトとして残る特性をもちます。closing 演算が参照点の選択に関
して不変なので、StructElement の位置は意味がありませ
ん。
構造要素(StructElement)は、gen_circle、
gen_rectangle1、gen_rectangle2、
gen_ellipse、draw_region、
gen_region_polygon、gen_region_points などのオペ
レーターを使用して生成できます。
注意🔗
closing は、入力領域個別に適用されます。もし、異なる領域の
間のギャップを閉じる必要があれば、union1 または
union2 を最初に呼び出す必要があります。
実行情報🔗
実行情報
-
マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)
-
マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)
パラメーター🔗
Region (input_object) region(-array) → object
クロージング処理を適用する対象領域
StructElement (input_object) region → object
構造要素(位置不変量)
RegionClosing (output_object) region(-array) → object
結果として得られる領域
例🔗
(C)
my_closing(Hobject In, Hobject StructElement, Hobject *Out)
{
Hobject tmp\;
dilation1(In,StructElement,&tmp,1)\;
minkowski_sub1(tmp,StructElement,Out,1)\;
}
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std\;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'closing ()' using " << endl\;
cout << "'dilation()' and 'minkowski_sub1()'" << endl\;
HByteImage img("monkey")\;
HWindow w\;
HRegion circ = HRegion::GenCircle (10, 10, 1.5)\;
HRegionArray regs = (img >= 128).Connection()\;
HRegionArray dilreg = regs.Dilation1 (circ, 1)\;
HRegionArray minsub = dilreg.MinkowskiSub1 (circ, 1)\;
img.Display (w)\; w.Click ()\;
w.SetColor ("red")\; regs.Display (w)\; w.Click ()\;
w.SetColor ("green")\; dilreg.Display (w)\; w.Click ()\;
w.SetColor ("blue")\; minsub.Display (w)\; w.Click ()\;
return(0)\;
}
複雑性🔗
入力領域の面積を \(F1\) とし、構造要素の面積を \(F2\) とします。 その場合、1 つの領域に対する実行時間は以下のようになります。
結果🔗
closing は、すべてのパラメーターが正しい場合に 2 (H_MSG_TRUE) を返し
ます。空または入力領域がない場合の動作は、次の設定に従います。
-
領域がない場合:
set_system('no_object_result',<RegionResult>) -
領域が空の場合:
set_system('empty_region_result',<RegionResult>)
そうでない場合、例外処理が発生します。
他のオペレーターとの組み合わせ🔗
組み合わせ
前処理の候補
threshold, regiongrowing, connection, union1, watersheds, class_ndim_norm, gen_circle, gen_ellipse, gen_rectangle1, gen_rectangle2, draw_region, gen_region_points, gen_region_polygon_filled
後処理の候補
reduce_domain, select_shape, area_center, connection
他の選択候補
関連項目
モジュール🔗
Foundation