I want to read a number from an image using Node.js.
I am parsing the image using canvas and then reading the image but it gives me the binary data for image but I need the number value that image contains.
Try:
npm install tesseract.js
Then include file in node.js
var Tesseract = require('tesseract.js');
Then
Tesseract.recognize(
'https://tesseract.projectnaptha.com/img/eng_bw.png',
'eng',
{ logger: m => console.log(m) }
).then(({ data: { text } }) => {
console.log(text);
})
Well, obviously you can't just read data off the image and get the text you need.
You need to interpret the image with some OCR (Optical character recognition) software.
What I could suggest if you are keen on using NodeJS is the node-tesseract module. Make sure to do as the Installation guide says because you also need to install the tesseract-ocr software as well as the module.
First, do install tesseract
in your machine by doing the given steps from this tessdocs(tesseract documentation).
Once you are done with the installation please try the steps from the above comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With