tesseract.js icon indicating copy to clipboard operation
tesseract.js copied to clipboard

Language / Config for MRZ reading

Open noamyg opened this issue 3 years ago • 0 comments

Hi, I'm trying to read a MRZ and I get some unexpected results. I'm assuming I should pass some options for MRZ

image

Result: PLPRYDE<ASSIS<MOREIRA<SRONALDO<<<LLLLLLLLLLLQ568928<<4PRY8003214M2501073<<<<<<<<<<<<<<08**— —**

I've marked the incorrect characters.

Here's my code:

const imgBuffer = Buffer.from(this.croppedImage.split(',')[1], 'base64');
const tsResult = await Tesseract.recognize(imgBuffer, 'eng');
const parsedText = tsResult.data.text.replace(/(\r\n|\n|\r)/gm, '');
console.log(parsedText);

I'm using v2.0.0. Thanks!

noamyg avatar Mar 04 '21 08:03 noamyg