The official compiled OpenCV only with the Python2 link library, Python3 's link library needs to be specially compiled by itself, the official compiled version: http://sourceforge.net/projects/opencvlibrary/files/ opencv-win/3.0.0-beta/
1. Unzip Opencv-3.0.0-beta.exe to d:/, install Cmake-2.8.12.2-win32-x86.exe, install Python3.4 (32-bit) and Python needs to be installed NumPy
2. CMake Settings:
1) cmake Select compiler for Visual Studio 10
2) Build type only need to hook the Build_opencv_python3
3) Generate OPENCV vs Project
3. Only need to compile the Bindings/opencv_python part, but the Chinese Win7 system will get the following error:
' GBK ' codec can't decode byte 0xff in position 0:illegal multibyte sequence1
Need to modify D:\opencv\sources\modules\python\src2\hdr_parser.py
1) Line 4th Add Codecs Library: Import OS, sys, RE, string, codecs
2) Line No. 737: F = Codecs.open (Hname, "R", "Utf-8")
4. Recompile the Bindings/opencv_python section with release mode to "<binaryoutput>\lib\release\cv2.pyd" and "<binaryoutput>\bin \release all DLL files under "Copy to C:\Python34\DLLs
5. Test the CV2 module:
Import= Cv2.imread ("D: \\acircles_pattern.png") Cv2.namedwindow ( "image") cv2.imshow ("image", IMG) Cv2.waitkey (0) cv2.destroyallwindows ()
Reference:
1] http://stlt1sean.blogspot.sg/2013/05/64python-cv2pyd.html
2] http://www.crifan.com/summary_python_unicodedecode_error_possible_reasons_and_solutions/
3] Http://www.360doc.com/content/14/0702/12/16740871_391447981.shtml
OpenCV 3.0.0-beta compiling support for Python3-linked libraries