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 versions are licensed under the Apache 2 License.
OpenCV 4.4.0 and lower
OpenCV 4.4.0 and lower versions, including OpenCV 3.x, OpenCV 2.x, and OpenCV 1.x, are licensed under the 3-clause BSD license.
By downloading, copying, installing or using the software you agree to this license. If you do not agree to this license, do not download, install, copy or use the software.