From 4d1df881ad8169e3a3f39dadb5379b8f63949ccd Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Sat, 6 Jun 2020 17:18:57 +0300 Subject: [PATCH] Created OE 32. Change OpenCV License to Apache 2 (markdown) --- OE-32.--Change-OpenCV-License-to-Apache-2.md | 86 ++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 OE-32.--Change-OpenCV-License-to-Apache-2.md diff --git a/OE-32.--Change-OpenCV-License-to-Apache-2.md b/OE-32.--Change-OpenCV-License-to-Apache-2.md new file mode 100644 index 0000000..729616a --- /dev/null +++ b/OE-32.--Change-OpenCV-License-to-Apache-2.md @@ -0,0 +1,86 @@ +## Change OpenCV license from BSD to Apache 2 + +* Author: Vadim Pisarevsky +* Link: [Raised Issue](https://github.com/opencv/opencv/issues/) +* Status: **Draft** +* Platforms: **All** +* Complexity: 1+ Man-Weeks + +## Introduction and Rationale + +From very beginning, when OpenCV was released by Intel as open-source computer vision library in 2000, it has been distributed under BSD license (https://github.com/opencv/opencv/blob/4.0.0/LICENSE), which was one of the few available options. + +GNU Public license (GPL), while being a great license for certain applications and components of open-source software, was not appropriate and still is not appropriate for OpenCV, because we wanted to not only boost research in computer vision, but also accelerate development of commercial applications, i.e. push the whole industry. + +BSD worked well for us for many years, but since the year 2000 computer vision world has changed a lot: + + * The technology is different, it's less of hand-made algorithms and more of industrial approaches and engineering. + * The market has grown significantly, with much more money and more players. + * Correspondingly, there is much more intellectual property (IP) there. Many companies, big and small, and many organizations work professionally in this area, create many new algorithms and patent many of them. + * Software landscape has changed significantly. In 2000 OpenCV was one of very few computer vision libraries available. Now there are many solutions, especially in deep learning area, that are cross-platform, efficient, have rich functionality and strong communities behind them. + * OpenCV itself has changed significantly. It used to be a small C library of classical computer vision algorithms, solely developed by one team in one company. Now it contains 1,000,000+ lines of code and 70+ modules, and about half of the code is contributed by the community. Each working day about 5 patches are integrated into the library. + +So, everything in computer vision nowadays, including OpenCV, is growing and developing fast, which is great! +On the other hand, such a rapid growth brings some potential and real issues. One issue is stability, which we mostly solved using our excellent and constantly improving Continuous Integration System and the large set of unit tests. Another issue is IP cleanness of the code. Which is as important as the reliability, especially for commercial products. That is, when people take OpenCV and use in their applications, they should have some confidence that OpenCV is robust, but also is clean. While OpenCV, just like almost any other software on a planet, cannot provide 100% guarantee of robustness and cleanness, we need to constantly work on it. As the queen in Alice in Wonderland said: _"My dear, here we must run as fast as we can, just to stay in place"_. + +There are 2 main cases when IP cleanness is violated: + * Source code under incompatible license (specifically, GPL or "non-commercial use only") is integrated into OpenCV. + * Some patented algorithm is integrated into OpenCV. + +The first issue is easier to catch and is usually easier to solve. There are some tools that we regularly run over a code base to check if we/our contributors put (my mistake) some code, distributed under incompatible with OpenCV license, to OpenCV. The databases that we use are constantly updated, and as soon as they detected some "matches", we start working to replace the problematic pieces of OpenCV with alternative implementations. + +The second issue is more difficult to catch (because of the well-known "patent contamination" problem) and is often impossible to fix because of the same problem (other than just exclude the patented algorithm). + +One may ask, why is this a problem, especially given that OpenCV is "free" library, i.e. it can be used with zero cost in any research project or product? It's the problem because OpenCV BSD license says nothing about the patents. That is, you can use OpenCV as you want, but potentially authors of the patented algorithm from OpenCV, which you use, may come to you and ask for compensation. + +## Proposed solution + +As mentioned above, it's impossible to completely solve the problem of IP cleanness of the code. +But we use a combination of several approaches to minimize it. + +First of all, OpenCV contributors should have noticed that now each OpenCV pull request includes some "checkboxes" related to the possible code license violations. That is, we ask contributors to be more responsible for the code that they put into OpenCV. + +Secondly, and this is the essence of this Evolution Proposal, we are going to change the license to Apache 2. Comparing to BSD, Apache 2 is more modern license, appeared in the era of software patents, so it's been designed to have some protection from possible legal claims. + +Here is some explanation of the patent-related parts of Apache 2 license: +https://opensource.stackexchange.com/questions/1881/against-what-does-the-apache-2-0-patent-clause-protect +https://opensource.com/article/18/2/how-make-sense-apache-2-patent-license + +In brief (here is an informal interpretation of the patent clauses): +1. When some organization or individual contributes a code under Apache 2 license, they grant users of the code a non-exclusive license to use their patents in this code. +2. When some organization or individual raise legal claims about their patent violation in Apache 2 software, they loose the license to use all other patents in this software. + +Of course, such a license does not protect against organizations who do not use this software, but just possess some patents and want to benefit from it (e.g. patent trolls), but at least it helps real users to live in peace and share their technology. + +## Impact on existing code, compatibility + +The benefits of OpenCV migration to Apache 2 are clear and, so far, there is are no visible drawbacks. +Apache 2 is now used by many projects, including Google's Android, clang, Intel's OpenVINO etc. +Just like BSD, and unlike GPL, Apache 2 does not put any restrictions on the license or openness of derived/dependent software products. + +The transition of OpenCV to Apache 2 license should happen somewhere during 2020 summertime. +opencv/LICENSE will change the text from BSD to Apache 2. There will be a separate opencv/COPYRIGHT where all the copyrights from major sponsors/contributors will be collected. + +**Important:** _There will be a notice somewhere (e.g. opencv/docs/LICENSE_CHANGE_NOTICE.txt) that since a certain moment OpenCV has changed the license with the text of the original license added. This way we formally comply with BSD license of all the past contributions and our own old patches. This should make the license change procedure legally justified._ + +OpenCV 5.0 and later versions will be released under Apache 2. +Newer versions of OpenCV 4.x, possibly starting with OpenCV 4.5, will also be released under Apache 2 license. +It's still under question whether newer versions of OpenCV 3.x will migrate to Apache 2 (maybe OpenCV 3.5?). There is some logistic problem to maintain different versions of the library under different licenses. + +For applications that use some previous releases of OpenCV no changes will be needed, of course. Applications that stated that they use OpenCV the text should probably be changed to affect the OpenCV license change. + +People/organizations who contributed their patented algorithms to OpenCV and have no objections about it, are welcome to contact us https://opencv.org. We will add their copyrights to the respective files and so they will get credits and will become official "donors" of OpenCV. + +Contributors of the new code will have to agree to contribute their code under Apache 2 license instead of BSD, which is also minor change. + +## Possible alternatives + +The only possible alternative is to keep the license, but it's not a solution of a problem but rather putting it off. Because of the increasing code base and increasing risk of legal issues, it's still preferable to do the migration as early as possible. + +## References + +1. Current license: https://github.com/opencv/opencv/blob/4.0.0/LICENSE +2. Proposed license: https://www.apache.org/licenses/LICENSE-2.0 +3. Explanation of patent clauses in Apache 2 license: https://opensource.stackexchange.com/questions/1881/against-what-does-the-apache-2-0-patent-clause-protect, +https://opensource.com/article/18/2/how-make-sense-apache-2-patent-license +4. Example of pull request with the checkboxes about the code licenses: https://github.com/opencv/opencv/pull/17000