hengli / camodocal

CamOdoCal: Automatic Intrinsic and Extrinsic Calibration of a Rig with Multiple Generic Cameras and Odometry
Other
1.16k stars 389 forks source link

Build fails with OpenCV 4.4 #104

Open walchko opened 4 years ago

walchko commented 4 years ago

I tried to build this on my Mac (10.15.5), but had issues. I get a lot of errors complaining about CvPoint which was the legacy C code and should now be cv::Ppoint instead.

[  7%] Building CXX object src/brisk/thirdparty/agast/CMakeFiles/agast.dir/src/AstDetector.o
/Users/kevin/tmp/camodocal/src/brisk/thirdparty/agast/src/AstDetector.cc:48:51: error: 
      member access into incomplete type 'const std::__1::__vector_base<CvPoint,
      std::__1::allocator<CvPoint> >::value_type' (aka 'const CvPoint')
        scores[n] = cornerScore(i + corners_all[n].y*xsize + corners_all[n].x);
                                                  ^
/Users/kevin/tmp/camodocal/src/brisk/thirdparty/agast/include/agast/AstDetector.h:25:8: note: 
      forward declaration of 'CvPoint'
struct CvPoint;

Is there any intention of updating the code base ... there are lot of other errors and warnings like this one:

/Users/kevin/tmp/camodocal/src/brisk/thirdparty/agast/src/agast5_8.cc:44:2: warning: 
      'register' storage class specifier is deprecated and incompatible with
      C++17 [-Wdeprecated-register]
        register int_fast16_t offset0, offset1, offset2, offset3, offset...
Xingjian-Jan commented 3 years ago

Hi @walchko , I also met this problem. Did you find a way to resolve this? I'm using opencv 3.2.4. Thanks!

walchko commented 3 years ago

no I didn't ... sorry

Xingjian-Jan commented 3 years ago

Ahh, no worry. I will let you know if I find the solution. But thank you anyway!

Xingjian-Jan commented 3 years ago

hmmm, I finally make it compiled on my laptop. There are several tips I find useful. I have tried to debug this problem related to opencv, but after I try these steps, this bug also disappeared.

  1. You don't need to install your own ceres. You can use the ceres in camodocal's source code. Just enable USE_INTERNAL_CERES in the LibraryConfig.cmake
  2. Make sure to use an old version Eigen, like 3.2.10. This repo hasn't been updated for 3 years. I believe it's not compatible with the latest Eigen.
  3. Remember to install opencv_contrib which contains xfeatures2d_nonfree. If cmake cannot find it, like what I met, just delete all the HAVE_OPENCV_XFEATURES2D_NONFREE in the CMakeLists. camodocal can handle this, just this flag is always false.
loseyourself-gan commented 2 years ago

I have solved this problem by adding

struct CvPoint{
    int x;
    int y;
};

into AstDetector.h

hewujunTDT commented 2 years ago

hmmm, I finally make it compiled on my laptop. There are several tips I find useful. I have tried to debug this problem related to opencv, but after I try these steps, this bug also disappeared.

  1. You don't need to install your own ceres. You can use the ceres in camodocal's source code. Just enable USE_INTERNAL_CERES in the LibraryConfig.cmake
  2. Make sure to use an old version Eigen, like 3.2.10. This repo hasn't been updated for 3 years. I believe it's not compatible with the latest Eigen.
  3. Remember to install opencv_contrib which contains xfeatures2d_nonfree. If cmake cannot find it, like what I met, just delete all the HAVE_OPENCV_XFEATURES2D_NONFREE in the CMakeLists. camodocal can handle this, just this flag is always false.

i meet this error and can you tell how did you make it successful in you laptop?

error: invalid new-expression of abstract class type ‘agast::AgastDetector5_8’ 1654 | :AgastDetector5_8(img.cols, img.rows, 0);

sandeepnmenon commented 2 years ago

hmmm, I finally make it compiled on my laptop. There are several tips I find useful. I have tried to debug this problem related to opencv, but after I try these steps, this bug also disappeared.

  1. You don't need to install your own ceres. You can use the ceres in camodocal's source code. Just enable USE_INTERNAL_CERES in the LibraryConfig.cmake
  2. Make sure to use an old version Eigen, like 3.2.10. This repo hasn't been updated for 3 years. I believe it's not compatible with the latest Eigen.
  3. Remember to install opencv_contrib which contains xfeatures2d_nonfree. If cmake cannot find it, like what I met, just delete all the HAVE_OPENCV_XFEATURES2D_NONFREE in the CMakeLists. camodocal can handle this, just this flag is always false.

Adding on to the third point, there are #include <opencv2/xfeatures2d/nonfree.hpp> statements included in many parts of the code. This should be removed as well right?