Introduction to OpenCV
OpenCV is a cross-platform computer vision library released under the BSD license (open source), which can run on Linux, Windows, Android and Mac OS operating systems. It is lightweight and efficient—consisting of a series of C functions and a small number of C++ classes, it also provides interfaces to languages such as Python, Ruby, and MATLAB, and implements many common algorithms in image processing and computer vision.
OpenCV is written in C++, and its main interface is also C++, but it still retains a large number of C language interfaces. The library also has a large number of Python, Java and MATLAB/OCTAVE (version 2.5) interfaces. The API interface functions of these languages can be obtained through online documentation. Now it also provides support for C#, Ch, Ruby, GO.
OpenCV has a cross-platform middle and high-level API including more than 500 C functions. It does not depend on other external libraries-although some external libraries can also be used.
All new developments and algorithms use C++ interface. A GPU interface using CUDA was also implemented in September 2010.
OpenCV provides a transparent interface for Intel Integrated Performance Primitives (IPP). This means that if there are IPP libraries optimized for a specific processor, OpenCV will automatically load these libraries at runtime.
Note: The code of OpenCV version 2.0 has been significantly optimized and does not require IPP to improve performance. Therefore, version 2.0 no longer provides an IPP interface.
**Okay, let’s start today’s text below. **
Install python-3.7.3-amd64.exe
Enter the command line under Scripts in your Python installation directory: D:\Program Files\Python37\Scripts
Install pip
Enter the Scripts path under the Python installation directory and execute easy_install.exe pip
Install wheel
Enter the Scripts path under the Python installation directory and execute pip install wheel
Install numpy
Enter the Scripts path under the Python installation directory and execute pip install numpy
Install opencv
Enter the Scripts path under the Python installation directory and execute pip install opencv-python
Microsoft Windows [Version 10.0.17134.706](c)2018 Microsoft Corporation. all rights reserved.
C:\Users\LiuJing D:
D:\ cd D:\Program Files\Python37\Scripts
D:\Program Files\Python37\Scripts easy_install.exe pip
Searching for pip
Best match: pip 19.0.3
Adding pip 19.0.3 to easy-install.pth file
Installing pip-script.py script to d:\program files\python37\Scripts
Installing pip.exe script to d:\program files\python37\Scripts
Installing pip3-script.py script to d:\program files\python37\Scripts
Installing pip3.exe script to d:\program files\python37\Scripts
Installing pip3.7-script.py script to d:\program files\python37\Scripts
Installing pip3.7.exe script to d:\program files\python37\Scripts
Using d:\program files\python37\lib\site-packages
Processing dependencies for pip
Finished processing dependencies for pip
D:\Program Files\Python37\Scripts pip install wheel
Collecting wheel
Downloading https://files.pythonhosted.org/packages/96/ba/a4702cbb6a3a485239fbe9525443446203f00771af9ac000fa3ef2788201/wheel-0.33.1-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.33.1
You are using pip version 19.0.3, however version 19.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
D:\Program Files\Python37\Scripts pip install numpy
Collecting numpy
Downloading https://files.pythonhosted.org/packages/4e/9d/c129d78e6b942303b762ccfdf1f8339de80c5e6021b14ef0c99ec5bdc6aa/numpy-1.16.3-cp37-cp37m-win_amd64.whl(11.9MB)100%|████████████████████████████████|11.9MB 197kB/s
Installing collected packages: numpy
Successfully installed numpy-1.16.3
You are using pip version 19.0.3, however version 19.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
D:\Program Files\Python37\Scripts pip install opencv-python
Collecting opencv-python
Downloading https://files.pythonhosted.org/packages/a3/50/04d0669afe884f137c2f490642756e8c4a658254300a9eaf253d1e643085/opencv_python-4.1.0.25-cp37-cp37m-win_amd64.whl(37.3MB)100%|████████████████████████████████|37.4MB 150kB/s
Requirement already satisfied: numpy =1.14.5in d:\program files\python37\lib\site-packages(from opencv-python)(1.16.3)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.1.0.25
You are using pip version 19.0.3, however version 19.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
D:\Program Files\Python37\Scripts
import cv2
img = cv2.imread("01.jpg")
cv2.imshow("1", img)
cv2.waitKey(10000)
If the picture can be imported and displayed, it is successful
to sum up
So far this article on the sample code of Python installation of OpenCV is introduced. For more related Python installation of OpenCV, please search for previous articles on ZaLou.Cn or continue to browse related articles below. Hope you will support ZaLou.Cn more in the future!
Recommended Posts