mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-20 04:25:42 +08:00
Merge pull request #1447 from sturkmen72:optional_dependencies
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
set(the_description "datasets framework")
|
||||
ocv_define_module(datasets opencv_core opencv_imgcodecs opencv_ml opencv_flann opencv_text WRAP python)
|
||||
ocv_define_module(datasets opencv_core opencv_imgcodecs opencv_ml opencv_flann OPTIONAL opencv_text WRAP python)
|
||||
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267) # flann, Win64
|
||||
|
@@ -39,10 +39,13 @@
|
||||
//
|
||||
//M*/
|
||||
|
||||
#include <iostream>
|
||||
#include <opencv2/opencv_modules.hpp>
|
||||
|
||||
#ifdef HAVE_OPENCV_TEXT
|
||||
|
||||
#include "opencv2/datasets/tr_chars.hpp"
|
||||
|
||||
#include <opencv2/core.hpp>
|
||||
|
||||
#include "opencv2/text.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
@@ -127,3 +130,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cerr << "OpenCV was built without text module" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // HAVE_OPENCV_TEXT
|
||||
|
@@ -39,10 +39,13 @@
|
||||
//
|
||||
//M*/
|
||||
|
||||
#include <iostream>
|
||||
#include <opencv2/opencv_modules.hpp>
|
||||
|
||||
#ifdef HAVE_OPENCV_TEXT
|
||||
|
||||
#include "opencv2/datasets/tr_icdar.hpp"
|
||||
|
||||
#include <opencv2/core.hpp>
|
||||
|
||||
#include "opencv2/text.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
@@ -50,8 +53,6 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib> // atoi
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -509,3 +510,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cerr << "OpenCV was built without text module" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // HAVE_OPENCV_TEXT
|
||||
|
@@ -39,10 +39,13 @@
|
||||
//
|
||||
//M*/
|
||||
|
||||
#include <iostream>
|
||||
#include <opencv2/opencv_modules.hpp>
|
||||
|
||||
#ifdef HAVE_OPENCV_TEXT
|
||||
|
||||
#include "opencv2/datasets/tr_svt.hpp"
|
||||
|
||||
#include <opencv2/core.hpp>
|
||||
|
||||
#include "opencv2/text.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
@@ -50,8 +53,6 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib> // atoi
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -309,3 +310,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cerr << "OpenCV was built without text module" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // HAVE_OPENCV_TEXT
|
||||
|
Reference in New Issue
Block a user