Skip to content

select_region_spatialSelectRegionSpatialSelectRegionSpatialselect_region_spatialT_select_region_spatial🔗

説明🔗

select_region_spatialSelectRegionSpatialSelectRegionSpatialselect_region_spatialT_select_region_spatial — 隣接関係に基き領域を選択する。

書式🔗

select_region_spatial( region Regions1, region Regions2, string Direction, out integer RegionIndex1, out integer RegionIndex2 )void SelectRegionSpatial( const HObject& Regions1, const HObject& Regions2, const HTuple& Direction, HTuple* RegionIndex1, HTuple* RegionIndex2 )static void HOperatorSet.SelectRegionSpatial( HObject regions1, HObject regions2, HTuple direction, out HTuple regionIndex1, out HTuple regionIndex2 )def select_region_spatial( regions_1: HObject, regions_2: HObject, direction: str ) -> Tuple[Sequence[int], Sequence[int]]

Herror T_select_region_spatial( const Hobject Regions1, const Hobject Regions2, const Htuple Direction, Htuple* RegionIndex1, Htuple* RegionIndex2 )

HTuple HRegion::SelectRegionSpatial( const HRegion& Regions2, const HString& Direction, HTuple* RegionIndex2 ) const

HTuple HRegion::SelectRegionSpatial( const HRegion& Regions2, const char* Direction, HTuple* RegionIndex2 ) const

HTuple HRegion::SelectRegionSpatial( const HRegion& Regions2, const wchar_t* Direction, HTuple* RegionIndex2 ) const (Windows only)

HTuple HRegion.SelectRegionSpatial( HRegion regions2, string direction, out HTuple regionIndex2 )

説明🔗

オペレーター select_region_spatialSelectRegionSpatial は、Regions2regions2regions_2 から、隣接関係 Directiondirectiondirection を満足する領域を選択します。 対象となる領域は Regions1regions1regions_1 または Regions2regions2regions_2 内 にそれぞれ入力する必要があります。Regions1regions1regions_1 は、次の 3 つ の異なる状態をもつことができます。

Directiondirectiondirection に対して可能な値は以下のとおりです。

オペレーター select_region_spatialSelectRegionSpatial は比較されるべき領域の 中心を計算し、方向関係を満たすかどうかを中心線と x 軸との間の角 度によって判断します。 その関係は、座標軸のまわりに-45 度から+45 度の範囲内で判断します。 したがって、方向関係は、第 2 の領域の中心が最初の領域の中心の左 (または 右、上、下) に位置する必要があることから理解されます。 方向関係を満足する領域のインデックスは、RegionIndex1regionIndex1region_index_1 と RegionIndex2regionIndex2region_index_2 内の n 番目に位置します。すなわち、インデッ クス RegionIndex2regionIndex2region_index_2 [n] をもつ領域はインデックス RegionIndex1regionIndex1region_index_1 [n] をもつ領域と設定された関係をもちます。 そのインデックスによる領域へのアクセスは、オペレーター copy_objCopyObj によって与えられます。

実行情報🔗

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

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

  • 並列演算処理には未対応

パラメーター🔗

Regions1regions1regions_1 (input_object) region(-array) → objectHObjectHRegionHObjectHobject

開始領域

Regions2regions2regions_2 (input_object) region(-array) → objectHObjectHRegionHObjectHobject

比較領域

Directiondirectiondirection (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

要求された隣接関係

初期値: 'left'"left"
値のリスト: 'above', 'below', 'left', 'right'"above", "below", "left", "right"

RegionIndex1regionIndex1region_index_1 (output_control) integer-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

入力 Tuple (Regions1regions1regions_1 または Regions2regions2regions_2) のインデックス

RegionIndex2regionIndex2region_index_2 (output_control) integer-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

入力 Tuple (Regions1regions1regions_1 または Regions2regions2regions_2) のインデックス

結果🔗

オペレーター select_region_spatialSelectRegionSpatial は、値 2 (H_MSG_TRUE) を返しま す。条件は、Regions2regions2regions_2 が空でない場合です。パラメーター Regions2regions2regions_2 が空だった場合(入力画像が得られない場合)の動作 は、オペレーター set_system('no_object_result',<Result>) で設定されます。 空の領域の場合(領域が空集合である場合)の動作は、オペレーター set_system('empty_region_result',<Result>) を通して設定さ れます。 必要に応じて、例外が発生します。

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

組み合わせ

前処理の候補

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection

他の選択候補

area_centerAreaCenter, intersectionIntersection

関連項目

spatial_relationSpatialRelation, find_neighborsFindNeighbors, copy_objCopyObj, obj_to_integerObjToInteger

モジュール🔗

Foundation