bottom_hat🔗
説明🔗
bottom_hat — 領域のボトムハットを計算する。
書式🔗
bottom_hat( region Region, region StructElement, out region RegionBottomHat )
説明🔗
bottom_hat は、StructElement を含む
Region の closing を計算します。closing 領域と元
の領域との差がボトムハットと呼ばれます。ある条件で領域を結合す
る closingと異なり、bottom_hatはそのような結合に
よって生成される領域を計算します。
closing 演算が参照点の選択に関して不変であるので、
StructElement の位置は意味がありません。
構造要素(StructElement)は、gen_circle、
gen_rectangle1、gen_rectangle2、
gen_ellipse、draw_region、
gen_region_polygon、 gen_region_points などのオペ
レーターを使用して生成できます。
実行情報🔗
実行情報
-
マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)
-
マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)
パラメーター🔗
Region (input_object) region(-array) → object
処理される領域
StructElement (input_object) region → object
構造要素(位置には独立)
RegionBottomHat (output_object) region(-array) → object
ボトムハットオペレーターの結果
例🔗
(HDevelop)
read_image (Image, 'brake_disk/brake_disk_bike_01')
threshold (Image, Regions, 128, 255)
gen_circle (Circle, 40, 40, 20)
bottom_hat (Regions, Circle, RegionBottomHat)
(C)threshold(Image,&Regions,128.0,255.0)\;
gen_circle(&Circle,100.0,100.0,16.0)\;
bottom_hat(Regions,Circle,&RegionBottomHat)\;
threshold(Image,&Regions,128.0,255.0)\;
gen_circle(&Circle,128.0,128.0,16.0)\;
bottom_hat(Regions,Circle,&RegionBottomHat)\;
set_color(WindowHandle,"red")\;
disp_region(Regions,WindowHandle)\;
set_color(WindowHandle,"green")\;
disp_region(RegionBottomHat,WindowHandle)\;
#include "HalconCpp.h"
main()
{
HByteImage Monkey("monkey")\;
HWindow w\;
HRegion regs = (Monkey >= 128)\;
HRegion circ = HRegion::GenCircle (128, 128, 3)\;
HRegion rbht = regs.BottomHat (circ)\;
Monkey.Display (w)\; w.Click ()\;
w.SetColor ("red")\; regs.Display (w)\; w.Click ()\;
w.SetColor ("green")\; rbht.Display (w)\; w.Click ()\;
return(0)\;
}
結果🔗
bottom_hat は、すべてのパラメーターが正しい場合に 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