title: Tesseract OCR simple example
body: <p>Hi Can you anyone give me a simple example of testing Tesseract OCR
  preferably in C#.<br>
  I tried the demo found <a href="http://www.pixel-technology.com/freeware/tessnet2/" rel="nofollow noreferrer">here</a>.
  I download the English dataset and unzipped in C drive. and modified the code as followings:</p>
  <pre><code>string path = @&quot;C:\pic\mytext.jpg&quot;;
  Bitmap image = new Bitmap(path);
  Tesseract ocr = new Tesseract();
  ocr.SetVariable(&quot;tessedit_char_whitelist&quot;, &quot;0123456789&quot;); // If digit only
  ocr.Init(@&quot;C:\tessdata\&quot;, &quot;eng&quot;, false); // To use correct tessdata
  List&lt;tessnet2.Word&gt; result = ocr.DoOCR(image, Rectangle.Empty);
  foreach (tessnet2.Word word in result)
      Console.WriteLine(&quot;{0} : {1}&quot;, word.Confidence, word.Text);
  </code></pre>
  <p>Unfortunately the code doesn't work. the program dies at &quot;ocr.Init(...&quot; line. I couldn't even get an exception even using try-catch.</p>
  <p>I was able to run the <a href="http://vietocr.sourceforge.net/" rel="nofollow noreferrer">vietocr</a>! but that is a very large project for me to follow. i need a simple example like above.</p>