const tesseract = require('node-tesseract-ocr')
const config = {
lang: 'eng',
oem: 1,
psm: 6,
// tessedit_char_whitelist: '0123456789',
presets: ['digits']
}
tesseract
.recognize('./image4.png', config)
.then(text => {
console.log('Result:', text)
})
.catch(err => {
console.log('error:', err)
})
The output I'm getting is, "Result: x 4606 : -4809 Z: 698".
Expected output: "Result: 4606-4809698". (I don't know if it should be delimited or not but there shouldn't be any letters. I have tried a number of things:
const config = {
lang: 'eng',
oem: 1,
psm: 6,
tessedit_char_whitelist: '0123456789'
}
I've also tried without a digits file and with. With a digits file, the filename is just 'digits' with no extension and I've tried putting it in the same location as my app.js (same dir where I run the script above) and I've also tried putting the digits file here: './tessdata/configs/digits'.
tessedit_char_whitelist 0123456789