Where are the opencv2 include files?

2019-03-18 04:57发布

I'm struggling to find the include files that should be in a directory names "opencv2"! I've downloaded OpenCV-2.4.0.tar.bz2 from here and extracted the files and ran cmake, which seemed to build the library successfully.

The problem is that under the "include" directory for "opencv2" there seem to be tons of header files missing. The only header file there at the moment is "opencv.hpp", which includes a whole set of other files which aren't there. Does anyone have any idea where I can get these files from?

Picture of the "opencv2" directory.

Thanks!

2条回答
小情绪 Triste *
2楼-- · 2019-03-18 05:29

In case you were using cmake-gui and visual studio on Windows to make opencv (I had 3.4.0), don't forget to build this project:

enter image description here

This will generate all required files in a single folder, so you can easily connect header files:

enter image description here

查看更多
再贱就再见
3楼-- · 2019-03-18 05:34

The header files of the modules are in their own directories. E.g., you can find calib3d.hpp in /modules/calib3d/include/opencv2/calib3d. The Makefile created by CMake knows these addresses, hence when you make install the header files are all copied into /usr/local/include/opencv2.

查看更多
登录 后发表回答