Made samples build independent from nonfree module.
(cherry picked from commit bba8c0beac)
This commit is contained in:
@@ -34,15 +34,27 @@
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#include <opencv2/nonfree/features2d.hpp>
|
||||
#include <opencv2/legacy/legacy.hpp>
|
||||
#ifndef HAVE_OPENCV_NONFREE
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
std::cout << "The sample requires nonfree module that is not available in your OpenCV distribution." << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# include <string>
|
||||
# include <vector>
|
||||
|
||||
# include <opencv2/core/core.hpp>
|
||||
# include <opencv2/highgui/highgui.hpp>
|
||||
# include <opencv2/features2d/features2d.hpp>
|
||||
# include <opencv2/nonfree/features2d.hpp>
|
||||
# include <opencv2/legacy/legacy.hpp>
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@@ -126,3 +138,5 @@ int main( int argc, char** argv ) {
|
||||
imshow("matches", imgMatch);
|
||||
waitKey(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user