dorian3d / DBoW2

Enhanced hierarchical bag-of-word library for C++
Other
866 stars 370 forks source link

Does not building against OpenCV 4.6 #71

Open OtacilioNeto opened 2 years ago

OtacilioNeto commented 2 years ago

DBoW2 does not build against OpenCV 4.6. Probably is broken with any version of OpenCV >= 4.

ota@rigel:/usr/local/src/DBoW2/build$ make [ 0%] Built target Dependencies [ 11%] Building CXX object CMakeFiles/DBoW2.dir/src/BowVector.cpp.o [ 22%] Building CXX object CMakeFiles/DBoW2.dir/src/FBrief.cpp.o In file included from /usr/local/include/DVision/DVision.h:42, from /usr/local/src/DBoW2/DBoW2-1.1-free/src/FBrief.cpp:14: /usr/local/include/DVision/BRIEF256.h: In member function ‘void DVision::BRIEF_t::compute(const cv::Mat&, const std::vector&, std::vector<std::bitset >&, bool) const’: /usr/local/include/DVision/BRIEF256.h:207:11: error: ‘cvtColor’ is not a member of ‘cv’ 207 | cv::cvtColor(image, aux, cv::COLOR_RGB2GRAY); | ^~~~ /usr/local/include/DVision/BRIEF256.h:207:36: error: ‘COLOR_RGB2GRAY’ is not a member of ‘cv’ 207 | cv::cvtColor(image, aux, cv::COLOR_RGB2GRAY); | ^~~~~~ /usr/local/include/DVision/BRIEF256.h:214:9: error: ‘GaussianBlur’ is not a member of ‘cv’ 214 | cv::GaussianBlur(aux, im, ksize, sigma, sigma); | ^~~~ /usr/local/include/DVision/BRIEF256.h: In member function ‘void DVision::BRIEF_t::generateTestPoints()’: /usr/local/include/DVision/BRIEF256.h:276:3: error: ‘DUtils’ has not been declared 276 | DUtils::Random::SeedRandOnce(); | ^~ /usr/local/include/DVision/BRIEF256.h:284:12: error: ‘DUtils’ has not been declared 284 | x1 = DUtils::Random::RandomGaussianValue(g_mean, g_sigma); | ^~ /usr/local/include/DVision/BRIEF256.h:289:12: error: ‘DUtils’ has not been declared 289 | y1 = DUtils::Random::RandomGaussianValue(g_mean, g_sigma); | ^~ /usr/local/include/DVision/BRIEF256.h:303:12: error: ‘DUtils’ has not been declared 303 | x2 = DUtils::Random::RandomGaussianValue(meanx, sigma2); | ^~ /usr/local/include/DVision/BRIEF256.h:308:12: error: ‘DUtils’ has not been declared 308 | y2 = DUtils::Random::RandomGaussianValue(meany, sigma2); | ^~ In file included from /usr/local/src/DBoW2/DBoW2-1.1-free/src/FBrief.cpp:15: /usr/local/src/DBoW2/DBoW2-1.1-free/include/DBoW2/FBrief.h: At global scope: /usr/local/src/DBoW2/DBoW2-1.1-free/include/DBoW2/FBrief.h:27:20: error: ‘BRIEF’ in namespace ‘DVision’ does not name a type; did you mean ‘BRIEF_t’? 27 | typedef DVision::BRIEF::bitset TDescriptor;

chetanpandey1266 commented 1 year ago

Yeah I also thinks so. I am trying to build it with opencv 4.4 and it is failing

dingshuoshuo commented 1 year ago

in usr/local/include/DVision/BRIEF256.h add #include <DUtils/DUtils.h>, you can slove "error: ‘DUtils’ has not been declared".

dingshuoshuo commented 1 year ago

I met the same error "/usr/local/src/DBoW2/DBoW2-1.1-free/include/DBoW2/FBrief.h:27:20: error: ‘BRIEF’ in namespace ‘DVision’ does not name a type; did you mean ‘BRIEF_t’? 27 | typedef DVision::BRIEF::bitset TDescriptor;", have you solved this problem?