Forms processing and optical marks recognition (OMR) technology is widely used for classification, routing and recognition by templates
of forms of electronic documents like invoices, waybills, etc; recognition of optical marks filled into a form of test, questionnaire, ballots, etc.

VintaSoft Forms Processing .NET Plug-in can be used both for recognition of forms and for aligning image by template. This article describes how to use barcodes instead of lines for image identification and so improve the accuracy and reliability of recognition.

The image aligning process may be divided into 2 steps.

STEP 1: Identifying image by template.
The identification of image is performed using the TemplateMatchingCommand class. The class compares an input image with a template image and determines if images are similar. By default, the class uses template, which consists from the straight lines. We can override the logic of class and use a template, which consists from barcodes. The following 2 classes are necessary for overriding the image identification algorithm:

Aztec Rune stores one byte of information and this is more than enough for encoding a number of the point to which the barcode corresponds to.

The result of successful identification is a matrix of transforms, which defines the offsets, squeezing and rotation of image relatively to the template.

STEP 2: Aligning image by template.
The aligning of image is performed using the TemplateAligningCommand class. The class uses the matrix of transforms achieved in step 1.

EXAMPLE: For example let us use the template containing 3 barcodes:

3 barcodes, which are not collinear (i.e. 3 reference points), this is a minimum allowable number of points necessary for correct work
of algorithm. It is allowed to use more barcodes for the case when they could be damaged or truncated.
The barcodes may be placed into any area of page, but the best accuracy in identification of distortions is reached when
barcodes are located in the edges of document.

Let us use the following images for test:

Here is an example of console application, which performs the process of image comparison and aligning:

Also the identification using barcodes can be used for recognition of forms (instead of default identification by lines).
This would allow to create a reliable forms recognition system, for case the forms are scanned and acquired from rather large number of different sources with different characteristics.

Here is an example that demonstrates how to identify a form using recognition of barcodes on the form image: