# If we sell a product with OpenCV and it’s dependencies, do we need to make our code GPL?

**URL:** <https://forum.opencv.org/t/if-we-sell-a-product-with-opencv-and-it-s-dependencies-do-we-need-to-make-our-code-gpl/6206>\
**Category:** Uncategorized\
**Tags:** legal\
**Created:** [November 14, 2021, 6:52pm UTC](https://forum.opencv.org/t/if-we-sell-a-product-with-opencv-and-it-s-dependencies-do-we-need-to-make-our-code-gpl/6206 "2021-11-14T18:52:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max\_Zheng](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/max_zheng/32/1684_2.png) [@Max\_Zheng](https://forum.opencv.org/u/Max_Zheng)\
**Post date:** [November 14, 2021, 6:52pm UTC](https://forum.opencv.org/t/if-we-sell-a-product-with-opencv-and-it-s-dependencies-do-we-need-to-make-our-code-gpl/6206/1 "2021-11-14T18:52:35Z")

</div>

Hi! This question is not related to programming. I can’t get any clear answer from anywhere else so I’m trying my luck here.

I’m trying to figure out if we can sell a hardware product with OpenCV and it’s dependencies pre-installed without making our code GPL. Although OpenCV itself is not GPL, some packages OpenCV depends on are under GPL. And since we are selling a proprietary device (instead of a service), we are required to make our code GPL if we are using GPL software. Does anyone know if this is accurate? If so, is there anyway to get around it? How do all the hardware startups deal with this matter?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [November 14, 2021, 8:19pm UTC](https://forum.opencv.org/t/if-we-sell-a-product-with-opencv-and-it-s-dependencies-do-we-need-to-make-our-code-gpl/6206/2 "2021-11-14T20:19:11Z")

</div>

I can’t “answer” legal questions because it’s a minefield.

however…

> **[License - OpenCV](https://opencv.org/license/)**
>
> The OpenCV library is licensed under two different licenses depending on the version of the library. The rationale behind changing OpenCV license from 3-clause BSD to Apache 2 is explained in this post. OpenCV 4.5.0 and higher OpenCV 4.5.0 and higher...

so you probably _don’t_ need to open your source.

you mention third party libraries used by OpenCV.

you may be able to live without a dependency that gives you trouble.

pay attention to any of those dependencies being **L** GPL.

also, if they’re linked _dynamically_, they can be GPL and not affect your application.

I can’t comment on specifics because that’d require knowing the dependency and its license.

you better talk to a lawyer for answers you can build a business on.

---

<div class="post-metadata">

**Author:** ![Max\_Zheng](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/max_zheng/32/1684_2.png) [@Max\_Zheng](https://forum.opencv.org/u/Max_Zheng)\
**Post date:** [November 21, 2021, 7:24pm UTC](https://forum.opencv.org/t/if-we-sell-a-product-with-opencv-and-it-s-dependencies-do-we-need-to-make-our-code-gpl/6206/3 "2021-11-21T19:24:19Z")

</div>

Thanks for the reply @crackwitz!

I’m wondering why is OpenCV not GPL/LGPL given that it depends on some GPL/LGPL packages. E.g. libopencv depends on QT which is LGPL in Conda environment.

Also, when I read the FAQ of GPL, it says dynamic link doesn’t make a difference regarding this matter. [Frequently Asked Questions about the GNU Licenses - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-faq.en.html#GPLStaticVsDynamic)

Regarding LGPL - Why should I pay more attention to it? From my reading, LGPL seems less restrictive than GPL.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [November 21, 2021, 7:36pm UTC](https://forum.opencv.org/t/if-we-sell-a-product-with-opencv-and-it-s-dependencies-do-we-need-to-make-our-code-gpl/6206/4 "2021-11-21T19:36:04Z")

</div>

> [@Max\_Zheng](#):
>
> libopencv depends on QT

not true.  
you _may_ enhance your opencv app with qt gui, but it’s not a requirement to run computer-vision algorithms

> [@Max\_Zheng](#):
>
> depends on QT which is LGPL in Conda environment.

opencv is a c++ library, whatever happens “in Conda environment” is out of control for the opencv devs (not maintained by them).  
if conda ships gpl’d components, – there’s your problem  
you should probably build (&distribute) your own cv2 to avoid problematic libs
