Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with OpenCV 4.4 #104

Open
walchko opened this issue Aug 1, 2020 · 7 comments
Open

Build fails with OpenCV 4.4 #104

walchko opened this issue Aug 1, 2020 · 7 comments

Comments

@walchko
Copy link

walchko commented Aug 1, 2020

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
Copy link

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

@walchko
Copy link
Author

walchko commented Jan 22, 2021

no I didn't ... sorry

@Xingjian-Jan
Copy link

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

@Xingjian-Jan
Copy link

Xingjian-Jan commented Jan 22, 2021

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
Copy link

I have solved this problem by adding

struct CvPoint{
    int x;
    int y;
};

into AstDetector.h

@hewujunTDT
Copy link

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
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants