- sudo apt-get install build-essential
- sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
- sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
- git clone https://github.com/opencv/opencv.git
- 使用CMake编译OpenCV源代码:
- 创建一个临时文件夹,用来存放生成的makefiles。Create a temporary directory, which we denote as <cmake_binary_dir>, where you want to put the generated Makefiles, project files as well the object files and output binaries.
- 进入这个临时文件夹:cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local <opencv源代码路径>
- 在这个临时文件夹下运行make -j8 # -j8 runs 8 jobs in parallel. Change 8 to number of hardware threads available.
- 运行:sudo make install
参考资料:
- https://docs.opencv.org/3.0-beta/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation
- https://docs.opencv.org/3.4.0/d7/d9f/tutorial_linux_install.html
没有评论:
发表评论
谢谢您的留言^_^