Can't get an atmosphere package to work

Hello everybody,

I am working on a little project, and I am trying to use an Optical Character Reader (OCR), in order to read text from images files. I’ve tried a lot of solutions to implement this on my app, but it never worked. I tried the npm package node-tesseract, which is apparently the most popular npm module to do OCR. But it didn’t work, I tried with the “import” and “require” syntax but neither of those worked. Also I’m not really sure if I have to use the module methods in the client or the server part.
By the way, I have a question, does this syntax: const moment = require(‘moment’); work in Meteor? I’ve seen it in the doc but it is not clear if we can use it or not.

Anyway, I also tried an atmosphere package (that you can find here: https://atmospherejs.com/wilybear/meteor-tesseract), but I could not make it work either. Because I am quite new in Meteor, I am not sure I installed it well. Can any of you can check on the github page and tell me if he or she understand how to use it? The config part seemed very unclear to me…

The last solution was to use a js library (not really sure of what it is, because you have to install it via npm and add a link to it in a script tag) called tesseract.js (you can find it here: http://tesseract.projectnaptha.com). I carefully followed the example on the github page, but it didn’t work at the end.

Finally, and this is not really related to Meteor, but did any of you ever implemented an OCR on your app? Is it a good idea to do it in JS?

Thank you for your help, and sorry if my questions seems stupid ^^ and sorry for my english :slight_smile:

What error(s) did you get?

I get this error in the web console:
tesseract.js:121TypeError: undefined is not an object (evaluating ‘process.versions.node.split’)

and I have nothing in the terminal… I guess it is because I don’t use the module properly. I found another person who had the same problem, unfortunately nobody answered to him :cry:

Otherwise I finally managed to make the tesseract.js library to work, I had to restart my app, and for some reasons the image was not really drawn in the canvas… But the library is not really accurate (around 60% of accuracy in the recognition), so I will not use it.
I think doing OCR in javascript is not a good solution at the moment, so I will try something else.