I'm trying to build opencv-4.5.1 with tesseract-5.0.0 using cmake under Windows 10. First, I built tesseract with C++17 (by default) as static lib. Then, when configuring opencv, cmake issues the message:
Tesseract: YES (ver 5.0.0-alpha-20201231)
Can't use Tesseract (details: https://github.com/opencv/opencv_contrib/pull/2220)
Looking closely at the opencv flags I found that it was configured with C++11. Then I rebuilt tesseract with C++11 support, but this error persists. As a result, opencv is built, but when creating an OCRTesseract object, a message is displayed that tesseract was not found.
Then I tried the older tesseract-4.1.0 version. It is labeled LSTM. The error persisted.
What moment did I miss?
Related
I'm trying to run this code:
https://github.com/snukky/news-translit-nmt
I've installed boost and got the following messages:
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
C:\Program Files\boost\boost_1_67_0
The following directory should be added to linker library paths:
C:\Program Files\boost\boost_1_67_0\stage\lib
By the comment of #kenba I've added the following environment variables:
Try 1
When I try to run the following cmd:
cmake .. -DCMAKE_BUILD_TYPE=Release
I get:
-- Could NOT find Boost (missing: timer iostreams filesystem system chrono) (found version "1.67.0")
CMake Error at CMakeLists.txt:290 (message):
Cannot find Boost libraries. Terminating.
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Configuring incomplete, errors occurred!
See also "D:/ThesisResources/previous_works/news-translit-nmt-master/tools/marian-dev/build/CMakeFiles/CMakeOutput.log".
Try 2
When I try to give a custom boost by this ref
https://marian-nmt.github.io/docs/#custom-boost:
I run the following cmd:
cmake .. -DBOOST_ROOT="C:\Program Files\boost\boost_1_67_0"
I get the same error.
I've also tried working with Linux WSL (But problems with CUDA installation overthere, their team is working on it), Linux VirtualBox (Not enough resources), and Ubuntu 17.10 I have installed (But Cuda requires Ubuntu 16.04 / 18.04)
What am I missing here? I'm trying any suggestion, stuck on it for a few days. Thanks!
Edit:
I reinstalled Ubuntu 16.04 and the problem was solved. Still don't know how to solve it in windows, but i'll continue use Ubuntu 16.04.
I had this problem earlier while trying to build the Windows version of Marian NMT (the same component that you're having trouble with). I can't remember the exact steps to solve the problem, but the root cause is that the Marian NMT build for Windows does not work with newer versions of Boost, since the source code uses some deprecated calling conventions for timer and chrono libraries (maybe some others as well).
The error message kind of confirms this: it can't find Boost, but on the other hand it says it finds your version 1.67.0. The solution is to use an older version of boost, I've confirmed that it works with 1.60.0.
If you just require a Marian NMT decoder that works in Windows, a project I work on has released a plugin for the Trados Studio translation tool, which contains a compiled marian-decoder executable for Windows: https://object.pouta.csc.fi/fiskmo/TradosStudio/FiskmoTranslationProvider.sdlplugin. You can access the executable by unzipping the sdlplugin file, the StartMtPipe.bat shows how to use the decoder.
I'm using tensorflow 1.4 & qt in ubuntu 16.04. The problem is when I include tensorflow(version: 1.4) and opencv (version: 3.2.0) simultaneously, protobuf is conflicted. The error msg is as follows:
[libprotobuf FATAL external/protobuf_archive/src/google/protobuf/stubs/common.cc:79] This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.4.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/build/mir-O8_xaj/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.4.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/build/mir-O8_xaj/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)
I learnt from some place that opencv with gtk-3.x will use protobuf 2.6.1 which caused the above problem, and installing opencv with gtk-2.x will not depend on protobuf. And part of the opencv cmake msg is as follows, cmake use gtk 3.x automaticly.
GUI:
-- QT: NO
-- GTK+ 3.x: YES (ver 3.18.9)
-- GThread : YES (ver 2.48.2)
-- GtkGlExt: NO
-- OpenGL support: NO
-- VTK support: NO
And the system gtk information is as follows:
$ pkg-config --modversion gtk+-2.0
$ 2.24.30
Here is the problem.How I can install opencv with gtk 2.x using cmake?
For me you just need to install the required dependency, which is a version of protobuf compatible with 2.6.1.
A quick search on packages.ubuntu.com shows that the package libprotobuf9v5 provides protocol buffers C++ library and is in version 2.6.1. Just try to install this.
BTW, going back in the past using outdated technologies like GTK+2 is a bad move. If you really want to change your toolkit, selecting it is just a matter of defining the right options on the cmake call. In the toplevel CMakeLists.txt one can easily find WITH_GTK, WITH_GTK2, and WITH_QT options. Enable them on the command line call to cmake, or using cmake-gui And if you're already using Qt yourself, just rebuild using the Qt backend instead of an old GTK one.
I try to build openCV with Extramodules. If I try to configure the projectfiles (vc14 x32 on windows 10) with cmake there's the error:
CMake Error at opencv_contrib-master/modules/xfeatures2d/cmake/download_vgg.cmake:13 (ocv_download):
Unknown CMake command "ocv_download".
Did anyone ever have this problem and knows how to solve it?
The simple answer is you are using incompatible versions of opencv and opencv_contrib, you might be installing current version of opencv_contrib on maybe opencv2.4.xx
Well, the download link for opencv contrib in CMake script https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d now is 400: Invalid request.
From the commit https://github.com/opencv/opencv_contrib/commit/593e78c5d084aa0a29eb1e0459fc7f7a4dd52ea8 you can try to ignore the added line in CMakeLists include(cmake/download_vgg.cmake) and rebuild.
The below is basing on my experience, I'm not sure it will works for OpenCV 3.0.
Maybe you can try to clone opencv contrib from git, then copy it to somewhere (for example modules directory in opencv source code). Then use CMAKE to set OPENCV_EXTRA_MODULES_PATH. If the hash is correct then it won't download and use the offline package.
I have try and build success OpenCV 2.x with IPP.
Hope it help.
Just follow instructions here.
Make sure you have active internet connection while building Opencv with contrib module.
When you hit config button on cmake(gui), it downloads other files like
vgg_generated_...
boostdesc_binboost_...
boostdesc_lbgm.i
P.S: i compiled Opencv 3.1 with contrib. Cmake downloaded required files & configure was Done.
I'm using Visual Studio 2010, OpenCV 2.4.5, and QT 5.0.2.
I'm trying to deploy my application by loading static libraries of OpenCV and QT.
The problem is that both of them contain zlib (compression library) internally.
So, when I compile the project, link error occurs, since symbols are conflicted as below.
zlibd.lib(zutil.obj) : error LNK2005: _z_errmsg is already defined in Qt5Cored.lib(zutil.obj).
However, both of OpenCV and QT do not provide static library without zlib.
What can I do?
Take a look at the OpenCV installation guide. It says, "You can use Qt as HighGUI backend on any platforms (Windows, Linux, Mac) by passing WITH_QT=ON to CMake when configuring OpenCV." The guide also has a link to a step-by-step guide.
So, do these steps and add WITH_QT=ON to your OpenCV configuration.
I'm trying to include a recent version of OpenCV into an existing iOS project and am having linker errors because my XCode project is set to use libstdc++ and not libc++ / C++ 11 support.
I have seen several other people who have fixed their errors by enabling libc++. Examples:
Linker errors after upgrading Xcode to 4.5.2 and OpenCV to 2.4.3
How to resolve iOS Link errors with OpenCV
However, I NEED to use libstdc++ because I have other 3rd party libraries which are already compiled with the older stdlib (can't be changed). Is there a way to compile OpenCV 2.4.3+ without -stdlib=libc++ ? Are there special flags to pass to CMake? or to the build_framework.py script that comes in the ios folder of the OpenCV source code?
Alternatively, does anyone have a binary version available? It seems all downloadable from OpenCV assume libc++ / C++11.
In the source for openCV locate this file:
ios/cmake/Modules/Platform/iOS.cmake
Change this line:
set (CMAKE_CXX_FLAGS "-stdlib=libc++ -headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden")
to:
set (CMAKE_CXX_FLAGS "-stdlib=libstdc++ -headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden")
Compile using the python script
ios/build_framework.py
Then you should be good to go
I have just tried this on 2.4.3 source, swapped in the resulting framework on an existing project, changed the C++ standard library for the project to libstdc++ and it runs fine.
I am also working on a project using OpenCV and a 3rd party library which requires libstdc++.
As I just ran into this problem myself, I wanted to share what worked for me.
I was able to get OpenCV working by adding "libc++.dylib" to my project.
Build Phases -> "Link Binary with Libraries" -> "+" -> libc++.dylib
For reference, I am using OpenCV 2.4.9 (opencv-2.4.9) from opencv.org. I compiled it using the ios platform build_framework.py per the instructions in OpenCV's docs. No modification necessary.