How to get started with OpenCV?

People get excited to learn image processing and computer vision when they see the image like below.

Maybe you are also excited to learn this type of stuff. Yes you can learn it and even you can start today, just read this whole article. When I became good at C++ programming I decided to learn something new and interesting. After researching for 2-3 days I came up with two options DirectX and OpenCV, finally, I decided to learn OpenCV. What things made me learn OpenCV? and some other experiences are shared in this article. If you don’t know what is OpenCV, its full form is Open Computer Vision and it is used for image processing, computer vision. Let’s get started.

1. Why should I learn OpenCV?

There are so many reasons why should you learn OpenCV, but it will be good for them who want to deal with the points given below-
AI: People who want to learn AI, OpenCV will be one big step towards computer vision in AI, this is one of the reasons why I started learning OpenCV. You will have to learn some machine learning libraries to develop good quality of programs to detect objects, motion, characters etc. , but OpenCV will be a very important step. Combination of AI and image processing creates uncountable possibilities like self-driving cars, translation of a language using the camera, solving mathematics using the camera, virtual reality games and many more.

Photo editing software: OpenCV is not only about detecting objects and characters, but you can also use it in the development of image editing software. Crop, Filter, brightness, warp etc. all things about images can be done in OpenCV. You can also use object detection in your editing software to make it more user-friendly.

Some other reasons why should you choose OpenCV:
  • If you are bored with programming then it will be fun to learn OpenCV.
  • It is available for multiple programming languages.
  • OpenCV is better than MATLAB in computer vision because it has more functions.
  • So many resources are available to learn it.
  • It is cross-platform and free 

2. Resources and required knowledge to learn.
Programming language: Programming is the first and important thing about which we have to talk. OpenCV is available for C, C++, Java, and Python, The best one is Python and the worst one is C. Python is best because you can learn fast and it has many useful libraries like Numpy, TensorFlow, Pandas. C is worst because it will be better to use C++, C++ is more secure and it is also good for machine learning. OpenCV is supported in almost all famous operating systems Windows, Linux, Mac, iOS and Android. So, Android developers can learn OpenCV with Java and people who want to make carrier in AI should learn with Python over C++.

Required Knowledge:
I am sure you know that good knowledge(intermediate level) of at least one programming language is necessary, but there are some more important areas you have to consider like Mathematics, Image processing basics, Numpy and Matplotlib(for Python). I think high school level of mathematics is enough to learn OpenCV and people who don’t have a mathematics subject can learn about Matrices, calculus. To learn the basics of image processing there is a tutorial on, that will be enough. You will face so many difficulties while learning, I m also going to tell you how to deal with them, just keep reading.

Resources to learn: If you know how to Google then why pay for courses and books (haha). Following are resources(most of free) to learn.

  • OpenCV documentation is the best place to learn OpenCV. No need to learn by browsing their documentation website, they provide PDFs also, just Google “OpenCV Python pdf” or “OpenCV C++ pdf” and you can download the whole tutorial in PDF directly from Google.
  • provides a tutorial for OpenCV Java and they provide PDF of that tutorial also.
  • is an awesome website to learn OpenCV Python, you can buy their book on OpenCV also.
  • is also a good website for OpenCV C++ and Python.
  • Learning OpenCV by Adrian Kaehler and Gary Rost Bradksi is a nice book. The book is not free, but if you know some special tricks to Google then you can find its old edition for free.

3. The way in which you should learn.

Step 1: Choosing programing language is an important step, so choose your favorable language. Choose OpenCV Python if you want to go with AI and Web development, Java for Android development and C++ will be a good choice for desktop applications & embedded systems.

Step 2: Choose a tutorial to learn and stick to it. If you are going to learn OpenCV from free resources then OpenCV documentation is best.

Step 3: Understand it fully
You could face these three difficulties while learning: 

  • If you are new to image processing then you will face difficulties to understand things like applying kernel, histograms, color spaces etc. Wikipedia and are enough resources to understand them. As I told you above provides a tutorial to learn the basics of image processing, you can also search there.
  • There are so many functions and algorithms in OpenCV may be you will face difficulty to understand some of them. Break them in parts and understand them in deep by searching on the internet.
  • People who do n’t have some basic knowledge of Numpy and Matplotlib can learn them simultaneously with OpenCV, just learn those things which are useful to your program. For those who don't know anything about these libraries, Numpy is a Python library for advanced mathematical functions and Matplotlib is also used in Python to plot graphs and images.

Step 4: Do some exercises
Maybe you will get bored in the middle if you are learning OpenCV for fun and interest in programming. Don’t stop learning at that time, there are so many interesting things to do in OpenCV at every stage.

  • OpenCV documentation gives you exercises at the end of topics, complete them with the help of your knowledge and StackOverflow(lol).
  • and have so many blog posts on interesting topics like color detection, shape detection, OCR etc. You can follow can them.
  • You can find so many programs on Github and for practice.

If this article was helpful then you can share it and if you have any doubt then please tell us in the comments below.      

Post a Comment