ASP.NET - How to add Screen OCR functionality in ASP.Net/C# ?

Asked By Anish V on 22-Jun-12 05:06 AM
Hi All,

I want to OCR the current screen upon selection. How can we achieve that? Any dll's or ocx available ? Or Any third party dll's for this ?. I have to do it in C#.

Expecting a reply,

regards,
Anish
S K replied to Anish V on 22-Jun-12 11:19 AM
There are lots of third party dll to implement OCR in .net

You can use Tesseract OCR in C# by following the instructions given in http://stackoverflow.com/questions/30328/ocr-with-the-tesseract-interface.

http://maniish.wordpress.com/2007/03/03/tesseract-ocr-library-successfully-compiled-in-window/ might also be of interest. Seems they got the source to compile on Windows.


Also see
http://code.google.com/p/tesseract-ocr/

hope this helps you
[)ia6l0 iii replied to Anish V on 22-Jun-12 01:03 PM
There is a OCR component that is packaged with Microsoft Office v2007 and above. But note that to run this successfully on the web server, you need to install the OCR component with the Micrsoft Office on your webserver. 

Once you have the OCR component with Micrsofot Office installed, open the visual studion asp.net project, and add references to teh Microsoft Office Document Imaging interop library. You should find it as a com library. This is some sample code that I pulled from a code collection website, that is exactly what you should write as well.

//create a modi document
MODI.Document modiDocument = new MODI.Document(); 
modiDocument.Create(filename); 
//set the attributes
modiDocument OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true); 
//load the image from the file
MODI.Image image = (MODI.Image)modiDocument.Images[0];

//use a filestream to create a new text file
FileStream txtFile = new FileStream(fileName + ".txt", FileMode.CreateNew);
//write the text from the image.
using(StreamWriter sw = new StreamWriter(txtFile))
{
sw.Write(image.Layout.Text); 
}

Hope this helps.
Jitendra Faye replied to Anish V on 25-Jun-12 02:28 AM
For this you need to use SDK for integrating OCR functionality.

follow these links-

http://www.codeproject.com/Articles/3907/Creating-Optical-Character-Recognition-OCR-applica
http://www.codeproject.com/Articles/41709/How-To-Use-Office-2007-OCR-Using-C

here you will get example.