English (English)

Search area

A search area is defined by a set of search constraints and relations. It tells the program where to look for the objects described by the elements.

Search areas are made up of one or more rectangles which need not have common boundaries, i.e. search areas may be discontinuous.

A search area may be defined by absolute search constraints, i.e. by coordinates, or by relative search constraints, i.e. by relations to other elements. When specifying relative search constraints, you can use any elements located above the described element in the FlexiLayout tree (the image object corresponding to this element can only be found by using information about the already found objects described by the elements higher up in the tree).

Specifying the absolute coordinates of a search area

An absolute search area is defined on the Search Constraints tab of the element's Properties dialog box.

For multi-page documents, you can select a range of pages on which to search for an element. You can specify the absolute local coordinates of a search area in the Region property.

Excluding an element from the search area

The Exclude regions of elements property allows you to exclude from the search area the region of the found hypothesis for an element. If no hypothesis of the excluded element is found, this constraint will not affect the search area of the element.

Note.An exception to this are cases where the user has specified additional constraints for some of the boundaries of the hypothesis for the excluded element in the Advanced pre-search relations pane. In this case, if the program fails to find the excluded element, it will cut out the rectangular search area of this element from the surrounding search area. See the Fuzzy rectangle section for details about internal rectangles.

Recognition of vertical text

For the Currency, Date, Phone, Character String, Static Text, Paragraph elements, a Search through vertical text option is available, which allows for recognition of both horizontally- and vertically-oriented text. The Clockwise oriented and Counterclockwise oriented options enable and disable the recognition of vertical text from top to bottom and from bottom to top respectively. These are enabled by default and can be disabled only when Search through vertical text is selected.

Specifying a search area relative to another element

A relative search area is defined on the Relations tab of the element's Properties dialog box. To define a relative search area, specify a reference element relative to which the boundaries will be defined and specify the relations of types "right of", "left of", "above", and "below" (the Relations property). You can specify any number of search areas for any element. The boundaries of a search area may specified relative to different reference elements. If no relative search area has been specified, the program will look for the object everywhere on the image. Each of the search constraints specifies a half-plane. The intersection of the half-plane and the image produces a rectangular part of the search area. The intersection of all the search constraints with the image produces the search area of an element.

The boundaries of a search area can be specified more accurately by means of the Element boundary and Offset properties.

The Element boundary property specifies a boundary of a search area relative to the top, bottom, left or right boundary of an element. By default, this property is set to <whole>.

When calculating a relative search area, the program may fail to find the reference element specified in the Reference element property. Lets us consider how the program calculates a relative search area both when the relative element has been found and when the relative element has not been found. If the reference element is optional and there are no objects on the image meeting the conditions specified in the element, the program will formulate a null hypothesis. The region of the null hypothesis for the reference element will coincide with the rectangle enclosing the search area of the element. If the reference element has been found, the region of the hypothesis will be built from the regions of the detected objects participating in the hypothesis and will be located inside the search area of the element.

If the reference element has been found, and the Element boundary is set to <whole>, a Right of constraint will mean "to the right of the right boundary of the reference element", a Left of constraint will mean "to the left of the left boundary of the reference element", etc. (i.e. To the right of, to the left of, below or above the hypothesis). If no hypothesis for the reference element has been formulated, this means that it could be located anywhere in the search area of the reference element (but could not be located outside the search area). Thus, a Right of constraint, when applied to a non-found hypothesis, means "to the right of any area where the hypotheses for the reference element could be located". Mathematically, this means "to the right of the left boundary of the search area of the reference element". Similarly, a Left of constraint, when applied to a non-found hypothesis, will mean "to the left of the right boundary of the search area of the reference element", a Below constraint will mean "below the top boundary of the search area of the reference element", and an Above constraint will mean "above the bottom boundary of the search area of the reference element".

If the Element boundary property is set to one of the specific values - "Left", " Top", "Right" or "Bottom" - the search area will be calculated relative to the specified boundary of the hypothesis for the reference element, no matter whether the hypothesis has been found or not. For example, in the case of a non-found hypothesis a Right of constraint coupled with the Element boundary set to "Right" will mean "to the right of the right boundary of the search area of the reference element".

The Offset property shifts a boundary of the search area by a certain distance. A positive Offset value means that that the boundary will be moved in the same direction as specified in the Relation property. A negative Offset value moves the boundary in the direction opposite to the direction specified in the Relation property.

E.g.

A FlexiLayout contains a YourPlanetName element of type Static Text which enables the program to find the YOUR PLANET NAME: field name on the image. We need to find text entered by the user in this field (in this case "MARS (satellite Phobos)"). Create a Planet element of type Character String and specify a search area located to the right of the Planet element, i.e. set the Element boundary property to Right of. The location of the search area is shown in the figure below:

Move the boundary of the search area to the right, i.e. in the same direction as specified in the Right of relation. To do this, select a positive Offset value, e.g. 200. The new location of the boundary is shown in the figure below:

Now move the boundary of the search area to the left, i.e. in the direction opposite the direction specified in the Rightof relation. To do this, select a negative Offset value, e.g. -200. he new location of the boundary is shown in the figure below:

Selecting the element located closest to a certain object

The Nearest property tells the program that, all other things being equal, it must look for a hypothesis located closest to certain element or point on the image. Specify the closest element, point, or coordinate axis in the Nearest property of the element.

Viewing a search area

When editing relation properties or selecting a relation in the Relations table, the relation is visualized in the image window. When selecting several relations, the intersection of the selected relations is displayed. In the Reference layout mode you can also drag the offset boundary with the mouse directly in the image window to change the offset value.

When matching a FlexiLayout, the program first calculates the search area of the element by using all of the specified constraints. Next, the program checks if the image objects located in the search area have the same properties as the elements. If a wrong object has been found as a result of matching the FlexiLayout, you can find out why this happened by looking at the search area of the element.

To display the search area of an element after matching a FlexiLayout, right-click the hypothesis corresponding to the element and select the Show Search Area command from the shortcut menu. The search area will be displayed in the Image window.

More:

Specifying the absolute search area

Specifying the search area relative to another element

Using instances of a Repeating Group as reference or excluded elements

Additional search constraints

12.04.2024 18:16:02

Please leave your feedback about this article

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.