direction1 ( Regions1, Regions2 : : Percent : RegionIndex1, RegionIndex2, Relation1, Relation2 )

Pose relation of regions with regard to the coordinate axes.

The operator direction1 selects regions located by Percent percent "left", "right", "above" or "below" other regions. Regions1 and Regions2 contain the regions to be compared. Regions1 can have three states:

- Regions1 is empty:
    In this case all regions in Regions2
    are permutatively checked for neighbourhood.
- Regions1 consists of one region:
    The regions of Regions1 are compared to all regions 
    in Regions2.
- Regions1 consists of the same number of regions as
  Regions2:
    In this case all regions in the n-th position in
    Regions1 and Regions2 are checked
    for a neighbouring relation.

The percentage Percent is interpreted in such a way that the area of the second region has to be located really left/right or above/below the region margins of the first region by at least Percent percent. The indices of the regions that fulfill at least one of these conditions are then located at the n-th position in the output parameters RegionIndex1 and RegionIndex2. Additionally the output parameters Relation1 and Relation2 contain at the n-th position the type of relation of the region pair (RegionIndex1[n], RegionIndex2[n]), i.e. region with index RegionIndex2[n] has the relation Relation1[n] and Relation2[n] with region with index RegionIndex1[n].

Possible values for Relation1 and Relation2 are:

       Relation1: 'left', 'right' or ''
       Relation2: 'above', 'below' or ''

In RegionIndex1 and RegionIndex2 the indices of the regions in the tuples of the input regions (Regions1 or Regions2), respectively, are entered as image identifiers. Access to chosen regions via the index can be obtained by the operator copy_obj.


Parameters

Regions1 (input_object)
region(-array) -> object
Starting regions

Regions2 (input_object)
region(-array) -> object
Comparative regions

Percent (input_control)
integer -> integer
Percentage of the area of the comparative region which must be located left/right or above/below the region margins of the starting region.
Default value: 50
Suggested values: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
Range of values: 0 <= Percent <= 100 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: (0 <= Percent) && (Percent <= 100)

RegionIndex1 (output_control)
integer-array -> integer
Indices of the regions in the tuple of the input regions which fulfill the pose relation.

RegionIndex2 (output_control)
integer-array -> integer
Indices of the regions in the tuple of the input regions which fulfill the pose relation.

Relation1 (output_control)
string-array -> string
Horizontal pose relation in which RegionIndex2[n] stands with RegionIndex1[n].

Relation2 (output_control)
string-array -> string
Vertical pose relation in which RegionIndex2[n] stands with RegionIndex1[n].


Result

The operator direction1 returns the value TRUE if Regions2 is not empty and Percent is correctly choosen. 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.


Possible Predecessors

threshold__, regiongrowing__, connection


Alternatives

area_center, intersection


See also

direction2, neighbour, copy_obj, obj_to_integer



Copyright © 1996-1997 MVTec Software GmbH