-1

I want to convert an image DataURL into a number on javascript for my chrome extension

The images look like this example example

In Python, it is possible with pytesser or pytesseract but i don't know how do that with javascript (and JQuery) only. There are some libraries that can help me solve this problem or should I do through ajax and call Python script on a server? I think it is not possible to call the Python code directly from a chrome extension.

Thanks!

Rod
  • 712
  • 2
  • 12
  • 36

2 Answers2

1

I believe OCR is needed, and obvioulsy pytesseract is just an OCR tool. You could use some JavaScript version OCR library instead, by simply google search, I found this one (I have never used it before).

Or as you said, you could also put your OCR logic at your server side with python implementation, just make an ajax call to query the result.

Haibara Ai
  • 10,703
  • 2
  • 31
  • 47
  • [ocrad.js](http://antimatter15.com/ocrad.js/demo.html) is very nice ! But only for text. It does not recognize the numbers.. frustration – Rod Apr 19 '16 at 11:40
0

Here's the link for converting monohrome to decimal

Converts monochrome to decimal(big number) or with the same output(big number), decimal from small images. Only 64x64, web-page not setup to release at this time. Browsers, vary. Tested in Google-chrome, known errors exist in Mozilla. +plus safari refuses to 'throw' an unresponsive page error. Not known if functionality exists in Internet explorer. Additionally, input requires an exact 64px square. Not exclusively compatible on iDevices, since the input is usually the pixel size of an image taken with the camera app. I am still developing, all code hold no copywrite and is messy, not modular. Free site, no adds or pop up, written in JavaScript only. Send me an e-mail if you see my address in the html markup. The page takes an extremely long time to load, because of the exponents of two variable list. Not a professional site, however it serves as a good example of how web-workers are useful (under development).

MashukKhan
  • 1,946
  • 1
  • 27
  • 46