1. Introduction to opencv python
What you'll know in this post.
- What is OpenCV?
- Why python?
- How to configure OpenCV in windows.
Lets get started,
Are you working on any project that uses image processing? that's why you are here i suppose.
So what is OpenCV?
- Well OpenCV is (Open Source Computer Vision Library), here computer vision is total different thing than Image processing so dont get confused between two terms.
- In opencv you process your image according to your requirements, like converting image to black & white or object detection in image so there are lots of application. we will see that step by step.
OpenCV is originally written in C++, but we will be using Python to work with OpenCV.
So why python?
Well python is my friend now days a very popular programming language, due to its less coding features it provides flexibility for space time complexities. Still python is not faster than c++, because python eventually converts its OpenCV function calls to c++ and c++ executes the actual code and returns the result, this converting and executing process, we will call it as python bindings.
Ok, so now you know what is opencv.
Now how to configure OpenCV on windows?
(for linux you need to compile the source code, we will see that in future, for now go for further reading)
There are two way to configure your PC with OpenCV.
- Download OpenCV source Code and compile it using cmake and Visual Studio.
- Download Anaconda Version of Python and install OpenCV with command line.
Well we will take advantage of windows platform, and we will keep our hands clear by not compiling OpenCV source and making lots of mistakes, well if you want to compile the source code let me know in comments, i'll make new post on how to compile OpenCV source code.
Download following file.
https://www.anaconda.com/download/
Now there are two version of python
- Python 2.x
- Python 3.x
Keep in mind that these two version have lot different in syntax and other things, please refer to python original documentation for the difference.
We will chose python 3.x version for our OpenCV installation.
So download Anaconda python 3.x version according to your requirements like 32-bit or 64-bit version.
Once you downloaded install it by default setting do not change anything. if there is any option that says add conda to your PATH environment, please make sure you enable that option.
Once you complete installation of conda.
Open Command Prompt by windows + R key. and type cmd and press ok.
This will open cmd window.
Now its time to Install opencv on your conda python enviroment.
To do that paste the following command in your command prompt window.
- conda install -c conda-forge opencv
This will install opencv in your machine, it will take time to download and install, please make sure you have enough internet data, and speed.
For creating python files and editing i'm using Sublime Text, you can use Notepad++ also.
here are the links.
- https://www.sublimetext.com/3
- https://notepad-plus-plus.org/
In next post we will see how to run your first OpenCV program.
Tags: opencv, python, getting started, opencvpython,windows,python
Tags: opencv, python, getting started, opencvpython,windows,python
ReplyDeleteI would like to share this article with my friends and colleagus.
Java Training in Chennai
ReactJS Training in Chennai
AngularJS Training in Chennai
Python Training in Chennai
Python Training institute in Chennai
Sorry mirnalini for late response, please do check the blogs again, i'll update the new content.
Delete