compiler error about opencv ?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

compiler error about opencv ?

yincanben
Hi,Mathieu,
I want to export pose, so I want to set up new version. I got some error like that:

/home/ycb15/rtabmap/corelib/src/Features2d.cpp: In member function ‘virtual void rtabmap::SURF::parseParameters(const ParametersMap&)’:
/home/ycb15/rtabmap/corelib/src/Features2d.cpp:500:136: error: invalid use of incomplete type ‘CV_SURF_GPU {aka class cv::gpu::SURF_GPU}’
   _gpuSurf = cv::Ptr<CV_SURF_GPU>(new CV_SURF_GPU(hessianThreshold_, nOctaves_, nOctaveLayers_, extended_, gpuKeypointsRatio_, upright_));
                                                                                                                                        ^
In file included from /home/ycb15/rtabmap/corelib/src/Features2d.cpp:28:0:
/home/ycb15/rtabmap/corelib/src/../include/rtabmap/core/Features2d.h:44:8: error: forward declaration of ‘CV_SURF_GPU {aka class cv::gpu::SURF_GPU}’
  class SURF_GPU;
        ^
/home/ycb15/rtabmap/corelib/src/Features2d.cpp:505:105: error: invalid use of incomplete type ‘CV_SURF {aka class cv::SURF}’
   _surf = cv::Ptr<CV_SURF>(new CV_SURF(hessianThreshold_, nOctaves_, nOctaveLayers_, extended_, upright_));
                                                                                                         ^
In file included from /home/ycb15/rtabmap/corelib/src/Features2d.cpp:28:0:
/home/ycb15/rtabmap/corelib/src/../include/rtabmap/core/Features2d.h:41:7: error: forward declaration of ‘CV_SURF {aka class cv::SURF}’
 class SURF;
       ^
/home/ycb15/rtabmap/corelib/src/Features2d.cpp: In member function ‘virtual std::vector<cv::KeyPoint> rtabmap::SURF::generateKeypointsImpl(const cv::Mat&, const Rect&) const’:
/home/ycb15/rtabmap/corelib/src/Features2d.cpp:526:55: error: no match for call to ‘(cv::gpu::SURF_GPU) (cv::gpu::GpuMat&, cv::gpu::GpuMat, std::vector<cv::KeyPoint>&)’
   (*_gpuSurf.obj)(imgGpu, cv::gpu::GpuMat(), keypoints);
                                                       ^
/home/ycb15/rtabmap/corelib/src/Features2d.cpp:534:8: error: invalid use of incomplete type ‘const class cv::SURF’
   _surf->detect(imgRoi, keypoints);
        ^
In file included from /home/ycb15/rtabmap/corelib/src/Features2d.cpp:28:0:
/home/ycb15/rtabmap/corelib/src/../include/rtabmap/core/Features2d.h:41:7: error: forward declaration of ‘const class cv::SURF’
 class SURF;
       ^
/home/ycb15/rtabmap/corelib/src/Features2d.cpp: In member function ‘virtual cv::Mat rtabmap::SURF::generateDescriptorsImpl(const cv::Mat&, std::vector<cv::KeyPoint>&) const’:
/home/ycb15/rtabmap/corelib/src/Features2d.cpp:552:77: error: no match for call to ‘(cv::gpu::SURF_GPU) (cv::gpu::GpuMat&, cv::gpu::GpuMat, std::vector<cv::KeyPoint>&, cv::gpu::GpuMat&, bool)’
   (*_gpuSurf.obj)(imgGpu, cv::gpu::GpuMat(), keypoints, descriptorsGPU, true);
                                                                             ^
/home/ycb15/rtabmap/corelib/src/Features2d.cpp:571:8: error: invalid use of incomplete type ‘const class cv::SURF’
   _surf->compute(image, keypoints, descriptors);
        ^
In file included from /home/ycb15/rtabmap/corelib/src/Features2d.cpp:28:0:
/home/ycb15/rtabmap/corelib/src/../include/rtabmap/core/Features2d.h:41:7: error: forward declaration of ‘const class cv::SURF’
 class SURF;
       ^
/home/ycb15/rtabmap/corelib/src/Features2d.cpp: In member function ‘virtual void rtabmap::SIFT::parseParameters(const ParametersMap&)’:
/home/ycb15/rtabmap/corelib/src/Features2d.cpp:609:109: error: invalid use of incomplete type ‘CV_SIFT {aka class cv::SIFT}’
  _sift = cv::Ptr<CV_SIFT>(new CV_SIFT(nfeatures_, nOctaveLayers_, contrastThreshold_, edgeThreshold_, sigma_));
                                                                                                             ^
In file included from /home/ycb15/rtabmap/corelib/src/Features2d.cpp:28:0:
/home/ycb15/rtabmap/corelib/src/../include/rtabmap/core/Features2d.h:42:7: error: forward declaration of ‘CV_SIFT {aka class cv::SIFT}’
 class SIFT;
       ^
/home/ycb15/rtabmap/corelib/src/Features2d.cpp: In member function ‘virtual std::vector<cv::KeyPoint> rtabmap::SIFT::generateKeypointsImpl(const cv::Mat&, const Rect&) const’:
/home/ycb15/rtabmap/corelib/src/Features2d.cpp:624:7: error: invalid use of incomplete type ‘const class cv::SIFT’
  _sift->detect(imgRoi, keypoints); // Opencv keypoints
       ^
In file included from /home/ycb15/rtabmap/corelib/src/Features2d.cpp:28:0:
/home/ycb15/rtabmap/corelib/src/../include/rtabmap/core/Features2d.h:42:7: error: forward declaration of ‘const class cv::SIFT’
 class SIFT;
       ^
/home/ycb15/rtabmap/corelib/src/Features2d.cpp: In member function ‘virtual cv::Mat rtabmap::SIFT::generateDescriptorsImpl(const cv::Mat&, std::vector<cv::KeyPoint>&) const’:
/home/ycb15/rtabmap/corelib/src/Features2d.cpp:636:7: error: invalid use of incomplete type ‘const class cv::SIFT’
  _sift->compute(image, keypoints, descriptors);
       ^
In file included from /home/ycb15/rtabmap/corelib/src/Features2d.cpp:28:0:
/home/ycb15/rtabmap/corelib/src/../include/rtabmap/core/Features2d.h:42:7: error: forward declaration of ‘const class cv::SIFT’
 class SIFT;
       ^
make[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/Features2d.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/all] Error 2
make: *** [all] Error 2
Reply | Threaded
Open this post in threaded view
|

Re: compiler error about opencv ?

matlabbe
Administrator
Hi,
Which OpenCV version are you using? Can you show the output of cmake? If you don't have OpenCV installed with SURF/SIFT, there is then a problem with the CMake flag telling if OpenCV is built with nonfree module.

Try clearing the cache:
$ cd rtabmap/build
$ rm CMackeCache.txt
$ cmake ..
$ make

cheers
Reply | Threaded
Open this post in threaded view
|

Re: compiler error about opencv ?

yincanben
I use opencv with Version 2.4.11, The result is that I run cmake:
cmake -DCMAKE_INSTALL_PREFIX=~/catkin_ws/devel ..
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- checking for module 'eigen3'
--   found eigen3, version 3.2.0
-- Found eigen: /usr/include/eigen3  
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- Found openni: /usr/lib/libOpenNI.so  
-- Found libusb-1.0: /usr/include  
-- checking for module 'flann'
--   found flann, version 1.8.4
-- Found Flann: /usr/lib/x86_64-linux-gnu/libflann_cpp_s.a  
-- Found qhull: /usr/lib/x86_64-linux-gnu/libqhull.so  
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- Found PCL_COMMON: /usr/local/lib/libpcl_common.so  
-- Found PCL_OCTREE: /usr/local/lib/libpcl_octree.so  
-- Found PCL_IO: /usr/local/lib/libpcl_io.so  
-- Found PCL_KDTREE: /usr/local/lib/libpcl_kdtree.so  
-- Found PCL_SEARCH: /usr/local/lib/libpcl_search.so  
-- Found PCL_SAMPLE_CONSENSUS: /usr/local/lib/libpcl_sample_consensus.so  
-- Found PCL_FILTERS: /usr/local/lib/libpcl_filters.so  
-- Found PCL_GEOMETRY: /usr/local/include/pcl-1.7  
-- Found PCL_FEATURES: /usr/local/lib/libpcl_features.so  
-- Found PCL_SEGMENTATION: /usr/local/lib/libpcl_segmentation.so  
-- Found PCL_SURFACE: /usr/local/lib/libpcl_surface.so  
-- Found PCL_REGISTRATION: /usr/local/lib/libpcl_registration.so  
-- Found PCL_RECOGNITION: /usr/local/lib/libpcl_recognition.so  
-- Found PCL_KEYPOINTS: /usr/local/lib/libpcl_keypoints.so  
-- Found PCL_VISUALIZATION: /usr/local/lib/libpcl_visualization.so  
-- Found PCL_OUTOFCORE: /usr/local/lib/libpcl_outofcore.so  
-- Found PCL_PEOPLE: /usr/local/lib/libpcl_people.so  
-- Found PCL_TRACKING: /usr/local/lib/libpcl_tracking.so  
-- Found OpenCV: /usr/local/include/opencv;/usr/local/include
-- Found PCL: /usr/local/include/pcl-1.7;/usr/include/eigen3;/usr/include;/usr/include/ni;/usr/include/vtk-5.8
-- Found ZLIB: /usr/include
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake (found version "4.8.6")
-- Found QVTK: /usr/lib/libQVTK.so  
-- Found Freenect: /opt/ros/indigo/include/libfreenect
-- Found OpenNI2: /usr/include/openni2
-- Found DC1394: /usr/include/dc1394
-- Could NOT find CSPARSE (missing:  CSPARSE_INCLUDE_DIR CSPARSE_LIBRARY)
CMake Warning at CMakeLists.txt:210 (FIND_PACKAGE):
  By not providing "Findcvsba.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "cvsba", but
  CMake did not find one.

  Could not find a package configuration file provided by "cvsba" with any of
  the following names:

    cvsbaConfig.cmake
    cvsba-config.cmake

  Add the installation prefix of "cvsba" to CMAKE_PREFIX_PATH or set
  "cvsba_DIR" to a directory containing one of the above files.  If "cvsba"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Found Pthreads
-- --------------------------------------------
-- Info :
--   CMAKE_INSTALL_PREFIX = /home/ycb15/catkin_ws/devel
--   CMAKE_BUILD_TYPE = Release
--   BUILD_SHARED_LIBS = ON
--   With OpenCV 2 nonfree module (SIFT/SURF) = YES
--   With Freenect             = YES
--   With OpenNI2              = YES
--   With Freenect2            = NO (libfreenect2 not found)
--   With dc1394               = YES
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)
--   With g2o                  = NO (g2o not found)
--   With GTSAM                = NO (GTSAM not found)
--   With cvsba                = NO (cvsba not found)
--   With Qt                   = YES (version 4)
-- --------------------------------------------
-- Configuring done
-- Generating done
Reply | Threaded
Open this post in threaded view
|

Re: compiler error about opencv ?

matlabbe
Administrator
Can you show the contents of this file?
$ cat /usr/local/include/opencv2/opencv_modules.hpp
/*
 *      ** File generated automatically, do not modify **
 *
 * This file defines the list of modules available in current build configuration
 *
 *
*/

#define HAVE_OPENCV_CALIB3D
#define HAVE_OPENCV_CONTRIB
#define HAVE_OPENCV_CORE
#define HAVE_OPENCV_FEATURES2D
#define HAVE_OPENCV_FLANN
#define HAVE_OPENCV_GPU
#define HAVE_OPENCV_HIGHGUI
#define HAVE_OPENCV_IMGPROC
#define HAVE_OPENCV_LEGACY
#define HAVE_OPENCV_ML
#define HAVE_OPENCV_NONFREE
#define HAVE_OPENCV_OBJDETECT
#define HAVE_OPENCV_OCL
#define HAVE_OPENCV_PHOTO
#define HAVE_OPENCV_STITCHING
#define HAVE_OPENCV_SUPERRES
#define HAVE_OPENCV_TS
#define HAVE_OPENCV_VIDEO
#define HAVE_OPENCV_VIDEOSTAB
Note the "HAVE_OPENCV_NONFREE", which is used here in rtabmap to include SIFT and SURF includes.
Reply | Threaded
Open this post in threaded view
|

Re: compiler error about opencv ?

yincanben
 cat /usr/local/include/opencv2/opencv_modules.hpp
/*
 *      ** File generated automatically, do not modify **
 *
 * This file defines the list of modules available in current build configuration
 *
 *
*/

#define HAVE_OPENCV_CALIB3D
#define HAVE_OPENCV_CONTRIB
#define HAVE_OPENCV_CORE
#define HAVE_OPENCV_FEATURES2D
#define HAVE_OPENCV_FLANN
#define HAVE_OPENCV_GPU
#define HAVE_OPENCV_HIGHGUI
#define HAVE_OPENCV_IMGPROC
#define HAVE_OPENCV_LEGACY
#define HAVE_OPENCV_ML
#define HAVE_OPENCV_NONFREE
#define HAVE_OPENCV_OBJDETECT
#define HAVE_OPENCV_PHOTO
#define HAVE_OPENCV_STITCHING
#define HAVE_OPENCV_SUPERRES
#define HAVE_OPENCV_TS
#define HAVE_OPENCV_VIDEO
#define HAVE_OPENCV_VIDEOSTAB