# Computer Vision(open CV) vs deep learning

**URL:** <https://community.deeplearning.ai/t/computer-vision-open-cv-vs-deep-learning/204065>\
**Category:** AI Discussions\
**Created:** [September 14, 2022, 9:44am UTC](https://community.deeplearning.ai/t/computer-vision-open-cv-vs-deep-learning/204065 "2022-09-14T09:44:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammad\_Hamza](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Mohammad\_Hamza](https://community.deeplearning.ai/u/Mohammad_Hamza)\
**Post date:** [September 14, 2022, 9:44am UTC](https://community.deeplearning.ai/t/computer-vision-open-cv-vs-deep-learning/204065/1 "2022-09-14T09:44:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![alvaroramajo](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/alvaroramajo/32/17572_2.png) [@alvaroramajo](https://community.deeplearning.ai/u/alvaroramajo)\
**Post date:** [September 14, 2022, 7:29pm UTC](https://community.deeplearning.ai/t/computer-vision-open-cv-vs-deep-learning/204065/2 "2022-09-14T19:29:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mohammad\_Hamza](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Mohammad\_Hamza](https://community.deeplearning.ai/u/Mohammad_Hamza)\
**Post date:** [September 14, 2022, 8:30pm UTC](https://community.deeplearning.ai/t/computer-vision-open-cv-vs-deep-learning/204065/3 "2022-09-14T20:30:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rmwkwok](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/rmwkwok/32/126977_2.png) [@rmwkwok](https://community.deeplearning.ai/u/rmwkwok)\
**Post date:** [September 15, 2022, 1:28am UTC](https://community.deeplearning.ai/t/computer-vision-open-cv-vs-deep-learning/204065/4 "2022-09-15T01:28:08Z")

</div>

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.

Raymond
