Skip to content

spatial_relationSpatialRelationSpatialRelationspatial_relationT_spatial_relation🔗

説明🔗

spatial_relationSpatialRelationSpatialRelationspatial_relationT_spatial_relation — 座標軸に対する領域の相対位置を求める。

書式🔗

spatial_relation( region Regions1, region Regions2, integer Percent, out integer RegionIndex1, out integer RegionIndex2, out string Relation1, out string Relation2 )void SpatialRelation( const HObject& Regions1, const HObject& Regions2, const HTuple& Percent, HTuple* RegionIndex1, HTuple* RegionIndex2, HTuple* Relation1, HTuple* Relation2 )static void HOperatorSet.SpatialRelation( HObject regions1, HObject regions2, HTuple percent, out HTuple regionIndex1, out HTuple regionIndex2, out HTuple relation1, out HTuple relation2 )def spatial_relation( regions_1: HObject, regions_2: HObject, percent: int ) -> Tuple[Sequence[int], Sequence[int], Sequence[str], Sequence[str]]

Herror T_spatial_relation( const Hobject Regions1, const Hobject Regions2, const Htuple Percent, Htuple* RegionIndex1, Htuple* RegionIndex2, Htuple* Relation1, Htuple* Relation2 )

HTuple HRegion::SpatialRelation( const HRegion& Regions2, Hlong Percent, HTuple* RegionIndex2, HTuple* Relation1, HTuple* Relation2 ) const

HTuple HRegion.SpatialRelation( HRegion regions2, int percent, out HTuple regionIndex2, out HTuple relation1, out HTuple relation2 )

説明🔗

オペレーター spatial_relationSpatialRelation は、他の領域の “left”、`` right’‘、“above”、または “below”に Percentpercentpercent パーセント で位置する領域を選択します。Regions1regions1regions_1 と Regions2regions2regions_2 は、比較される領域を含みます。Regions1regions1regions_1 は、3 つの状態を持つことができます。

パーセンテージ Percentpercentpercent i は、第 2 の領域の面積が少なくと も最初の領域の輪郭から Percentpercentpercent パーセント左/右か 上/下に 位置しなければならないという条件設定に適用されます。 少なくともこれらの条件のうちの 1 つを満たす領域のインデックスが、 出力パラメーター RegionIndex1regionIndex1region_index_1 と RegionIndex2regionIndex2region_index_2 の n 番目に位置します。 さらに、出力パラメーター Relation1relation1relation_1 と Relation2relation2relation_2 は領域のペア (RegionIndex1regionIndex1region_index_1[n], RegionIndex2regionIndex2region_index_2[n]) の関係のタイプを n 番目の位置に含みます。すなわち、インデックス RegionIndex2regionIndex2region_index_2[n] を持つ領域は RegionIndex1regionIndex1region_index_1[n] を 持つ領域と Relation1relation1relation_1[n] と Relation2relation2relation_2[n] という関 係をもっています。

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

RegionIndex1regionIndex1region_index_1 と RegionIndex2regionIndex2region_index_2 で、入力領域 ( Regions1regions1regions_1 または Regions2regions2regions_2) の tuple 内の領域のイ ンデックスは、画像識別子としてそれぞれ入力されます。 そのインデックスを通して選ばれた領域へのアクセスは、オペレーター copy_objCopyObj によって行われます。

実行情報🔗

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

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

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

パラメーター🔗

Regions1regions1regions_1 (input_object) region(-array) → objectHObjectHRegionHObjectHobject

開始領域

Regions2regions2regions_2 (input_object) region(-array) → objectHObjectHRegionHObjectHobject

比較領域

Percentpercentpercent (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

開始領域の輪郭から左/右あるいは 上/下に位置しなけれ ばならない比較領域の面積の割合

初期値: 5050
推奨値: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 1000, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
値域: 0 ≤ Percent ≤ 100 (lin)
最小増分: 1
推奨増分: 10

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

姿勢関係を満たす入力領域の Tuple 内の領域の インデックス

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

姿勢関係を満たす入力領域の Tuple 内の領域の インデックス

Relation1relation1relation_1 (output_control) string-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

RegionIndex2regionIndex2region_index_2[n] が RegionIndex1regionIndex1region_index_1[n] で成り立つ垂直な姿勢関係

Relation2relation2relation_2 (output_control) string-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

RegionIndex2regionIndex2region_index_2[n] が RegionIndex1regionIndex1region_index_1[n] で成り立つ水平な姿勢関係

結果🔗

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

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

組み合わせ

前処理の候補

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection

他の選択候補

area_centerAreaCenter, intersectionIntersection

関連項目

select_region_spatialSelectRegionSpatial, find_neighborsFindNeighbors, copy_objCopyObj, obj_to_integerObjToInteger

モジュール🔗

Foundation