title: How to implement Tesseract to run with project in Visual Studio 2010
body: <p>I have a C++ project in Visual Studio 2010 and wish to use OCR. I came across many "tutorials" for Tesseract but sadly, all I got was a headache and wasted time.</p>
  
  <p>In my project I have an image stored as a <strong>Mat</strong>. One solution to my problem is to save this Mat as an image (image.jpg for example) and then call Tesseract executable file like this:</p>
  
  <pre><code>system("tesseract.exe image.jpg out");
  </code></pre>
  
  <p>Which gets me an output <em>out.txt</em> and then I call </p>
  
  <pre><code>infile.open ("out.txt");
  </code></pre>
  
  <p>to read the output from Tesseract. </p>
  
  <p>It is all good and works like a chair but it is not an optimal solution. In my project I am processing a video so <em>save/call .exe/write/read</em> at 10+ FPS is not what I am really looking for. I want to implement Tesseract to existing code so to be able to pass a Mat as an argument and immediately get a result as a String.</p>
  
  <p>Do you know any good tutorial(pref. step-by-step) to implement Tesseract OCR with Visual Studio 2010? Or your own solution?</p>