title: Initializing a Tesseract
body: <p>I try to get some text of an image by using OCR. I have to initialize a Tesseract for that and this was my try:</p>
  
  <pre><code>Imports Emgu.CV
  Imports Emgu.Util
  Imports Emgu.CV.Structure
  Imports Emgu.CV.OCR
  Imports Emgu.CV.UI
  Imports Emgu.CV.CvEnum
  
  Public Class Form1
  
      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  
          Dim lolProcess() As Process = Process.GetProcessesByName("lolClient")
          Dim snap As New CScreenFromWindow
  
          Dim OCRz As Tesseract = New Tesseract("tessdata", "eng", Tesseract.OcrEngineMode.OEM_TESSERACT_ONLY)
  
          OCRz.Recognize(New Image(Of Bgr, Byte)(snap.GetFromAll(lolProcess(0))))
          MsgBox(OCRz.GetText())
  
      End Sub
  End Class
  </code></pre>
  
  <p>When launching my code I get the following error:
  "System.TypeInitializationException"
  "Emgu.CV.OCR.Tesseract" caused an exception</p>
  
  <p>I have googled a lot, but can't find my mistake. I've downloaded EMGU from <a href="http://sourceforge.net/projects/emgucv/files/emgucv/2.4.9-beta/" rel="nofollow">this link</a> and installed the .exe. Then I added every .dll from the bin-directory as a reference to my project. I also added all opencv_XXXXX.dll-files to my project. Then I also added the tessdata-directory to my project. I've marked all the added dlls as "Always copy to output-directory". </p>
  
  <p>There are opencv_XXXXXX.dll-files for x86 and x64. I tried to swap them to x64 but those also don't work.</p>
  
  <p>Does anybody see my mistake? </p>
  
  <p>This are the error-messages and stack-traces:</p>
  
  <pre><code>   System.ArgumentException: Unable to create ocr model using Path tessdata and language eng.
     bei Emgu.CV.OCR.Tesseract.Init(String dataPath, String language, OcrEngineMode mode) in c:\Emgu\emgucv-windows-universal-gpu 2.4.9.1847\Emgu.CV.OCR\Tesseract.cs:Zeile 226.
     bei Emgu.CV.OCR.Tesseract..ctor(String dataPath, String language, OcrEngineMode mode) in c:\Emgu\emgucv-windows-universal-gpu 2.4.9.1847\Emgu.CV.OCR\Tesseract.cs:Zeile 118.
     bei Dodgemaster.Form1.Button1_Click(Object sender, EventArgs e) in X:\Dokumente\Visual Studio 2013\Projects\Dodgemaster\Dodgemaster\Form1.vb:Zeile 16.
  </code></pre>
  
  <p>A Hello World test-programm works fine. So it can't be something wrong with the references, right?</p>