Surprisingly, it took a lot of time to find out how to install OpenCV 3.4. As a result, I downloaded and installed the Wheel package from an unofficial location. If you are interested in the process, please read the last one. I changed the title because I confirmed that it can be installed in the same way with OpenCV 4.0 and Python 3.7 (2018/12/25) </ sup> Since OpenCV3.4 came out, the part that was OpenCV3.3 was renewed (2018/3/8) </ sup>
The following is an article I tried after installation.
-[Explanation for beginners] openCV face detection mechanism and practice (detectMultiScale) -Specify parameters in openCV face detection to quickly improve detection accuracy -Face detection from multiple image files with openCV and cut out and saved
* OpenCV3.4 was not on Anaconda Cloud as of 3/4/2018 </ sup>
type | version |
---|---|
OS | Windows10 Professional 64bit |
Anaconda3 | Anaconda 5.0.1 |
Python | Python3.6(Anaconda virtual environment) |
It is a prerequisite before installation. Anaconda3 5.0.1 is already installed in my environment (Windows 10 64bit). Please refer to the separate article "Installing TensorFlow on Windows was easy even for Python beginners" for the installation procedure of Anaconda.
Click "opencv_python-3.4.1-cp36-cp36m-win_amd64.whl" from link to download the Wheel package. I will. * Please select the version you want to use as appropriate </ sup>
Launch Anaconda Navigator from the Windows menu. Similar to Apache Ambari.
Enter "openCV" as the virtual environment name and select Python 3.6.
Open a terminal from the virtual environment.
Change the directory to the location where you downloaded the Wheel package in the steps of "1. Wheel Package Download".
cd C:\Users\yohei.fukuhara\Downloads
Install with pip.
pip install opencv_python‑3.4.1‑cp36‑cp36m‑win_amd64.whl
The installation was successful without any problems.
If you don't have numpy, you will get an error, so install it. I haven't investigated it in detail, but there was information that matplotlib is similar, so I will install it for the time being.
conda install numpy
pip install matplotlib
Installation is successful.
Confirm the installation of openCV2. Start python.
python
Import the openCV library and view the version.
import cv2
print(cv2.__version__)
There seems to be no problem!
Please see only those who are interested. This is what I checked when it was OpenCV 3.2. </ sup>
~~ First, I searched for Anaconda Cloud, but there is no openCV3.3 for Windows ... 3.2 was in conda-forge.
When I searched on Stackoverflow, there was an answer!["Installing opencv on Windows 10 with python 3.6 and anaconda 3.6"](https://stackoverflow.com/questions/42994813/installing-opencv-on-windows-10-with-python-3-6-and-anaconda- 3-6) and that's exactly what it is: grin:
However, the source of dropping the Wheel package I felt suspicious, so check it just in case. It seems to be the site of Professor Christopher of the University of California, Irvine. There is also a name on the official website, so it should be okay ... Others seem to be using it for the same purpose as introduced in the article "Installing OpenCV 3.2 and Python 3.6 on Windows 10". is.
Recommended Posts