Computer Vision(open CV) vs deep learning

Object detection can be done using open CV and deep learning. But I and not able to get what’s the difference between the two. Deep learning involves training which enables it to learn and detect objects. How does the openCV does that? Are there some kind of models trained in it?

Hi, @Mohammad_Hamza !

As they state in their official website, OpenCV is an open source computer vision and machine learning software library.
Deep Learning, in the other hand, is a broader term that describes all the methods and algorithms that try to learn patterns from data.

So, we could say that Deep Learning is the general concept and OpenCV is a tool we can use to apply DL to computer vision tasks

so can we say that cv2 used pre-trained weights and functions from deep learning to do object detection?

Hey @Mohammad_Hamza,

Yes, to my understanding, OpenCV’s DNN module is only for inference so it has to use pre-trained weights and existing model architecture for functionalities such as object detection and more. In other words, you won’t be able to train a model with OpenCV alone.

OpenCV is a very good integrated library for visual works providing many well-known methods other than deep learning. For example, if you have a new project which is to build a software to detect a spherical object’s movement, instead of training a neural network that detects a circular object, you may use just HoughCircles of OpenCV to do the job. Rather than a “black-box-like” approach offered by a DNN, the openCV’s methods are mathematics such as Hough transformation which makes it understandable, easily adjustable, simpler, faster, and without the need of training. Besides HoughCircles for circles, OpenCV provides other shape detection algorithms, and even other algorithms such as image processing and more.

You can speed things up and your software can consume less memory with OpenCV’s methods rather than a DNN, if your project does not get very complicated image involved.