2020-06-06 15:09:14 -0600 | received badge | ● Notable Question (source) |
2018-04-10 20:23:45 -0600 | received badge | ● Popular Question (source) |
2015-11-14 22:53:52 -0600 | asked a question | error: ‘create’ is not a member of ‘cv::FeatureDetector {aka cv::Feature2D}’ Ptr<FeatureDetector> detector = FeatureDetector::create("SURF") and some compiling errors for OpenCV sample code I am trying to compile the sample demo: here I have been slowly repairing different compiling errors. I have added includes for: I have also written: At the beginning of the main method. When I compile with: g++ -ggdb -I/usr/local/include/opencv -I/usr/local/include -lopencv_features2d -lopencv_highgui -lopencv_imgproc -lopencv_nonfree -lopencv_core -lopencv_flann main.cpp -o main I get the errors: main.cpp:19:38: error: ‘create’ is not a member of ‘cv::DescriptorExtractor {aka cv::Feature2D}’ Ptr<descriptorextractor> extractor = DescriptorExtractor::create("SURF"); ^ main.cpp:20:33: error: ‘create’ is not a member of ‘cv::FeatureDetector {aka cv::Feature2D}’ Ptr<featuredetector> detector = FeatureDetector::create("SURF"); ^ main.cpp: In function ‘int main(int, char**)’: main.cpp:113:21: error: ‘initModule_nonfree’ was not declared in this scope initModule_nonfree(); ^ main.cpp:130:2: error: ‘NormalBayesClassifier’ was not declared in this scope NormalBayesClassifier classifier; I am including the nonfree libraries. Is there something else I need to do to compile this properly? |