Search code examples
c++visual-studio-2019ocrtesseract

Using Tesseact OCR in an existing Visual Studio C++ project


I want to use the Tesseract-OCR library with my already existing C++ project. I followed the steps mentioned in this answer.

  1. I cloned the Github repo from here
  2. Ran the build_tesseract.bat
  3. Opened 'tesseract.sln' and set 'tesseract' as startup project before compiling it for both 'release' and 'debug' configurations
  4. After successful compilation, under the folder 'debug' and 'release', I have a list of .lib files

Now I don't know how to move forward from here. I am used to adding libraries that have 'include' directories. Here, I am not able to find such directories except the .lib files for both 'debug' and 'release' configuration.

Can someone point me to how to use these files to add the 'tesseract-OCR' API to my existing project?


Solution

  • For anyone looking to use Tesseract-OCR with Visual Studio 2017+, I found an alternative method(Not exactly, It was straight to my face all along).

    Using VcPkg seems to be the best and easiest way as mentioned in Tesseract-OCR documentation itself.

    1. Install VcPkg from the instruction here
    2. Navigate to the installation folder or Add the VcPkg to the 'PATH' variable
    3. Run the command vcpkg install tesseract:x64-windows. It might take 30 to 40 mins depending on your system
    4. Under the 'Installed' folder, you will find 'include', 'lib' & 'bin' folders for all Visual Studio configurations
    5. Using this, you can add Tesseract-OCR to your existing Visual Studio project