
We are continuing a series of articles about our products for developers implementing
data capture technology. The new product in the line -
ABBYY PassportReader SDK is a specialized solution for entering data from identity documents of citizens of Russia and CIS countries.
From the developer's point of view, the key feature of the new product is an extremely simple software interface and work out of the box, without the need for any preliminary configuration. In this article we will show how the use of the product looks like.
We
have already talked about our universal data entry solution for
ABBYY FlexiCapture Engine - about the difficulty of setting up specific types of documents and how we struggle with this, implementing self-learning technology. Despite significant progress in this area, the initial setup of the solution by the developer still requires some action. A working solution is now easy to obtain, but obtaining an
optimal solution still requires experience, knowledge and time.
')
On the other hand, there are many typical widespread document classes for which it is possible to perform all the settings in advance and create a specialized solution that is
optimized for working with a narrow class of documents and
does not require any preliminary configuration by the developer . An example of such a solution is the
ABBYY PassportReader SDK .
The main types of documents with which the
PassportReader SDK works are: a
passport or an identity card ,
driver's license and
passport . For the Russian Federation, an additional birth certificate is available. For the CIS countries, some documents are not yet available.
These types of documents are in demand, and, at the same time, are quite difficult to process, as they often have a complex background in the form of a thin line pattern -
guilloches ; inscriptions, contrasting only in color, but not in brightness; special fonts. In addition, many of these types of documents exist in the form of several options (old and new samples, biometric and regular passports, etc.). All this boils down to the fact that obtaining quality results on such documents using a universal tool like the
FlexiCapture Engine is not a trivial task. And here
PassportReader SDK comes on the scene.
Getting started
In the simplest case, all the work with the product comes down to creating an engine object and calling the
Recognize method:
var engine = new ABBYY.PassportReaderSdk.RecognitionEngine(); try { var result = engine.Recognize( fileName, "Passport_RU" ); ... } finally { engine.Close(); }
Nb. RecognitionEngine implements the IDisposable interface and can be used in a standard way in constructions requiring this interface. So, in the example above, instead of try ... finally it would be possible to use a using block, which would be completely equivalent.
Nb. You can read the image from a file or scan it with the built-in PassportReader SDK using the engine method. Scan ()
You can work directly with the extracted fields:
string lastName = result.FieldValue( "LastName", "" ); string firstName = result.FieldValue( "FirstName", "" ); string middleName = result.FieldValue( "MiddleName", "" ); string dateOfBirth = result.FieldValue( "DateOfBirth", "" ); string placeOfBirth = result.FieldValue( "PlaceOfBirth", "" );
Nb. The data scheme for all types of documents is unified - the fields of the same meaning have the same name regardless of the document type. That is, if we need the surname, name, patronymic, date and place of birth, then the code above will work equally with all types of documents.
Or get the result as XML and save to file:
string xmlBody = result.GetXml( ... ); string xml = string.Format( "<?xml version='1.0' encoding='UTF-8'?>{0}", xmlBody ); System.IO.File.WriteAllText( fileName, xml, Encoding.UTF8 );
Nb. The resulting XML document conforms to the XMLResult.xsd scheme, which is put together with the product.
This, in fact, almost everything. In addition to the basic functionality described above, for each field you can get a rectangle of the found field in the image and confidence in recognizing individual characters.
The described functionality is sufficient to implement the example, see the screenshot below. The example is a ready-to-use application that allows you to download or scan an image of a document, recognize it, edit and save the result in XML or CSV, with the ability to launch an external application if necessary for further processing of the result. The sample comes with source code and the developer has the opportunity to easily modify it to fit his needs.

Even without improvement, the simplest tools for integration with external systems are included in the example:

At the time of this writing, documents for the following countries are available in the
PassportReader SDK :

Technical details
From the point of view of the implementation of the
PassportReader SDK is a wrapper on .Net around a heavily trimmed version of the
FlexiCapture Engine (unnecessary dictionaries have been removed, the size of the distribution kit has been reduced several times). The wrapper performs all the environment settings and image preparation, and presents the user with an extremely simple software interface.
Although the native environment for the
PassportReader SDK is .Net, all interfaces are declared with the
ComVisible attribute. Therefore,
PassportReader SDK can be used directly from development environments that can work with COM. The product includes usage examples in C ++ and Delphi.
Nb. At the same time, there are some nuances introduced by the .Net ideology. For example, in order for a COM object to be created, the corresponding assembly must be registered in the GAC or in the same directory as the EXE file of the calling application. That is, the requirements are exactly the same as for .Net assemblies.
There are two versions of the
PassportReader SDK : regular and server. The regular version does not support multithreading and requires that all work with PR is performed from one stream. The server version supports multiple streams. In this case, the work is performed in parallel with the use of all available processor cores.
PassportReader SDK is a wrapper around the
FlexiCapture Engine . Therefore, all that
PassportReader SDK can do is implemented using the
FlexiCapture Engine . The fact that the
FlexiCapture Engine can be much more, I will not even mention - obviously.
Current product information can be found
on the ABBYY website .
Alexey Kalyuzhny,
product department for developers