Installing OpenCV and NumPy

To install NumPy for your Python distribution using the pip package manager, run the following command:

pip install numpy

If, however, you are using Anaconda/Miniconda to manage your packages, run the following command:

conda install numpy

Installing OpenCV might be more complicated, depending on your operating system. The easiest option is to have Anaconda handle the installation process by following this guide (https://anaconda.org/conda-forge/opencv) after installing Anaconda (https://www.anaconda.com/download/) as your main Python package manager. If, however, you are not using Anaconda, the main option for installing OpenCV is to follow its official documentation guide, which can be found at https://docs.opencv.org/master/df/d65/tutorial_table_of_content_introduction.html. After successfully installing OpenCV, open a Python interpreter and try importing the library, as follows:

>>> import cv2
>>> print(cv2.__version__)
3.1.0

We import OpenCV using the name cv2, which is the library alias of OpenCV in Python. The success message indicates the version of my OpenCV library that has been downloaded (3.1.0).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.4.179