OpenCV was started at Intel in 1999 by Gary Bradsky, and the first release came out in 2000. Vadim Pisarevsky joined Gary Bradsky to manage Intel’s Russian software OpenCV team. In 2005, OpenCV was used on Stanley, the vehicle that won the 2005 DARPA Grand Challenge. Later, its active development continued under the support of Willow Garage with Gary Bradsky and Vadim Pisarevsky leading the project. OpenCV now supports a multitude of algorithms related to Computer Vision and Machine Learning and is expanding day by day.
OpenCV supports a wide variety of programming languages such as C++, Python, Java, etc., and is available on different platforms including Windows, Linux, OS X, Android, and iOS. Interfaces for high-speed GPU operations based on CUDA and OpenCL are also under active development.
OpenCV-Python is the Python API for OpenCV, combining the best qualities of the OpenCV C++ API and the Python language. OpenCV-Python is a Python wrapper for the original OpenCV C++ implementation.
OpenCV-Python makes use of Numpy, which is a highly optimized library for numerical operations with a MATLAB-style syntax. All the OpenCV array structures are converted to and from Numpy arrays. This also makes it easier to integrate with other libraries that use Numpy such as SciPy and Matplotlib.
How to install OpenCV on Windows?
To install OpenCV on windows following package are required
- Python 3
Best and easiest way to install these package and many other important package like scikit-learn( which is a machine learning library) is to use anaconda distribution.
How to install Anaconda Distribution
Anaconda (“Anaconda Distribution“) is a free, easy-to-install package manager, environment manager, Python distribution, and collection of over 720 open source packages with free community support. Hundreds more open source packages and their dependencies can be installed with a simple “ conda install [packagename] ”. It’s platform-agnostic, can be used on Windows, OS X and Linux. Or even easier, with new Anaconda Navigator for point and click install of environments and packages!
To install Anaconda Distribution
- Download the Anaconda installer.
- Double click the Anaconda installer and follow the prompts to install to the default location.
- Install Anaconda into a path that does not contain spaces or unicode characters.
- Do not install as Administrator unless you didn’t have admin privilege.
- If you encounter any issues during installation, please temporarily disable your anti-virus software during install, then immediately re-enable it. If you have installed for all users, uninstall Anaconda and re-install it for your user only and try again.
After a successful installation you will see output like this:
Now to install OpenCV
- Open the command prompt with admin rights.
- run the following commands conda install -c menpo opencv3=3.2.0
To check successful installation of OpenCV run the following command:
import cv2, print(cv2.__version__)
If the results are printed out without any errors, congratulations !!! You have installed OpenCV-Python successfully.
This article is contributed by Ram Kripal. If you like eLgo Academy and would like to contribute, you can mail your article to firstname.lastname@example.org. See your article appearing on the eLgo Academy page and help other Geeks. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.