I need to read numbers from a digital scale screen which are displayed like this, for example:
So I'm using a webcam, Javascript and Tesseract.js to use OCR. But the best result was:
Jo | |
I 10)
When the expected result was 123456
, obviously.
Here is some of the resulting JSON:
block: {
paragraphs: Array(1),
text: "Jo | |↵I 10)↵",
confidence: 47.748504638671875,
baseline: {
…},
bbox: {
…},
…
}
The code that process the image is the following:
function recognizeFile(file){
const corePath = window.navigator.userAgent.indexOf("Edge") > -1
? 'js/tesseract-core.asm.js'
: 'js/tesseract-core.wasm.js';
const worker = new Tesseract.TesseractWorker({
corePath,
});
worker.recognize(file,
$("#langsel").val()
)
.progress(function(packet){
console.info(packet)
})
.then(function(data){
console.log(data)
})
}
Is there another option to achieve this? Is there a more appropriated library for these cases?
Thanks in advance.