Skip to content

Latest commit

 

History

History

validation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

This sample application validates MRZ fields (document number, birth date, expiry date...). The algorithm is explained at https://www.doubango.org/SDKs/mrz/docs/Data_validation.html.

This sample is standalone application with no dependencies.

Pre-built binaries

If you don't want to build this sample by yourself then, use the pre-built versions:

On Windows, the easiest way to try this sample is to navigate to binaries/windows/x86_64 and run binaries/windows/x86_64/validation.bat. You can edit this file to use your own txt file and configuration options.

Building

This sample contains a single C++ source file and is easy to build.

Android

Please check android folder for Android samples.

iOS

Please check iOS folder for iOS samples.

Windows

You'll need Visual Studio to build the code. The VS project is at validation.vcxproj. Open it.

  1. You will need to change the "Command Arguments" like the below image. Default value: $(ProjectDir)..\..\..\assets\samples\td1.txt

VC++ config

You're now ready to build and run the sample.

Generic GCC

Next command is a generic GCC command:

cd ultimateMRZ-SDK/samples/c++/validation

g++ main.cxx -O3 -o validation
  • If you're cross compiling then, you'll have to change g++ with the correct triplet. For example, on Android ARM64 the triplet would be equal to aarch64-linux-android-g++.

Raspberry Pi (Raspbian OS)

To build the sample for Raspberry Pi you can either do it on the device itself or cross compile it on Windows, Linux or OSX machines. For more information on how to install the toolchain for cross compilation please check here.

cd ultimateMRZ-SDK/samples/c++/validation

arm-linux-gnueabihf-g++ main.cxx -O3 -o validation
  • On Windows: replace arm-linux-gnueabihf-g++ with arm-linux-gnueabihf-g++.exe
  • If you're building on the device itself: replace arm-linux-gnueabihf-g++ with g++ to use the default GCC

Testing

After building the application you can test it on your local machine.

Usage

validation is a command line application with the following usage:

validation <path-to-file-containing mrz-lines>
  • <path-to-file-containing mrz-lines> Path to txt file containing MRZ lines to parse. You can use default files at ../../../assets/samples/*.txt.

Examples

For example, on Raspberry Pi you may call the validation application using the following command:

chmod +x ./validation
./validation ../../../assets/samples/td1.txt