PLATFORMS << DESKTOP AND SERVER
MRZ Scanner for Linux
One shared library with a C API, for servers, containers and devices.
- Packagemrzscanner-linux (tar.gz)
- Requiresx86_64 or aarch64, glibc 2.17 and later
- Version2.5.0
Linuxc
#include "mrzscanner.h"
mrz_register_license("MRZ2...", "com.example.app", "", 4); /* 4: desktop */
mrz_status status;
mrz_scanner *scanner = mrz_scanner_create("/opt/mrzscanner/tessdata/", &status);
mrz_image image = {pixels, width, height, 0, MRZ_PIXEL_RGB8};
mrz_result *result = NULL;
if (mrz_scan_image(scanner, &image, NULL, &result) == MRZ_OK) {
puts(mrz_result_text(result)); /* the MRZ lines */
puts(mrz_result_json(result)); /* the parsed fields */
}- 1InstallGet the library from Downloads in the portal.
- 2Register your keyA 90-day trial key comes with your account; register it once at start.
- 3ScanPass images or camera frames; read the MRZ text and the parsed fields.
Install
The archive with libmrzscanner.so, the header and an example is under Downloads in the portal. It runs on any distribution since 2014, with no other dependencies.
Scan a document
Linuxc
#include "mrzscanner.h"
mrz_register_license("MRZ2...", "com.example.app", "", 4); /* 4: desktop */
mrz_status status;
mrz_scanner *scanner = mrz_scanner_create("/opt/mrzscanner/tessdata/", &status);
mrz_image image = {pixels, width, height, 0, MRZ_PIXEL_RGB8};
mrz_result *result = NULL;
if (mrz_scan_image(scanner, &image, NULL, &result) == MRZ_OK) {
puts(mrz_result_text(result)); /* the MRZ lines */
puts(mrz_result_json(result)); /* the parsed fields */
}
mrz_result_free(result);
mrz_scanner_destroy(scanner);