Ask Your Question
0

Building opencv 2.4.13 with opencv_contrib

asked 2016-08-01 20:58:09 -0600

paracv gravatar image

I am using Mac OS X 10.11.6. The packages for opencv_contrib I git cloned from github repository. And opencv package I took from the official website. So they should both be up to date.

My version of g++ is

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I can build OpenCV independently fine on my machine but when I include opencv_contrib. It got stuck when make, when it tries to

$ cmake -DOPENCV_EXTRA_MODULES_PATH=/Users/ssabpisa/tmp/opencv_contrib/modules ../

CMake Warning at cmake/OpenCVPackaging.cmake:23 (message):
CPACK_PACKAGE_VERSION does not match version provided by version.hpp
header!
Call Stack (most recent call first):
CMakeLists.txt:1105 (include)



$ make

[ 95%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/optical_flow.cpp.o
[ 95%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/super_resolution.cpp.o
[ 95%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/opencl_kernels.cpp.o
[ 95%] Linking CXX shared library ../../lib/libopencv_superres.dylib
[ 95%] Built target opencv_superres
[ 95%] Building CXX object modules/superres/CMakeFiles/opencv_perf_superres.dir/perf/perf_main.cpp.o
[ 96%] Building CXX object modules/superres/CMakeFiles/opencv_perf_superres.dir/perf/perf_superres.cpp.o
[ 96%] Building CXX object modules/superres/CMakeFiles/opencv_perf_superres.dir/perf/perf_superres_ocl.cpp.o
[ 96%] Linking CXX executable ../../bin/opencv_perf_superres
[ 96%] Built target opencv_perf_superres
[ 96%] Building CXX object modules/superres/CMakeFiles/opencv_test_superres.dir/test/test_main.cpp.o
[ 96%] Building CXX object modules/superres/CMakeFiles/opencv_test_superres.dir/test/test_superres.cpp.o
[ 97%] Linking CXX executable ../../bin/opencv_test_superres
[ 97%] Built target opencv_test_superres
[ 97%] Building CXX object modules/text/CMakeFiles/opencv_text.dir/src/erfilter.cpp.o
In file included from /Users/ssabpisa/tmp/opencv_contrib/modules/text/src/erfilter.cpp:43:
In file included from /Users/ssabpisa/tmp/opencv_contrib/modules/text/src/precomp.hpp:51:
In file included from /opt/local/include/tesseract/baseapi.h:36:
In file included from /opt/local/include/tesseract/tesscallback.h:22:
/opt/local/include/tesseract/host.h:104:6: warning: '_MSC_VER' is not defined,
      evaluates to 0 [-Wundef]
#if (_MSC_VER >= 1200)            //%%% vkr for VC 6.0
     ^
In file included from /Users/ssabpisa/tmp/opencv_contrib/modules/text/src/erfilter.cpp:43:
In file included from /Users/ssabpisa/tmp/opencv_contrib/modules/text/src/precomp.hpp:51:
/opt/local/include/tesseract/baseapi.h:728:14: warning: 'const' type qualifier
      on return type has no effect [-Wignored-qualifiers]
  Tesseract* const tesseract() const {
             ^~~~~~
/opt/local/include/tesseract/baseapi.h:732:17: warning: 'const' type qualifier
      on return type has no effect [-Wignored-qualifiers]
  OcrEngineMode const oem() const {
                ^~~~~~
/Users/ssabpisa/tmp/opencv_contrib/modules/text/src/erfilter.cpp:64:21: error:
      expected namespace name
using namespace cv::ml;
                ~~~~^
/Users/ssabpisa/tmp/opencv_contrib/modules/text/src/erfilter.cpp:66:21: error:
      expected namespace name
using namespace cv::ml;
                ~~~~^
/Users/ssabpisa/tmp/opencv_contrib/modules/text/src/erfilter.cpp:842:32: error:
      no matching function for call to 'abs'
            angle = 2.*CV_PI ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2016-08-01 23:54:06 -0600

berak gravatar image

you cannot build the opencv_contrib modules with 2.4.

please update your main opencv repo to master version (git clone https://github.com/opencv/opencv) and try again.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-08-01 20:58:09 -0600

Seen: 8,003 times

Last updated: Aug 01 '16