下載安裝 git for windows
建立目錄 D:/OpenCV
Clone the repository to D:\OpenCV from https://github.com/Itseez/opencv.git下載安裝 CMake
除了分別下載安裝 python35_32, python35_64, 也要下載 Source
安裝 Setuptools
下載 ez_setup.py 置於 D:\Python35 下
執行 D:\Python35>python ez_setup.py
Install Sphinx via the command:
D:\Python35\Scripts\easy_inatall.exe sphinx
安裝 NumPy
cd D:\Python35\Scripts
pip install numpy
用 VS2013 開啟 PCbuild/pcbuild.sln, 主要建立 python 專案
可以建立出32位元 PCbuild/win32/python35_d.lib並且拷貝至 Python35_32/libs 下
64位元 PCbuild/amd64/python35_d.lib並且拷貝至 Python35_64/libs 下
Download and install Miktex: http://miktex.org/.
At the fourth step make sure you select for the "Install missing packages" the Yes option.
Miktex 只使用 64位元
Download the Intel TBB library: https://www.threadingbuildingblocks.org/, 選擇 Windows 版本
Extract it.
Create a dep directory in your OpenCV folder.
And copy the extracted files here.
Do the same with the eigen files: eigen.tuxfamily.org
下載 CUDA Toolkit 8.0 選擇 Windows 版本
安裝32和64位元的 Qt5.7 for VS2013, 於不同目錄
開啟 CMake
Where is the source code: D:/OpenCV/opencv
Where to build the binaries: D:.OpenCV/build_64
按 Configure 選擇 Visual Studio 12 2013 Win64
按 Generate, 此時會產生錯誤, 需要設定下列目錄
EIGEN_INCLUDE_PATH=D:\OpenCV\dep\eigen
開啟 PYTHON3 設定正確的版本位置
PYTHON3_EXECUTABLE=D:/Python35_32/python.exe
PYTHON3_INCLUDE_DIR=D:/Python35_32/include
PYTHON3_LIBRARY=D:/Python35_32/libs/python35.lib
PYTHON3_LIBRARY_DEBUG=D:/Python35_32/libs/python35_d.lib
PYTHON3_NUMPY_INCLUDE_DIRS=D:/Python35_32/Lib/site-packages/numpy/core/include
PYTHON3_PACKAGES_PATH=D:/Python35_32/Lib/site-packages
PYTHON3_EXECUTABLE=D:/Python35_32/python.exe
PYTHON3_INCLUDE_DIR=D:/Python35_32/include
PYTHON3_LIBRARY=D:/Python35_32/libs/python35.lib
PYTHON3_LIBRARY_DEBUG=D:/Python35_32/libs/python35_d.lib
PYTHON3_NUMPY_INCLUDE_DIRS=D:/Python35_32/Lib/site-packages/numpy/core/include
PYTHON3_PACKAGES_PATH=D:/Python35_32/Lib/site-packages
開啟 WITH_QT, WITH_TBB, WITH_CUDA
按 Generate, 此時會產生錯誤, 需要設定下列目錄
按 Generate, 此時會產生錯誤, 需要設定下列目錄
QT_QMAKE_EXECUTABLE=D:/Qt/Qt5.7.0_64/5.7/msvc2013/bin/qmake.exe
Qt5Concurrent_DIR=D:/Qt/Qt5.7.0_64/5.7/msvc2013/lib/cmake/Qt5Concurrent
Qt5Core_DIR=D:/Qt/Qt5.7.0_64/5.7/msvc2013/lib/cmake/Qt5Core
Qt5Gui_DIR=D:/Qt/Qt5.7.0_64/5.7/msvc2013/lib/cmake/Qt5Gui
Qt5OpenGL_DIR=D:/Qt/Qt5.7.0_64/5.7/msvc2013/lib/cmake/Qt5OpenGL
Qt5Test_DIR=D:/Qt/Qt5.7.0_64/5.7/msvc2013/lib/cmake/Qt5Test
Qt5Widgets_DIR=D:/Qt/Qt5.7.0_64/5.7/msvc2013/lib/cmake/Qt5Widgets
TBB_INCLUDE_DIRS=D:/OpenCV/dep/tbb2017_20160916oss/include
開啟 CMake
Where is the source code: D:/OpenCV/opencv
Where to build the binaries: D:.OpenCV/build_32
按 Configure 選擇 Visual Studio 12 2013
按 Generate, 此時會產生錯誤, 需要設定下列目錄
EIGEN_INCLUDE_PATH=D:\OpenCV\dep\eigen
開啟 PYTHON3 設定正確的版本位置
開啟 WITH_QT, WITH_TBB
關閉 WITH_CUDA, 因為 CUDA 沒有 32 位元版本
按 Generate, 此時會產生錯誤, 需要設定下列目錄
QT_QMAKE_EXECUTABLE=D:/Qt/Qt5.7.0_32/5.7/msvc2013/bin/qmake.exe
Qt5Concurrent_DIR=D:/Qt/Qt5.7.0_32/5.7/msvc2013/lib/cmake/Qt5Concurrent
Qt5Core_DIR=D:/Qt/Qt5.7.0_32/5.7/msvc2013/lib/cmake/Qt5Core
Qt5Gui_DIR=D:/Qt/Qt5.7.0_32/5.7/msvc2013/lib/cmake/Qt5Gui
Qt5OpenGL_DIR=D:/Qt/Qt5.7.0_32/5.7/msvc2013/lib/cmake/Qt5OpenGL
Qt5Test_DIR=D:/Qt/Qt5.7.0_32/5.7/msvc2013/lib/cmake/Qt5Test
Qt5Widgets_DIR=D:/Qt/Qt5.7.0_32/5.7/msvc2013/lib/cmake/Qt5Widgets
TBB_INCLUDE_DIRS=D:/OpenCV/dep/tbb2017_20160916oss/include
用 VisualStudio2013 開啟 D:\OpenCV\Builds\OpenCV.sln
選擇 ALL_BUILD, Build Debug 和 Release
選擇 INSTALL, Build Debug 和 Release
沒有留言:
張貼留言