Mac OSX: build opencv_contrib fatal error: file not found opencv2/core.hpp

佐手、 提交于 2019-12-12 02:06:28

问题


I've been trying to set up opencv_contrib (https://github.com/Itseez/opencv_contrib) on my Mac, but can't get past this problem. Below I've copied the steps I've taken and the current error output.

Steps:

1 - Download opencv 2.4.10 and opencv_contrib. Unzip both into a new empty directory. File structure is newfolder/opencv-2.4.10, newfolder/opencv_contrib

2 - make a build director in opencv-2.4.10. File structure is newfolder/opencv-2.4.10/build

3 - cd build

4 - Run the following commands

cmake -G "Unix Makefiles" -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
make -j8

At that point I get the following output partway through the make:

Scanning dependencies of target opencv_surface_matching
[ 25%] Building CXX object modules/surface_matching/CMakeFiles/opencv_surface_matching.dir/src/icp.cpp.o
In file included from <path to folder>/newfolder/opencv_contrib/modules/surface_matching/src/icp.cpp:41:
In file included from <path to folder>/newfolder/opencv_contrib/modules/surface_matching/src/precomp.hpp:45:

<path to newfolder>/newfolder/opencv_contrib/modules/surface_matching/include/opencv2/surface_matching/ppf_match_3d.hpp:62:10: fatal error:
  'opencv2/core.hpp' file not found

I'm not sure what to do to fix this, I've been following the directions on installation almost verbatim. The one change is the addition of -G "Unix Makefiles" (which I got from here http://tilomitra.com/opencv-on-mac-osx/ based on my success when originally installing opencv standalone).

In the past I've been able to install opencv without opencv_contrib without issue.

Thanks for any ideas on what I can do to figure this out!


回答1:


you need opencv3.0 to make use of the opencv_contrib repo.

the header organization was changed in 3.0, what would be opencv2/core/core.hpp in 2.4 is now opencv2/core.hpp (that's your missing file)



来源:https://stackoverflow.com/questions/28222067/mac-osx-build-opencv-contrib-fatal-error-file-not-found-opencv2-core-hpp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!