opencv/opencv_contrib

xfeatures2d module built with SURF and SIFT even when OPENCV_ENABLE_NONFREE is disabled

SwooshyCueb opened this issue · 4 comments

When setting OPENCV_ENABLE_NONFREE to false, the SURF and SIFT bits of the xfeatures2d module are still built. It is my understanding that these bits are patented and require licensing if they are to be used, so they should only be built if OPENCV_ENABLE_NONFREE is set to true.

berak commented

what would be better:

  • hiding the SIFT & SURF classes completely (conditional compilation)
  • throw a runtime exception in the create() function, similar to here

strike that. the 1st option is not feasible, because all those #ifdefs would seep out into the main opencv branch, too (think of the tutorials/samples using this)

I agree! I might be able to work on a pull request for this soon-ish.

Isn't #442 a free (or at least authorized) implementation? Wouldn't that be even better?

berak commented

@drzraf , it's the algorithm, which is patented, not the implementation. (so, same problem there, imho)