0

I am trying to use tesseract into VS2010 project to get some text from an image.

I am using the following code:

    tesseract::TessBaseAPI api;
    if(0 != api.Init(NULL, _T("eng"), tesseract::OEM_DEFAULT))
    {
        m_sError.Format(_T("tesseract initialize error"));
        return;
    }
    api.SetPageSegMode(static_cast<tesseract::PageSegMode>(7));
    PIX* pixs = pixRead(sFileName);
    STRING txtout;
    if(! api.ProcessPages(sFileName, NULL, 0, &txtout))
    {
        m_sError.Format(_T("tesseract process error"));
        return;
    }

but I always get error at api.init method ...

I have taken from here the sample code, and the compiled tesseract library. I have applied all specification from that post, and I have tried this even on Release, with the same result.

Also, I have tried to compile the tesseract library on my own, but I have VS2010 only. Here is saying that I need VS2015 or above, and I have found here a VS2010 tesseract binaries, but even here I have met errors at compile time:

fatal error C1083: Cannot open include file: 'allheaders.h': No such file or directory

Why I get Init error ? If there something wrong with my library, can you give me some compiled tesseract library in order to use it in my VS2010 project ? Can you help a little bit ?

Flaviu_
  • 1,285
  • 17
  • 33
  • When I had tried to create a solution from https://github.com/tesseract-ocr/tesseract I get from CMake the following message: Could not find a package configuration file provided by "Leptonica" ... can you lead me into using tesseract inside of MFC VS2010 project ? – Flaviu_ Sep 06 '18 at 09:32
  • I have compiled everything with VS2017, and I get rid of any error ... but when I have tried the code from above, I get the same error on api.Init method ... does anybody tried this example ? – Flaviu_ Sep 26 '18 at 07:07

0 Answers0