Reputation: 155
Using the PM I installed Emgu.CV to my solution and wrote this very simple code:
using (var img = new Image<Bgr, byte>("img4.png"))
{
using (var provider = new Tesseract("", "eng", OcrEngineMode.TesseractCubeCombined))
{
provider.Recognize(img);
var chars = provider.GetCharacters();
var text = provider.GetText().TrimEnd();
}
}
For some strange reason, when I run the app, I get the exceptions: 1) The console displays the following: error opening data file ./tessdata/eng.traineddata please make sure the tessdata_prefix environment variable is set to the parent directory of your "tessdata" directory Failed loading language "eng" Tesseract couldn't load any languages
2) And the exception error in the code: {"Unable to create ocr model using Path 'c:\users\jdoe\documents\visual studio 2015\Projects\OpenCV_ImgToText\OpenCV_ImgToText\bin\Debug' and language 'eng'."}
Well, first of all I am not sure if I had to install anything before running this code. I donwloaded the package from emgu.com, unzipped it but there is only the source code, so nothing to install I also changed the folder permission to OpenCV_ImgToText, so now it can write the files into it. But the erorr still pops up. Please advise.
Upvotes: 0
Views: 506
Reputation: 1622
I have used OpenCV once. Following documentation helped me to create simple application with WCF.
http://www.emgu.com/wiki/index.php/Download_And_Installation
Upvotes: 0