Give us a call
Call us at +41 41 555 20 40
MrzScanner
requires to be initialized before use:
MrzScanner mrzScanner = MrzScanner();
mrzScanner.init(context); // late init so mrzScanner can be final
Then, as soon as information about the camera frame is available, the region of interest needs to be set:
mrzScanner.setRegionOfInterest(
frameWidth, // native width of unrotated camera frame
frameHeight, // native height of unrotated camera frame
frameOrientation, // rotation in degrees of camera frame
previewRect, // rectangle of camera preview in view coordinates
roiRect // region of interest in view coordinates
);
To recognize an MRZ in a camera frame do:
String mrz = mrzScanner.find(
framePixels, // camera pixels in YUV format
frameWidth, // native width of unrotated camera frame
frameHeight, // native height of unrotated camera frame
frameOrientation, // rotation in degrees of camera frame
canvas // null or a canvas over the camera preview to draw into
);
To parse the MRZ and get a MrzInfo
object with all the parts of an MRZ, you can use MrzParser
from the included mrzparser-java library like this:
MrzInfo mrzInfo = MrzParser.parse(mrz);
Check the sample app to see this in action.
Give us a call
Call us at +41 41 555 20 40
Contact by e-mail
Contact us via our contact form.
Personal meeting
Arrange a personal meeting.