English (English)

Sample 2. Step 7: Testing the identifier element

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.
  2. Select the Match command in the FlexiLayout menu or in the shortcut menu of each image.

If the image and its FlexiLayout have been matched successfully, the hypothesis which the program formulates about the FormHeader element will be marked with in the Tree of Hypotheses. If you click the hypothesis, the program will draw a blue frame around the detected element. You will see the properties of the hypothesis in the Properties window.

Show me...

When you try matching the FlexiLayout with the images you will see that on some of the images the program has found 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 need to adjust the properties if 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 Properties dialog box for the FormHeader element.
  2. Click the Advanced tab.
  3. In the Advanced pre-search relations field, specify an additional search constraint:Look for an object that is closest to the bottom edge of the image. In the FlexiLayout language:
    NearestY: PageRect.Bottom;

Note.The same constraint can also be specified via the program’s graphical user interface. Click the Relations tab, select Nearest, and in the To: drop-down list select Page bottom edge.

Note.The Nearest function tells the program that out of the 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 hypotheses 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 have matched the FlexiLayout with the images again, you will see that the program has reliably detected the document headings, which are described by the FormHeader element, on all the test images.

25.05.2023 7:55:03

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.