OPEN CV
What is OPEN CV?
OpenCV is a huge open-source library for computer vision, machine learning, and image processing. OpenCV supports a wide variety of programming languages like Python, C++, Java, etc. It can process images and videos to identify objects, faces, or even the handwriting of a human. When it is integrated with various libraries, such as Numpy
which is a highly optimized library for numerical operations, then the number of weapons increases in your Arsenal i.e. whatever operations one can do in Numpy can be combined with OpenCV.
What is OpenCV Python?
OpenCV is an open-source library for computer vision, deep learning, and image processing. Images and videos can be processed to identify objects, faces, and even someone's handwriting. Numpy, a highly optimized library for math operations in Python, increases the number of basic operations that can be done when combined with OpenCV.
OpenCV supports various programming languages such as Python, C++, C, Java, MATLAB, etc. Libraries like OpenCV are written in C++ and they call C/C++ libraries, which slows down Python. OpenCV allows its users to get the development advantages of Python while optimizing the performance of C++.
OpenCV is a cross-platform library that enables the development of real-time computer vision applications. It can be leveraged for different types of digital images, be it a color image or even a grayscale image. OpenCV can run and be installed on any Python IDE, such as a terminal (IDLE), Anaconda Prompt (jupyter), Google-collab, VS Code, PyCharm, etc.
How to install OpenCV for Python?
Now that you have understood what the OpenCV library in Python is, let us learn to set up OpenCV-Python in different operating systems including Windows, Linux, and Fedora.
To install OpenCV, Python, and PIP must be pre-installed on your system. To check if your system already has Python, follow these steps:
Open the Command line or cmd (Command prompt) in your system. and run the command:
python --version
It will return the version of python installed in your system.
PIP is a package management system for installing and managing software packages/libraries written in Python. These files are stored in a large "online repository" called the Python Package Index (PyPI).
How to Use OpenCV in Python?
The first version of OpenCV was 1.0. OpenCV is released under the BSD license, so it is free for both academic and commercial use. It has C++, C, Python, and Java interfaces and supports Windows, Linux, Mac OS, iOS, and Android. When OpenCV was designed, the focus was on real-time applications for computational efficiency. All codes for OpenCV are written in optimized C/C++ to take advantage of multi-core processing.
Knowledge of Numpy is mandatory to write optimized code in OpenCV Python. To use OpenCV in Python, you should import the cv library in your Python environment, and then you're good to go. You can leverage its various inbuilt classifiers and frameworks and implement them for designing image-processing-based solutions in your computer vision project.
Packages for standard desktop environments (Windows, macOS, and almost all GNU/Linux distributions) are as follows:
Type 1 - main module package:
pip install opencv-python
Type 2 - full package (main and contrib/extra modules including both) :
pip install opencv-contrib-python (check contrib/additional modules)
Remember to execute the cells one by one, and make sure to have the necessary image file at the specified path.
Feel free to adapt this code to perform other image processing tasks using OpenCV in Jupyter Notebook
Comments
Post a Comment