English (English)

Search constraints

The search area constraints are set on the Search Constraints and the Relations tabs in the Properties dialog box, and in the Advanced pre-search relations section. Before the constraints have been applied, the search area coincides with the rectangle of the page. First, the program applies the constraints set on the Search Constraints and the Relations tabs. Next, the program applies the additional constraints set in the Advanced pre-search relations section.

The following types of constraint can be set in the Advanced pre-search relations section:

1. The search area can be limited to a rectangle (Rect variable), to a region (i.e. a continuous array of rectangles – Region variable), or to an array of rectangles which, in the general case, need not be continuous (RectArray variable). This type of constraint is set using the RestrictSearchArea function and by specifying a parameter of the corresponding type.
Any expressions which return values of the required type can be specified as parameters.
2. The search area can be limited to a half-plane located to the left of, to the right of, above, or below a particular point. Such constraints are set using the Leftof, Rightof, Above, and Below functions.
3. Sometimes you may wish to set constraints for an element boundary. For example, it may be known beforehand that the left boundary of an element is always located in the left-hand part of the image, whereas the right boundary may stretch indefinitely to the right.
The FlexiLayout language allows you to set such constraints at the stage of calculating the search area, thereby narrowing the range of possible hypotheses for an element. Such constraints are set using the LeftBound, RightBound, topBound, and BottomBound functions and the operators ">" and "<". The LeftBound and RightBound functions are used to access the left and right boundaries of the search area, and the topBound and BottomBound functions are used to access the top and bottom boundaries respectively.
4. You can set search constraints by excluding a rectangle, an array of rectangles, a hypothesis etc. from the search area. This can be done by using the Exclude, ExcludeRect, and ExcludeSet functions.

You can specify any number of search constraints of the above types in the Advanced pre-search relations section. Each constraint will create a region on the image. All the regions created by the constraints will be intersected.

Additionally, the calculated search area for the element will be intersected with the search area for the Group element of which this element is a member.

12.04.2024 18:16:02