Introduction to OpenCV and NumPy
OpenCV is a computer vision and machine learning library that has been developed for more than 20 years and provides an impressive number of functionalities. Despite some inconsistencies in the API, its simplicity and the remarkable number of algorithms implemented make it an extremely popular library and an excellent choice for many situations.
OpenCV is written in C++, but there are bindings for Python, Java, and Android.
In this book, we will focus on OpenCV for Python, with all the code tested using OpenCV 4.2.
OpenCV in Python is provided by opencv-python
, which can be installed using the following command:
pip install opencv-python
OpenCV can take advantage of hardware acceleration, but to get the best performance, you might need to build it from the source code, with different flags than the default, to optimize it for your target hardware.
OpenCV and NumPy
The Python bindings use NumPy, which increases the flexibility and...