Check out my courses and become more creative!
https://developedbyed.com/
🎁Support me on Patreon for exclusive episodes, discord and more!
https://www.patreon.com/dev_ed
Today we are building a new exciting javascript project!
We will be using OCR (optical character recognition) to recognize an image and extract all the text from it.
We will be using a few packages such as express, multer and tesseract.js. At the end we will convert our image into a pdf.
If you feel like you need more practice with node.js or you just want some project ideas I highly recommend you to follow this tutorial!
🛴 Follow me on:
Twitch: https://www.twitch.tv/developedbyed
Twitter: https://twitter.com/developedbyed
Instagram: https://www.instagram.com/developedbyed/
Github: https://github.com/developedbyed/
#javascript #ocr
Original source
35 responses to “Build A Javascript OCR App Tutorial”
I subscribed within the first minute itself, The way you teach is funny and we can watch without getting bored. It would be great if you could share the code as well 😀
Dev that’s really helpful ! Can we do this I. App script to execute in google sheet?
wow! what an work it is ……an effortless work from this man
anyone here tried to read from an image with arabic text? thank you! 🙂
Hey bruv!….Worker.progress throws an error "worker.progress is not a function".Any solution? And also for worker.then
i come for the magic tricks 0:42
i dare you to do JS magic tricks.
Hi, I got an error: TypeError: TesseractWorker is not a constructor. Does anybody know how to fix this?
Thanks
For anyone who is still struggling with 'const worker = new TesseractWorker()' is not a constructor. Just do everything exactly as shown in the video.
Just use npm install tesseract.js@2.0.0-alpha.15 to use the exact same version of tesseract as used in the video.
Not sure if this is necessary but make sure you have "tesseract.js": "^2.0.0-alpha.15" mentioned as a dependency in your JSON file.
*
const {TesseractWorker} = require('tesseract.js')
const worker = new TesseractWorker();
TypeError: worker.recognize(…).progress is not a function
solution please
For anyone still struggling with 'const worker = new TesseractWorker()' is not a constructor. TeseractWorker is depreciated in versions 2+ so we use createWorker() instead.
Here is the fix:
Replace all forms of TesseractWorker with createWorker() for versions 2.0+ of Tesseract by using npm install tesseract.js@next and npm install tesseract.js-core
Install tesseract.js-core link: https://www.npmjs.com/package/tesseract.js-core
Make sure to remove ^ the carrot sign before tesseract.js within the package.json which forces the dependency to be the newest version. Not sure if this step matters but the code below is what you use instead of TesseractWorker() which is depreciated in the 2.0+ versions.
SOLUTION:
const { createWorker } = require("tesseract.js");
const worker = new createWorker({
logger: m => console.log(m)
});
… rest of backend code in app.js
use this code I gave blow instead of -> "new createWorker();"
const { createWorker } = require('tesseract.js');
const worker = createWorker({
});
nice job , wish you had the code for this on github tho
arigatou sensei !!! 🙏
how about mentioning that it's node/server side in the title
Instead of using saved image can we use camera of device to dynamically convert image to text?
Anyone getting the tesseract error:
Fix below:
(Also maybe someone smarter than me can clean this up a bit)
https://github.com/naptha/tesseract.js/issues/346
I'm on mobile so no correct syntax but
Changing to "tesseract.js" : "2.0.0.alpha.13",
And
tesseract-js-core : 2.0.0-beta.11
^ Add those to package.json
Plain `npm install` for dependant
Remove any *"^"*'s from tesseract and tesseract-core in the `package.json` so it takes both versions (I think that's how you do it? Someone smarter than me can correct:) )
Changing those in package.json seemed to get the app working.
Ily
Still getting the TesseractWorker is not a constructor on both versions 🙁
Looking for what changed now
https://github.com/naptha/tesseract.js
I still get the tesseract error not being a object:( after uninstalling and installing the its npm
You the best ! Appreciate dat
My terminal:
$ : The term '$' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of t
he name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ $ npm install ejs express multer tesseract.js
+ ~
+ CategoryInfo : ObjectNotFound: ($:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Nice work bro .. Please always continue to make more videos to develop tools 🙂
damn, exactly what i need. i just need to save the recognised text to the db. any recomendations or advices on.hoe to tackle this?
the tesseract on javascript is really really slow…. i tried it myself.
Your videos are good but for beginners it's like copying the code because you don't describe code clearly line by line.
and if you could please watch the some of the videos of "the net ninja" the line by line explanation he provides is way better than you .
just a suggestion so that you can make your content more better. Thank-You
i see myself in u pewdiepie jr. haha being too curious of how things work & get bored after mastering it :-DDD
Hello, my friend!
Im never gonna subscribe for PewDiePie
Hi bro, can you tell me, best way to extract text from invoice, please do reply, it will help me lot
Heeey dev this youtuber is using your site and your word to word copy . Check this link of his video is
https://youtu.be/k152ovSOR74
T series is the best
Please upload to github to save us to type.
what kind of syntax is const upload= multer({storage:storage}) ? (i don 't get what does the storage:storage do)
thanks you if you will reply
Where's karudo.js?
Buen video wey!