Home > Uncategorized > OCR in C#

OCR in C#

I’ve just set up a webservice to perform OCR (optical character recognition) in C#, It’s at http://www.free-ocr.co.uk

The code’s pretty simple:

Stream sFile = fileUploader.PostedFile.InputStream;
Bitmap bmp = System.Drawing.Image.FromStream(sFile) as Bitmap;
MemoryStream ms = new MemoryStream();
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
ocr webservice = new ocr();
lblResult.Text = webservice.Analyze("Your Email", ms.ToArray());

Here, the ASPX file is as follows:

<form id="form1" runat="server" enctype="multipart/form-data" >
<input type="file" runat="server" id="fileUploader" />
<asp:Button type="button" id="btnUpload" Text="Upload" runat="server" onclick="btnUpload_Click"  />
<asp:Label id="lblResult" runat="server" ></asp:Label>
Categories: Uncategorized
  1. oipè
    July 15, 2011 at 8:30 am

    I do not understand when you write:
    “ocr webservice = new ocr();”
    to which reference do you refer for ‘ocr’?



  2. pstudiodev
    November 29, 2012 at 8:12 am

    I think the article has referenced to OCR web service. Maybe it is better if the article provide URL web service also.


  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: