4

I need OCR capability for a Rails app on Heroku. My efforts to get tesseract to work have not been successful. Does anyone have any suggestions? It's hard to believe that something as basic as OCR isn't supported on something as ubiquitous as Rails on Heroku.

BACKGROUND ON EFFORT TO GET TESSERACT TO WORK

SPECIFIC ERROR LOADING TESSERACT_BIN gem

/Users/palfvin/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/pathname.rb:422:in `open': No such file or directory - /Users/palfvin/.rvm/gems/ruby-2.0.0-p247@avlats/gems/tesseract_bin-1.0.2/bin (Errno::ENOENT)
    from /Users/palfvin/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/pathname.rb:422:in `foreach'
    from /Users/palfvin/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/pathname.rb:422:in `children'
    from /Users/palfvin/.rvm/gems/ruby-2.0.0-p247@avlats/gems/tesseract_bin-1.0.2/lib/tesseract_bin.rb:7:in `<module:TesseractBin>'
    from /Users/palfvin/.rvm/gems/ruby-2.0.0-p247@avlats/gems/tesseract_bin-1.0.2/lib/tesseract_bin.rb:3:in `<top (required)>'
    from /Users/palfvin/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
    from /Users/palfvin/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
    from /Users/palfvin/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
    from tmp/tesseract.rb:261:in `<main>'
3
  • "something as basic as OCR" I think OCR is one of the most difficult tasks in the world, second possibly to speech recognition. On another note, a buildback is probably the way to go, as that's the sanctioned way to add your own binaries to what's available on the Heroku dynos.
    – rewritten
    Nov 17, 2013 at 22:16
  • 1
    Thanks. I of course didn't mean "basic" as "easy to implement algorithmically", but rather "something with a simple interface (image => text) that a lot of apps would want". Nov 17, 2013 at 22:19
  • I supposed that! :) It was like funny to see those two words in the same sentence...
    – rewritten
    Nov 17, 2013 at 23:06

1 Answer 1

4

I developed a simple server in RoR for Heroku that uses Tesseract OCR. The server receives jpg images, runs the OCR and returns the text as string. This could be a good starting point for you.

https://github.com/fouady/RoR-Tesseract-Heroku

Also, I use a custom buildpack which I have modified for myself. You will find the details here:

https://github.com/fouady/heroku-buildpack-tesseract

I hope this solves your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.