zdzhaoyong / GSLAM

A General Simultaneous Localization and Mapping Framework which supports feature based or direct method and different sensors including monocular camera, RGB-D sensors or any other input types can be handled.
BSD 2-Clause "Simplified" License
1.02k stars 269 forks source link

Installing on ubuntu 20.10 #57

Open kevkid opened 3 years ago

kevkid commented 3 years ago

Hi I am trying to compile and install on ubuntu 20.10 and I am recieving the following error:

[ 10%] Building CXX object CMakeFiles/gslamDB_tummono.dir/GSLAM/plugins/datasets/DatasetTUMMono.cpp.o
/home/kevin/slam/GSLAM/GSLAM/plugins/datasets/DatasetTUMMono.cpp: In member function ‘bool DatasetTUMMono::loadVignette(const string&)’:
/home/kevin/slam/GSLAM/GSLAM/plugins/datasets/DatasetTUMMono.cpp:274:44: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
  274 |         cv::Mat vigMat=cv::imread(vigFile, CV_LOAD_IMAGE_GRAYSCALE);
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~
/home/kevin/slam/GSLAM/GSLAM/plugins/datasets/DatasetTUMMono.cpp:277:23: error: no match for ‘operator=’ (operand types are ‘GSLAM::GImage’ and ‘cv::Mat’)
  277 |             _vignette=vigMat;
      |                       ^~~~~~
In file included from /home/kevin/slam/GSLAM/./GSLAM/core/GSLAM.h:66,
                 from /home/kevin/slam/GSLAM/GSLAM/plugins/datasets/DatasetTUMMono.cpp:5:
/home/kevin/slam/GSLAM/./GSLAM/core/GImage.h:215:13: note: candidate: ‘GSLAM::GImage& GSLAM::GImage::operator=(const GSLAM::GImage&)’
  215 |     GImage& operator=(const GImage& rhs)
      |             ^~~~~~~~
/home/kevin/slam/GSLAM/./GSLAM/core/GImage.h:215:37: note:   no known conversion for argument 1 from ‘cv::Mat’ to ‘const GSLAM::GImage&’
  215 |     GImage& operator=(const GImage& rhs)
      |                       ~~~~~~~~~~~~~~^~~
make[2]: *** [CMakeFiles/gslamDB_tummono.dir/build.make:63: CMakeFiles/gslamDB_tummono.dir/GSLAM/plugins/datasets/DatasetTUMMono.cpp.o] Error 1
make[2]: Leaving directory '/home/kevin/slam/GSLAM/build'
make[1]: *** [CMakeFiles/Makefile2:196: CMakeFiles/gslamDB_tummono.dir/all] Error 2
make[1]: Leaving directory '/home/kevin/slam/GSLAM/build'
make: *** [Makefile:130: all] Error 2

Any idea how I can fix this?

harshalkataria commented 3 years ago

I got the same error , first we can change "CV_LOAD_IMAGE_GRAYSCALE" to "cv::IMREAD_GRAYSCALE" to solve the error with line 274, NOTE: as far as i know this change is visible since opencv 3.1

Further I am trying to solve the error on Ubuntu 21.04, let me know if you have already found the solution