Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-free opencv_contrib modules are not available #51

Closed
espdev opened this issue Oct 10, 2017 · 4 comments
Closed

Non-free opencv_contrib modules are not available #51

espdev opened this issue Oct 10, 2017 · 4 comments

Comments

@espdev
Copy link

espdev commented Oct 10, 2017

I try to use opencv-contrib-python wheel package from PyPI

Expected behaviour

import cv2
out_img = cv2.xphoto.bm3dDenoising(inp_img)
# No any errors

Actual behaviour

I get the following error

cv2.error: C:\projects\opencv-python\opencv_contrib\modules\xphoto\src\bm3d_image_denoising.cpp:341: error: (-213) This algorithm is patented and is excluded in this configuration;Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function cv::xphoto::bm3dDenoising
@techdragon
Copy link
Contributor

@espdev unfortunately the pre-built wheel can't include this.

This is similar to why work on #49 and #50 has to build LGPL versions of FFmpeg. Some things are just not safe for developers like us to distribute without the risks of legal repercussions. Pre-built Wheels will not be able to include these components.

Future work on an sdist might be able to mitigate this by performing the compilation on end users machine and thus not distributing potentially infringing software. But the focus of work here has been on building Wheels that enable users to install OpenCV without the need to spend the time compiling OpenCV.

@skvark Might have more to say. But I feel like I had a good answer for you since I'm digging around on the FFmpeg issues which have similar legal related constraints. My apologies if I've overstepped here in what is effectively answering for you ( @skvark ) as the project owner.

@skvark
Copy link
Member

skvark commented Oct 12, 2017

OpenCV cmake recipe has enable-nonfree flag but it's currently off. As @techdragon explained above, I'm not sure if we can distribute the modules protected by that flag. This would require lawyer advice.

Note: despite the flag being off there might be some other modules included in opencv-contrib-python which belong to the same "non-free" category. If that's the case it's because OpenCV developers haven't protected them with that macro.

@espdev
Copy link
Author

espdev commented Oct 12, 2017

@techdragon @skvark Thank you for your replies! You are right.

I think I could build the wheel package for myself with needed opencv cmake-flag but I do not know how to build this project (opencv-python) correctly.

@skvark
Copy link
Member

skvark commented Oct 31, 2017

Currently you can build custom versions only by forking the project and changing builds flags. On Appveyor the build artifacts can be downloaded after the build from the Appveyor service.

At some point it will also possible to build the package locally, see this issue: #43

@skvark skvark closed this as completed Oct 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants