Qt and Tesseract Linkage
-
@OlegD said in Qt and Tesseract Linkage:
LIBS += -LC:\Qt\opencv_cv2\OPENCV1\build-qt\lib
-lopencv_calib3d249d
-lopencv_contrib249d
-lopencv_core249d
-lopencv_features2d249d
-lopencv_flann249d
-lopencv_gpu249d
-lopencv_highgui249d
-lopencv_imgproc249d
-lopencv_legacy249d
-lopencv_ml249d
-lopencv_nonfree249d
-lopencv_objdetect249d
-lopencv_ocl249d
-lopencv_photo249d
-lopencv_stitching249d
-lopencv_superres249d
-lopencv_ts249d
-lopencv_video249d
-lopencv_videostab249dthis is incorrect
those need to be inline or concatenated via
\
to escape the (invisible) newline character -
Well, I dont know how to make it work with QT.
I've just installed package, realized that there is no instruction for QT and posted to QT forum.
Please advise how can I install it properly for QT environmentWindows
main branch, 3.05 and later
Using Tesseract!!! IMPORTANT !!! To use Tesseract in your application (to include tess or to link it into your app) see this very simple example.
Build the latest library (using Software Network client)Download the latest SW (Software Network https://software-network.org/) client from https://software-network.org/client/. Run sw setup (may require administrator access) Run sw build org.sw.demo.google.tesseract.tesseract-master.
For visual studio project using tesseract
Setup Vcpkg the Visual C++ Package Manager. Run vcpkg install tesseract:x64-windows for 64-bit. Use –head for the master branch.
Static linking
To build a self-contained tesseract.exe executable (without any DLLs or runtime dependencies), use Vcpkg as above with the following command:
vcpkg install tesseract:x64-windows-static for 64-bit vcpkg install tesseract:x86-windows-static for 32-bit
Use –head for the main branch. It may still require one DLL for the OpenMP runtime, vcomp140.dll (which you can find in the Visual C++ Redistributable 2015).
Build training toolsToday it is possible to build a full set of tess training tools on Windows with Visual Studio. You need to have the latest VS compiler (VS2019/2022 or light VS 2019/2022 build tools distro installed.
To do this:
Download the latest SW (Software Network https://software-network.org/client/) client from https://software-network.org/client/. Checkout tesseract sources git clone https://github.com/tesseract-ocr/tesseract tesseract && cd tesseract. Run sw build. Binaries will be available under .sw\out\some hash dir...
Develop Tesseract
For development purposes of Tesseract itself do the next steps:
Download and install Git, CMake and put them in PATH. Download the latest SW (Software Network https://software-network.org/) client from https://software-network.org/client/. SW is a source package distribution system. Add SW client to PATH. Run sw setup (may require administrator access) If you have a release archive, unpack it to tesseract dir.
If you’re using main branch run
git clone https://github.com/tesseract-ocr/tesseract tesseract
Run cd tesseract mkdir build && cd build cmake .. Build a solution (tesseract.sln) in your Visual Studio version. If you want to build and install from command line (e.g. Release build) you can use this command: cmake --build . --config Release --target install If you want to install to other directory that C:\Program Files (you will need admin right for this), you need to specify install path during configuration: cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst
For development purposes of training tools after cloning a repo from previous paragraph, run
sw build
You’ll see a solution link appeared in the root directory of Tesseract.
Building for x64 platform
swIf you’re building with sw+cmake, run cmake as follows:
mkdir win64 && cd win64
cmake .. -G "Visual Studio 14 2015 Win64"If you’re building with sw run sw generate, it will create a solution link for you (not yet implemented!).
-
@OlegD
All you have done is pasted the whole of the instructions. They are for you to read and act on. Only you know what you did/did not do.Well, I dont know how to make it work with QT.
I've just installed package, realized that there is no instruction for QT and posted to QT forum.
Please advise how can I install it properly for QT environmentI do not see anything related to Qt, or for Qt instructions.
Your code has#include <tesseract/baseapi.h>
.
I pointed out that from what you show there are no.h
files anywhere (that I can see).
I suggested you need to see if that file is anywhere, or sort out whatever you need to do to get it available. Assuming you need that line.
I don't use "tesseract", and I don't suppose anybody else here does either. -
It looks like what you downloaded was just the pre-built binary and associated files to use the tesseract application and not to develop your own. You will have to build the library yourself; just follow the directions that you posted above closely step by step.
-
@mchinand
So it was just a sample application? And they do not provide the.h
files with it?Does he really need to build it? IF it comes with pre-compiled external DLLs of whatever to make the (sample?) app work, can't he use those plus
.lib
s &.h
s for his own code without having to build the.dll
s? -
-
Guys, so if I do want to install close to instruction, how can I proceed with this lines?
For visual studio project using tesseract
Setup Vcpkg the Visual C++ Package Manager.
Run vcpkg install tesseract:x64-windows for 64-bit. Use –head for the master branch.
Static linkingTo build a self-contained tesseract.exe executable (without any DLLs or runtime dependencies), use Vcpkg as above with the following command:
vcpkg install tesseract:x64-windows-static for 64-bit
vcpkg install tesseract:x86-windows-static for 32-bit -
@OlegD said in Qt and Tesseract Linkage:
Run vcpkg install tesseract:x64-windows for 64-bit. Use –head for the master branch.
Did you do that?
Otherwise go ask the tesseract people. Qt people do not know anything about this package, we do not know whether it downloads e.g.
.h
files, only you/tesseract people do. -
Did you manage to install tesseract at all ?
-
What exactly did you do ?
What was the outcome ?Did you follow the documentation provided by the project itself ?
You seem to have already checked it based on one of your previous answer. However you did not explain what your issue was with them.
-
If I execute files below thay just do nothing
Download the latest SW (Software Network https://software-network.org/) client from https://software-network.org/client/. Run sw setup (may require administrator access) Run sw build org.sw.demo.google.tesseract.tesseract-master.
-
@OlegD said in Qt and Tesseract Linkage:
still saying
D:\PROG\May\Tesseract\main.cpp:1: error: tesseract/baseapi.h: No such file or directory
As I said earlier, you show no signs of having any tesseract
.h
files at all?I don't think you are reading and following all the instructions. Please do so. For example, in https://tesseract-ocr.github.io/tessdoc/Compiling.html#windows
Checkout tesseract sources
git clone https://github.com/tesseract-ocr/tesseract tesseract && cd tesseract
.I can see that would at least give you
tesseract/include/tesseract/*.h
, which is what you need..... -
@JonB said in Qt and Tesseract Linkage:
tesseract/include/tesseract/*.h
I can not run these files
Download the latest SW (Software Network https://software-network.org/) client from https://software-network.org/client/.
Run sw setup (may require administrator access)
Run sw build org.sw.demo.google.tesseract.tesseract-master