Skip to main content
To check that the program can reliably detect the identifier element FormHeader, try matching the FlexiLayout with each image in the batch:
1

Open each image

Open the sample images in the batch one at a time.
2

Match the FlexiLayout with the image

Select the Match command on the FlexiLayout menu or the shortcut menu of the image.
If the image and its FlexiLayout have been matched successfully, the hypothesis that the program formulates about the FormHeader element is marked with Best hypothesis icon in the Tree of Hypotheses. If you click the hypothesis, the program draws a blue frame around the detected element. The properties of the hypothesis appear in the Properties window.
Screenshot of the ABBYY FlexiLayout Studio editor showing a matched recipe document with the FormHeader element drawn around the Easiest Recipes heading and the FormHeader hypothesis selected in the Tree of Hypotheses.
When you try matching the FlexiLayout with the images, you see that on some of the images the program finds a part of the phrase above the document heading instead of the heading itself. The phrase “Enjoy our collection of easiest recipes from over 50 countries of the world” occurs on almost all the images in the batch. To prevent the program from mistaking this phrase for the document heading, you must adjust the properties of the identifier element. Since the phrase “Enjoy our collection…” is always located above the document heading, the program must look for an object that has all the properties specified by the element and is located closest to the bottom edge of the image. To specify additional search constraints:
1

Open the Advanced tab of the FormHeader properties

Open the Properties dialog box for the FormHeader element, and then click the Advanced tab.
2

Add the search constraint

In the Advanced pre-search relations field, specify an additional search constraint that looks for the object closest to the bottom edge of the image. In the FlexiLayout language, enter NearestY: PageRect.Bottom;.
You can also specify the same constraint through the program’s graphical user interface. Click the Relations tab, select Nearest, and in the To: dropdown list select Page bottom edge.
The Nearest function tells the program that, out of several hypotheses for the element, it should look for the one nearest to a particular other element or point on the image (the distance between element centers is measured). Once the function is executed, only one hypothesis remains. This function does not take into account the quality of the hypotheses, as the choice is made at the stage when hypotheses are still being generated.
Once you match the FlexiLayout with the images again, you see that the program reliably detects the document headings described by the FormHeader element on all the test images.