diff --git a/samples/cpp/tutorial_code/xfeatures2D/LATCH_match.cpp b/samples/cpp/tutorial_code/xfeatures2D/LATCH_match.cpp index a9413b871..2fd0bb9b3 100644 --- a/samples/cpp/tutorial_code/xfeatures2D/LATCH_match.cpp +++ b/samples/cpp/tutorial_code/xfeatures2D/LATCH_match.cpp @@ -1,9 +1,14 @@ +#include + +#include "opencv2/opencv_modules.hpp" + +#ifdef HAVE_OPENCV_XFEATURES2D + #include #include #include #include #include -#include // If you find this code useful, please add a reference to the following paper in your work: // Gil Levi and Tal Hassner, "LATCH: Learned Arrangements of Three Patch Codes", arXiv preprint arXiv:1501.03719, 15 Jan. 2015 @@ -90,3 +95,13 @@ int main(void) cout << endl; return 0; } + +#else + +int main() +{ + std::cerr << "OpenCV was built without xfeatures2d module" << std::endl; + return 0; +} + +#endif