Because of the needs of the graduation project, I use python3+opencv to do human tracking in the video. After installing python and opencv, there are a bunch of errors when running the program, such as:
module'cv2.face' has no attribute'createEigenFaceRecognizer', in short, I have encountered many modules'cv2.face' has no attribute'***'. Later, after a lot of Baidu, it took nearly a week, and finally the problem was solved. After so many experiences, I always feel that I was wasting so much time on the development environment. I really shouldn't. So I wrote an article to tell later people how to solve the problem of the development environment in a short time and prevent me from making mistakes like this again. Just follow my steps to install it, there is no problem.
Native operating system: win10
1. Install Anaconda3-4.4.0
https://repo.continuum.io/archive/Anaconda3-4.4.0-Windows-x86_64.exe
The default installation is fine, there is no special operation that needs to be emphasized here
2. Install the opencv+contrib package
opencv_contrib_python-3.2.0.7-cp36-cp36m-win_amd64.whl
After the download is complete, copy it to the installed Anaconda3-4.4.0 directory. Then open cmd and execute the following command:
>cd C:\ProgramData\Anaconda3 //这里是你具体的安装路径
>pip install opencv_python-3.2.0+contrib-cp36-cp36m-win_amd64.whl
>pip install opencv_python-3.2.0+contrib-cp36-cp36m-win_amd64.whl
It is best to use administrator privileges to perform operations, and you can do it after installation is complete
3. Test the code
Download this code for a simple test:
https://github.com/leiqing110/Moving-target-detection.git
https://github.com/leiqing110/Moving-target-detection.git
If there is something wrong with the above article, you are welcome to point it out to me and make progress together, thank you