magwyz / pastec

Image recognition open source index and search engine
http://pastec.io
GNU Lesser General Public License v3.0
620 stars 175 forks source link

error: invalid cast to abstract class type ‘cv::ORB’ #39

Closed svenstaro closed 7 years ago

svenstaro commented 8 years ago

While compiling this on Arch Linux against opencv 3.1.0 I get this:

[svenstaro:~/src/pastec/build] dist-ver(+2/-2) ± make
[  9%] Building CXX object CMakeFiles/pastec.dir/src/orb/orbfeatureextractor.cpp.o
/home/svenstaro/src/pastec/src/orb/orbfeatureextractor.cpp: In member function ‘virtual u_int32_t ORBFeatureExtractor::processNewImage(unsigned int, unsigned int, char*, unsigned int&)’:
/home/svenstaro/src/pastec/src/orb/orbfeatureextractor.cpp:53:24: error: invalid cast to abstract class type ‘cv::ORB’
     ORB(2000, 1.02, 100)(img, noArray(), keypoints, descriptors);
                        ^
In file included from /usr/include/opencv2/features2d/features2d.hpp:48:0,
                 from /home/svenstaro/src/pastec/src/orb/orbfeatureextractor.cpp:28:
/usr/include/opencv2/features2d.hpp:254:20: note:   because the following virtual functions are pure within ‘cv::ORB’:
 class CV_EXPORTS_W ORB : public Feature2D
                    ^
/usr/include/opencv2/features2d.hpp:292:26: note:   virtual void cv::ORB::setMaxFeatures(int)
     CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0;
                          ^
/usr/include/opencv2/features2d.hpp:293:25: note:   virtual int cv::ORB::getMaxFeatures() const
     CV_WRAP virtual int getMaxFeatures() const = 0;
                         ^
/usr/include/opencv2/features2d.hpp:295:26: note:   virtual void cv::ORB::setScaleFactor(double)
     CV_WRAP virtual void setScaleFactor(double scaleFactor) = 0;
                          ^
/usr/include/opencv2/features2d.hpp:296:28: note:   virtual double cv::ORB::getScaleFactor() const
     CV_WRAP virtual double getScaleFactor() const = 0;
                            ^
/usr/include/opencv2/features2d.hpp:298:26: note:   virtual void cv::ORB::setNLevels(int)
     CV_WRAP virtual void setNLevels(int nlevels) = 0;
                          ^
/usr/include/opencv2/features2d.hpp:299:25: note:   virtual int cv::ORB::getNLevels() const
     CV_WRAP virtual int getNLevels() const = 0;
                         ^
/usr/include/opencv2/features2d.hpp:301:26: note:   virtual void cv::ORB::setEdgeThreshold(int)
     CV_WRAP virtual void setEdgeThreshold(int edgeThreshold) = 0;
                          ^
/usr/include/opencv2/features2d.hpp:302:25: note:   virtual int cv::ORB::getEdgeThreshold() const
     CV_WRAP virtual int getEdgeThreshold() const = 0;
                         ^
/usr/include/opencv2/features2d.hpp:304:26: note:   virtual void cv::ORB::setFirstLevel(int)
     CV_WRAP virtual void setFirstLevel(int firstLevel) = 0;
                          ^
/usr/include/opencv2/features2d.hpp:305:25: note:   virtual int cv::ORB::getFirstLevel() const
     CV_WRAP virtual int getFirstLevel() const = 0;
                         ^
/usr/include/opencv2/features2d.hpp:307:26: note:   virtual void cv::ORB::setWTA_K(int)
     CV_WRAP virtual void setWTA_K(int wta_k) = 0;
                          ^
/usr/include/opencv2/features2d.hpp:308:25: note:   virtual int cv::ORB::getWTA_K() const
     CV_WRAP virtual int getWTA_K() const = 0;
                         ^
/usr/include/opencv2/features2d.hpp:310:26: note:   virtual void cv::ORB::setScoreType(int)
     CV_WRAP virtual void setScoreType(int scoreType) = 0;
                          ^
/usr/include/opencv2/features2d.hpp:311:25: note:   virtual int cv::ORB::getScoreType() const
     CV_WRAP virtual int getScoreType() const = 0;
                         ^
/usr/include/opencv2/features2d.hpp:313:26: note:   virtual void cv::ORB::setPatchSize(int)
     CV_WRAP virtual void setPatchSize(int patchSize) = 0;
                          ^
/usr/include/opencv2/features2d.hpp:314:25: note:   virtual int cv::ORB::getPatchSize() const
     CV_WRAP virtual int getPatchSize() const = 0;
                         ^
/usr/include/opencv2/features2d.hpp:316:26: note:   virtual void cv::ORB::setFastThreshold(int)
     CV_WRAP virtual void setFastThreshold(int fastThreshold) = 0;
                          ^
/usr/include/opencv2/features2d.hpp:317:25: note:   virtual int cv::ORB::getFastThreshold() const
     CV_WRAP virtual int getFastThreshold() const = 0;
                         ^
CMakeFiles/pastec.dir/build.make:206: recipe for target 'CMakeFiles/pastec.dir/src/orb/orbfeatureextractor.cpp.o' failed
make[2]: *** [CMakeFiles/pastec.dir/src/orb/orbfeatureextractor.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pastec.dir/all' failed
make[1]: *** [CMakeFiles/pastec.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
derekchan commented 8 years ago

Pastec is written for OpenCV 2.x API, which is different from OpenCV 3.1

Try building it against OpenCV 2.3 or 2.4 and it should work.