I am using OpenCv 3.4.0, Python 3.6.4, Cmake 3.10.2, OpenNI-Windows-x64-2.2, SensorKinect093-Bin-Win32-v5.1.2.1, Visual Studio 2015 and Windows 10. I want to build the cv2.pyd for Python 3.6.4.
I follow the step in many others way such as github and OpenCV install opencv_contrib on Windows
After configure in the Cmake, It shows the output about python 3 like this:
Python (for build): C:/Users/zhong/AppData/Local/Programs/Python/Python36-32/python.exe
And the Cmake havn't the BUILD_opencv_python3, PYTHON3_INCLUDE_DIR and PYTHON3_LIBRARY, so I append the Bool value of BUILD_opencv_python3 and the locations of PYTHON3_INCLUDE_DIR, PYTHON3_LIBRARY manually. The locations are as followings:
PYTHON3_EXECUTABLE C:/Users/zhong/AppData/Local/Programs/Python/Python36-32/python.exe
PYTHON3_INCLUDE_DIR C:/Users/zhong/AppData/Local/Programs/Python/Python36-32/include
PYTHON3_INCLUDE_DIR2
PYTHON3_LIBRARY C:/Users/zhong/AppData/Local/Programs/Python/Python36-32/libs/python36.lib
PYTHON3_LIBRARY_DEBUG
PYTHON3_NUMPY_INCLUDE_DIRS C:/Users/zhong/AppData/Local/Programs/Python/Python36-32/lib/site-packages/numpy/core/include
PYTHON3_PACKAGES_PATH C:/Users/zhong/AppData/Local/Programs/Python/Python36-32/Lib/site-packages
After that, Cmake can't find the Libraries of Python3, albeit it have the correct location of PYTHON3_LIBRARY. The output about Python3 in Cmake like this:
Python 3:
Interpreter: C:/Users/zhong/AppData/Local/Programs/Python/Python36-32/python.exe (ver 3.6.4)
Libraries: NO
numpy: C:/Users/zhong/AppData/Local/Programs/Python/Python36-32/lib/site-packages/numpy/core/include (ver 1.14.0)
packages path: C:/Users/zhong/AppData/Local/Programs/Python/Python36-32/Lib/site-packages
Python (for build): C:/Users/zhong/AppData/Local/Programs/Python/Python36-32/python.exe
How can I configure the python 3.6.4 with Cmake correctlly? I want to use deep camera so I have to compile the Opencv with OPENNI2.
I am looking for help how can I solve it? Thank you very much.