Skip to content

select_region_spatialSelectRegionSpatialSelectRegionSpatialselect_region_spatialT_select_region_spatialπŸ”—

Short descriptionπŸ”—

select_region_spatialSelectRegionSpatialSelectRegionSpatialselect_region_spatialT_select_region_spatial β€” Pose relation of regions.

SignatureπŸ”—

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 )

DescriptionπŸ”—

The operator select_region_spatialSelectRegionSpatial chooses the regions from Regions2regions2regions_2 which are sufficient for the neighboring relation Directiondirectiondirection. The regions to be examined have to be passed in Regions1regions1regions_1 or
Regions2regions2regions_2, respectively. Regions1regions1regions_1 can have three different states:

Possible values for Directiondirectiondirection are:

The operator select_region_spatialSelectRegionSpatial calculates the centers of the regions to be compared and decides according to the angle between the center straight lines and the x axis whether the direction relation is fulfilled. The relation is fulfilled within the area of -45 degree to +45 degree around the coordinate axes. Thus, the direction relation can be understood in such a way that the center of the second region must be located left (orΒ right, above, below) of the center of the first region. The indices of the regions fulfilling the direction relation are located at the n-th position in RegionIndex1regionIndex1region_index_1 and RegionIndex2regionIndex2region_index_2, i.e., the region with the index RegionIndex2regionIndex2region_index_2[n] has the indicated relation with the region with the index RegionIndex1regionIndex1region_index_1[n]. Access to regions via the index can be obtained via the operator copy_objCopyObj.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

Regions1regions1regions_1 (input_object) region(-array) β†’ objectHObjectHRegionHObjectHobject

Starting regions

Regions2regions2regions_2 (input_object) region(-array) β†’ objectHObjectHRegionHObjectHobject

Comparative regions

Directiondirectiondirection (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Desired neighboring relation.

Default: 'left'"left"
List of values: '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)

Indices in the input tuples (Regions1regions1regions_1 or
Regions2regions2regions_2), respectively.

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

Indices in the input tuples (Regions1regions1regions_1 or
Regions2regions2regions_2), respectively.

ResultπŸ”—

The operator select_region_spatialSelectRegionSpatial returns the value 2 (H_MSG_TRUE) if Regions2regions2regions_2 is not empty. The behavior in case of empty parameter Regions2regions2regions_2 (no input regions available) is set via the operator set_system('no_object_result',<Result>). The behavior in case of empty region (the region is the empty set) is set via set_system('empty_region_result',<Result>). If necessary an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection

Alternatives

area_centerAreaCenter, intersectionIntersection

See also

spatial_relationSpatialRelation, find_neighborsFindNeighbors, copy_objCopyObj, obj_to_integerObjToInteger

ModuleπŸ”—

Foundation