A simple distributed cloud OCR (Optical Character Recognition) application that uses Windows Azure Web and Worker Roles, and stores data in Windows Azure Blobs, Tables, and Queues.
General workflow:
- User uploads an image on a web page served by the Web Role, specifies an email address, and enters a CAPTCHA.
- Web Role uploads the image to Blob Storage, registers the job in an Azure Table and creates an OCR queue item.
- OCR Worker Role pulls messages from the OCR queue, recognizes the images using Google Tesseract, stores the recognized text to Blob Storage, and creates Email queue items.
- Email Worker Role pulls messages from the Email queue, reads the recognized text from Blob Storage, and emails it via SendGrid.
- User receives the recognized text as an email with a text attachment.
In order to work with the source code, you'll need the following:
- Visual Studio 2012.
- NuGet package manager.
- Windows Azure SDK 2.0 + Windows Azure Tools for Visual Studio 2012.
- Windows Azure account (if you want to deploy the app to Azure).
- Recaptcha key pair.
- SendGrid account (to send emails).
-
Edit
ServiceConfiguration.Local.cscfg
:- Specify your Recaptcha key pair in WebRole configuration.
- Specify your SendGrid credentials in EmailWorkerRole configuration.
-
Set
AzureCloudOCR
as the startup project and press F5. The application will be launched in Windows Azure Compute Emulator.
Edit ServiceConfiguration.Cloud.cscfg
:
- Update Windows Azure Storage connection strings to match your storage account name and key.
- Specify your Recaptcha key pair in WebRole configuration.
- Specify your SendGrid credentials in EmailWorkerRole configuration.
The application can be deployed from Visual Studio 2012. Right-click the AzureCloudOCR
project and select Publish...
.
- Build errors on fresh
git clone
:- Make sure that NuGet package restore is enabled and that NuGet is able to download missing files from the Internet.
- Make sure you have Windows Azure SDK 2.0 installed.
- You can use Azure Storage Explorer to browse the content of blobs, tables, and queues.
The code is licensed under the Apache License, version 2.0.