Skip to content

dilation_rectangle1DilationRectangle1DilationRectangle1dilation_rectangle1dilation_rectangle1🔗

説明🔗

dilation_rectangle1DilationRectangle1DilationRectangle1dilation_rectangle1dilation_rectangle1 — 矩形要素を用いて領域を膨張する。

書式🔗

dilation_rectangle1( region Region, out region RegionDilation, extent.x Width, extent.y Height )void DilationRectangle1( const HObject& Region, HObject* RegionDilation, const HTuple& Width, const HTuple& Height )static void HOperatorSet.DilationRectangle1( HObject region, out HObject regionDilation, HTuple width, HTuple height )def dilation_rectangle1( region: HObject, width: int, height: int ) -> HObject

Herror dilation_rectangle1( const Hobject Region, Hobject* RegionDilation, const Hlong Width, const Hlong Height )

Herror T_dilation_rectangle1( const Hobject Region, Hobject* RegionDilation, const Htuple Width, const Htuple Height )

HRegion HRegion::DilationRectangle1( Hlong Width, Hlong Height ) const

HRegion HRegion.DilationRectangle1( int width, int height )

説明🔗

dilation_rectangle1DilationRectangle1 は、矩形要素を用いて入力領域 Regionregionregion を膨張(dilation)します。矩形の大きさは Widthwidthwidth x Heightheightheight で定義されます。つ まりオペレーターは X 方向、Y 方向への領域の膨張をそれぞれ任意のサ イズにて実行することができます。

矩形の高さのみが実行時間に対数的に関係し、幅はまったく関係しないの で、dilation_rectangle1DilationRectangle1 の演算は非常に高速です。非常に大き な矩形(エッジの長さが 100 を超える場合)が対象であっても実行時間 は非常に短くなります。

注意🔗

dilation_rectangle1DilationRectangle1 は、入力領域に対して個別に適用されます。もし、 異なる領域の間のギャップを閉じる必要があれば、union1Union1 また は union2Union2 を最初に呼び出す必要があります。

すべての方向に対して、同じ大きさで領域を拡大するには、 Widthwidthwidth と Heightheightheight は奇数でなければなりません。奇 数でない場合、領域は左または上よりも右または下でより大きく膨張しま す。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • tupleレベルで自動的に並列演算処理を実施

パラメーター🔗

Regionregionregion (input_object) region(-array) → objectHObjectHRegionHObjectHobject

膨張処理(dilation)の対象領域

RegionDilationregionDilationregion_dilation (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

膨張処理(dilation)された領域

Widthwidthwidth (input_control) extent.x → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

矩形構造要素の幅

初期値: 1111
推奨値: 1, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 2011, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 201
値域: 1 ≤ Width ≤ 511 (lin)
最小増分: 1
推奨増分: 10

Heightheightheight (input_control) extent.y → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

矩形構造要素の高さ

初期値: 1111
推奨値: 1, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 2011, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 201
値域: 1 ≤ Height ≤ 511 (lin)
最小増分: 1
推奨増分: 10

例🔗

(C)

threshold(Image,&Light,220.0,255.0)\;
dilation_rectangle1(Light,&Wide,50,50)\;
set_color(WindowHandle,"red")\;
disp_region(Wide,WindowHandle)\;
set_color(WindowHandle,"white")\;
disp_region(Light,WindowHandle)\;
(C++)
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std\;
#endif
#include "HalconCpp.h"

main()
{
  cout << "Reproduction of 'dilation_rectangle ()'" << endl\;
  cout << "First = original image " << endl\;
  cout << "Blue  = after dilation " << endl\;
  cout << "Red   = after segmentation " << endl\;
 HByteImage img("monkey")\;
  HWindow    w\;
 HRegionArray regs   = (img >= 220).Connection()\;
  HRegionArray dilreg = regs.DilationRectangle1 (2, 4)\;
                       img.Display (w)\;      w.Click ()\;
  w.SetColor ("blue")\;  dilreg.Display (w)\;   w.Click ()\;
  w.SetColor ("red")\;   regs.Display (w)\;     w.Click ()\;
 return(0)\;
}

複雑性🔗

入力領域の面積を \(F1\) とし、矩形の高さを \(H\) とします。その場合、 1 つの領域に対する実行時間は以下のようになります。

\[\begin{eqnarray*} O(\sqrt{F1} \cdot ld(H)) \enspace . \end{eqnarray*}\]

結果🔗

dilation_rectangle1DilationRectangle1 は、すべてのパラメーターが正しい場合 に 2 (H_MSG_TRUE) を返します。空または入力領域がない場合の動作は、次の 設定に従います。

  • 領域がない場合: set_system('no_object_result',<RegionResult>)

  • 領域が空の場合: set_system('empty_region_result',<RegionResult>)

そうでない場合、例外処理が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection, union1Union1, watershedsWatersheds, class_ndim_normClassNdimNorm

後処理の候補

reduce_domainReduceDomain, select_shapeSelectShape, area_centerAreaCenter, connectionConnection

他の選択候補

minkowski_add1MinkowskiAdd1, minkowski_add2MinkowskiAdd2, expand_regionExpandRegion, dilation1Dilation1, dilation2Dilation2, dilation_circleDilationCircle

関連項目

gen_rectangle1GenRectangle1, gen_region_polygon_filledGenRegionPolygonFilled

モジュール🔗

Foundation