Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Building opencv 2.4.13 with opencv_contrib

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 + abs(angle);
                               ^~~
/Users/ssabpisa/tmp/opencv-2.4.13/modules/core/include/opencv2/core/mat.hpp:1413:20: note:
      candidate function not viable: no known conversion from 'double' to
      'const cv::Mat' for 1st argument
CV_EXPORTS MatExpr abs(const Mat& m);
                   ^
/Users/ssabpisa/tmp/opencv-2.4.13/modules/core/include/opencv2/core/mat.hpp:1414:20: note:
      candidate function not viable: no known conversion from 'double' to
      'const cv::MatExpr' for 1st argument
CV_EXPORTS MatExpr abs(const MatExpr& e);