LTPTextDetector icon indicating copy to clipboard operation
LTPTextDetector copied to clipboard

failed to compile from bin/classify

Open eric-lee-ltk opened this issue 11 years ago • 2 comments

when compiling this project, I encountered the following error: Linking CXX executable bin/classify /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference to cv::FeatureDetector::~FeatureDetector()' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference tocv::FeatureDetector::~FeatureDetector()' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference to cv::FeatureDetector::~FeatureDetector()' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference toCvRTrees::CvRTrees()' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference to CvMLData::get_values() const' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference tocv::FeatureDetector::empty() const' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference to CvMLData::read_csv(char const*)' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference toCvMLData::~CvMLData()' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference to CvMLData::set_delimiter(char)' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference toCvMLData::CvMLData()' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference to cv::HOGDescriptor::computeGradient(cv::Mat const&, cv::Mat&, cv::Mat&, cv::Size_<int>, cv::Size_<int>) const' /tmp/LTPTextDetector/3rdparty/.././libtext_detect.so: undefined reference totypeinfo for cv::FeatureDetector' collect2: error: ld returned 1 exit status make[2]: *** [bin/classify] Error 1 make[1]: *** [CMakeFiles/bin/classify.dir/all] Error 2 make: *** [all] Error 2

And I have tried all version of OpenCV from 2.4.0 to 2.4.10, but it turned out the same result.

eric-lee-ltk avatar Oct 27 '14 07:10 eric-lee-ltk

seems that adding header #include <opencv2/nonfree/nonfree.hpp> and adding cv::initModule_nonfree(); in the beginning of main function of the following files will solve the problem, classify.cpp extract_mser_cc.cpp extract_hog_features.cpp extract_dists.cpp extract_cc_features.cpp extract_adjacent_neighbors.cpp demo.cpp create_boxes.cpp

By the way, directly install libopencv-dev in Ubuntu will not install the nonfree part of OpenCV, so we need to install OpenCV from source code.

eric-lee-ltk avatar Oct 27 '14 11:10 eric-lee-ltk

What is the boost version used in this project?

MathewLi9527 avatar Jan 04 '15 12:01 MathewLi9527