select_region_spatial — Pose relation of regions.
The operator select_region_spatial chooses the regions from Regions2 which are sufficient for the neighboring relation Direction. The regions to be examined have to be passed in Regions1 or Regions2, respectively. Regions1 can have three different states:
Possible values for Direction are:
Regions2 is left of Regions1
Regions2 is right of Regions1
Regions2 is above Regions1
Regions2 is below Regions1
The operator select_region_spatial 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 RegionIndex1 and RegionIndex2, i.e., the region with the index RegionIndex2[n] has the indicated relation with the region with the index RegionIndex1[n]. Access to regions via the index can be obtained via the operator copy_obj.
Desired neighboring relation.
Default value: 'left'
List of values: 'left', 'right', 'above', 'below'
The operator select_region_spatial returns the value 2 (H_MSG_TRUE) if Regions2 is not empty. The behavior in case of empty parameter Regions2 (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.
threshold, regiongrowing, connection
spatial_relation, find_neighbors, copy_obj, obj_to_integer