
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
github.com/soheilsalehian/open-ocr
Advanced tools
OpenOCR makes it simple to host your own OCR REST API.
The heavy lifting OCR work is handled by Tesseract OCR.
Docker is used to containerize the various components of the service.

OpenOCR can easily run on any PAAS that supports Docker containers. Here are the instructions for a few that have already been tested:
If your preferred PAAS isn't listed, please open a Github issue to request instructions.
OpenOCR can be launched on anything that supports Docker, such as Ubuntu 14.04.
Here's how to install it from scratch and verify that it's working correctly.
See Installing Docker on Ubuntu instructions.
$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:43:40:c7
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
...
The ip address 10.0.2.15 will be used as the RABBITMQ_HOST env variable below.
Here's how to launch the docker images needed for OpenOCR.
$ curl -O https://raw.githubusercontent.com/tleyden/open-ocr/master/launcher/launcher.sh
$ export RABBITMQ_HOST=10.0.2.15 RABBITMQ_PASS=supersecret2 HTTP_PORT=8080
$ chmod +x launcher.sh
$ ./launcher.sh
This will start three docker instances:
You are now ready to decode images → text via your REST API.
docker-compose directorydocker-compose up to see the log in console or docker-compose up -d to run containers as daemonsDocker Compose will start four docker instances
Request
$ curl -X POST -H "Content-Type: application/json" -d '{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}' http://10.0.2.15:$HTTP_PORT/ocr
Response
It will return the decoded text for the test image:
< HTTP/1.1 200 OK
< Date: Tue, 13 May 2014 16:18:50 GMT
< Content-Length: 283
< Content-Type: text/plain; charset=utf-8
<
You can create local variables for the pipelines within the template by
prefixing the variable name with a “$" sign. Variable names have to be
composed of alphanumeric characters and the underscore. In the example
below I have used a few variations that work for variable names.
The REST API also supports:
multipart/related, rather than passing an image URL. (example client code provided in the Go REST client)See the REST API docs and the Go REST client for details.
The supplied docs/upload-local-file.sh provides an example of how to upload a local file using curl with multipart/related encoding of the json and image data:
docs/upload-local-file.sh <urlendpoint> <file> [mimetype]wget http://bit.ly/ocrimagedocs/upload-local-file.sh http://10.0.2.15:$HTTP_PORT/ocr-file-upload ocrimageOpenOCR is Open Source and available under the Apache 2 License.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.