Made samples build independent from nonfree module.
(cherry picked from commit bba8c0beac)
This commit is contained in:
@@ -7,16 +7,28 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/nonfree/nonfree.hpp"
|
||||
#include "opencv2/legacy/legacy.hpp"
|
||||
#include "opencv2/legacy/compat.hpp"
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef HAVE_OPENCV_NONFREE
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
printf("The sample requires nonfree module that is not available in your OpenCV distribution.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# include "opencv2/imgproc/imgproc.hpp"
|
||||
# include "opencv2/features2d/features2d.hpp"
|
||||
# include "opencv2/highgui/highgui.hpp"
|
||||
# include "opencv2/imgproc/imgproc_c.h"
|
||||
# include "opencv2/nonfree/nonfree.hpp"
|
||||
# include "opencv2/legacy/legacy.hpp"
|
||||
# include "opencv2/legacy/compat.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
|
||||
static void help()
|
||||
{
|
||||
@@ -116,3 +128,5 @@ Mat DrawCorrespondences(const Mat& img1, const vector<KeyPoint>& features1, cons
|
||||
|
||||
return img_corr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user