我是OpenCV的初学者,使用OpenCV 3.1.0(从OpenCV.org下载)和Mac OS X 10.9.5。
我试图运行需要 contrib.hpp 的code,然后我找到the extra modules from Github。页面上有一个命令:
$ cd <opencv_build_directory>
$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory>
$ make -j5
在我做制作之前一切都成功了,它显示没有匹配函数的错误,以便调用&#39; calibrateCamera&#39; :
[ 92%] Building CXX object modules/aruco/CMakeFiles/opencv_aruco.dir/src/aruco.cpp.o
/Users/Youko/downloads/opencv_contrib-master/modules/aruco/src/aruco.cpp:1583:12: error:
no matching function for call to 'calibrateCamera'
return calibrateCamera(processedObjectPoints, processedImagePoints, ...
^~~~~~~~~~~~~~~
/Users/Youko/downloads/opencv-3.1.0/modules/calib3d/include/opencv2/calib3d.hpp:844:21: note:
candidate function not viable: requires at most 9 arguments, but 12 were
provided
CV_EXPORTS_W double calibrateCamera( InputArrayOfArrays objectPoints,
^
1 error generated.
make[2]: *** [modules/aruco/CMakeFiles/opencv_aruco.dir/src/aruco.cpp.o] Error 1
make[1]: *** [modules/aruco/CMakeFiles/opencv_aruco.dir/all] Error 2
make: *** [all] Error 2
如果我想保留Mac OSX的版本,我想改变OpenCV的版本,所以我从Github下载了OpenCV,并试图用以下命令安装OpenCV(它是与我成功安装OpenCV 3.1.0的方式相同):
$ cd <opencv_source_directory>
$ mkdir release
$ cd release
$ cmake -G "Unix Makefiles" ..
$ make
$ sudo make install
但是当我尝试制作:
时还有另一个问题[ 44%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_decoder.cpp.o
[ 44%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_avfoundation_mac.mm.o
[ 44%] Linking CXX shared library ../../lib/libopencv_videoio.dylib
ld: framework not found CoreImage
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libopencv_videoio.3.1.0.dylib] Error 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [all] Error 2
我认为 cmake 可能有问题,所以我也尝试了以下命令,但 make 也出现了同样的错误:
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
我已经搜索了问题,似乎我必须需要 QuartzCore ,但大多数人都说它应该包含在Xcode中(我使用的是Xcode 6.2顺便说一句)。我尝试了两种方法来解决它,但我仍然不知道为什么我不能构建额外的模块。 (我认为最奇怪的问题是我无法安装从Github克隆的OpenCV,但我只想表明我尝试过这种方式,但它并不成功。)
我非常感谢任何帮助和建议!