When using the Python language for image processing, we often use anaconda. This software is powerful and integrates a lot of useful python dependencies including numpy,pandas,matplotlib and so on. In addition, the inside with the Jupyter visual editor is also very useful, strongly recommended, it is more interactive, convenient for us to debug the code. Of course, anaconda with graphics and image processing module pil,but It is not very good, for a image processing, OPENCV must be used, it is a good open source library. So, how to integrate the OpenCV in the Anaconda, the following I will tidy up the process for your reference:
1 Install Anaconda, this is good under the official net, the installment process is fool type.
Https://www.continuum.io/downloads
2 installation OpenCV, this installation is also very convenient, to the official website next package extracts the file can be.
Http://opencv.org/downloads.html
Remember, use OPENCV words in the computer's advanced settings, click on the environment variable, set OPENCV path, tell the computer where to find this library.
3 Copy paste Cv2.pyd file
Find Anaconda This path C:\Anaconda2\Lib\site-packages, each computer is not the same, which contains Python to call the package, so we want to import cv2, obviously, also want to put the corresponding file here
Then find the OpenCV corresponding path C:\opencv\build\python\2.7\x64 (note 64-bit and 32-bit different), Then copy the Cv2.pyd file, paste it into the Anaconda path above, restart the computer (if it is the first time set OPENCV environment variables), try the DOS inside can invoke the command:
Import Cv2
If you can, prove OK.