Python install OpenCV sample code

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

Python install OpenCV sample code
Centos6 install Python2.7.13
Centos7 install Python 3.6.
ubuntu18.04 install python2
CentOS install Python 3.6
ubuntu12.04 install python3
Centos7 install Python2.7
Centos install Python3
CentOS6.8 install python2.7
ubuntu18.04 install python
Install python3.6 under Ubuntu 16.04
Ubuntu18.04 install opencv 3.2.0 solution
Install Python3 on Ubuntu 14.04
Python SMS bombing code
Install python in Ubuntu
Install Python3 on Ubuntu 16.04
Install Python3.7 on Ubuntu
Python code to find bugs (2)
Python code to find bugs(7)
How to comment python code
centos7 install python3 and ipython
Ubuntu install the latest Python 3.
Python code to find bugs(4)
Python code to find bugs (3)
Python code to find bugs(9)
Install Python 3.7 on Ubuntu 18.04 LTS
Python drawing rose implementation code
ubuntu18.04 compile and install python3.8
OpenCV Python implements puzzle games
CentOS7 install python3 and pip3
Python implements code block folding
Python code to find bugs(6)
CentOS 6.9 compile and install python
Python code to find bugs (1)
Python code to find bugs(8)
python opencv for image stitching
Python implements verification code recognition
Centos6 install python3 pip3 ipython3
Python code to find bugs(5)
Python version of OpenCV installation
Is python code case sensitive
CentOS 6 compile and install python 3
Python telnet login function implementation code
python how to view webpage code
Python is a cross-platform language code
Python ATM function implementation code example
How to install Python 3.8 on CentOS 8
How to install opencv3.0.0 on ubuntu14.04
Install python package using Douban source
How to install Python on CentOS 8
Install Python3 and ansible under CentOS8
Install the latest OpenCV4.3 under Centos8
Install Python virtual environment on Ubuntu 18.04
Install TensorFlow (python2.7 version) on Ubuntu
Gray-level co-occurrence matrix (with python code)
CentOS 7 install gogs git code server
Install Python3 and Py under CentOS7
How to install OpenCV on Ubuntu 20.04
How to install OpenCV on CentOS 8
Python tcp transmission code example analysis
Python handles operation code to execl