DLoopDetector icon indicating copy to clipboard operation
DLoopDetector copied to clipboard

Problema con demo_brief.cpp

Open ariel9874 opened this issue 6 years ago • 9 comments

Hola, muy buenas noches, tengo un problema al momento de ejecutar demo_brief.cpp, me sale el siguiente error: demo_brief.cpp: In function ‘int main()’: demo_brief.cpp:76:20: error: cannot declare variable ‘extractor’ to be of abstract type ‘BriefExtractor’ BriefExtractor extractor(BRIEF_PATTERN_FILE); ^ demo_brief.cpp:41:7: note: because the following virtual functions are pure within ‘BriefExtractor’: class BriefExtractor: public FeatureExtractorFBrief::TDescriptor ^ In file included from demo_brief.cpp:22:0: demoDetector.h:44:16: note: void FeatureExtractor<TDescriptor>::operator()(const cv::Mat&, std::vectorcv::KeyPoint&, std::vector<_Tp>&) const [with TDescriptor = std::bitset<256ul>] virtual void operator()(const cv::Mat &im,

Al principio pensaba que me faltaba el boost::dynamic_bitset pero ya la tengo instalada. Por cierto estoy utilizando ubuntu 16.4.10 y opencv 3.1. Muchas gracias por su atención y una disculpa si le hablo en español

ariel9874 avatar Nov 06 '18 00:11 ariel9874

@ariel9874, same as mine, have you solved it?

poaongithub avatar Feb 27 '19 11:02 poaongithub

@ariel9874, same as mine, have you solved it?

I can already run this program. You need to change the vectorBRIEF::bitset in the declaration of the virtual function operator() in demo_brief.cpp to vectorFBrief::TDescripyor. Then, m_brief.compute(im,keys,(vectorBRIEF::bitset&)(descriptors))

TeslaHua avatar Mar 02 '19 12:03 TeslaHua

@ariel9874, same as mine, have you solved it?

I can already run this program. You need to change the vectorBRIEF::bitset in the declaration of the virtual function operator() in demo_brief.cpp to vectorFBrief::TDescripyor. Then, m_brief.compute(im,keys,(vectorBRIEF::bitset&)(descriptors))

@TeslaHua I have the same problem, but couldn't solve it with your solution. May I ask am I right?

I changed BRIEF::bitset to FBrief::TDescriptor.

I got this error:

[ 50%] Building CXX object CMakeFiles/demo_brief.dir/demo/demo_brief.cpp.o /home/jun/Dropbox/cpp_ws/DLoopDetector_origin/DLoopDetector/demo/demo_brief.cpp: In member function ‘virtual void BriefExtractor::operator()(const cv::Mat&, std::vector<cv::KeyPoint>&, std::vector<std::bitset<256ul> >&) const’: /home/jun/Dropbox/cpp_ws/DLoopDetector_origin/DLoopDetector/demo/demo_brief.cpp:99:40: error: no matching function for call to ‘DVision::BRIEF::compute(const cv::Mat&, std::vector<cv::KeyPoint>&, std::vector<std::bitset<256ul> >&) const’ m_brief.compute(im, keys, descriptors); ^ /home/jun/Dropbox/cpp_ws/DLoopDetector_origin/DLoopDetector/demo/demo_brief.cpp:99:40: note: candidate is: In file included from /home/jun/Dropbox/cpp_ws/DLoopDetector_origin/DLoopDetector/build/dependencies/install/include/DLib/../DVision/DVision.h:42:0, from /home/jun/Dropbox/cpp_ws/DLoopDetector_origin/DLoopDetector/include/DLoopDetector/TemplatedLoopDetector.h:28, from /home/jun/Dropbox/cpp_ws/DLoopDetector_origin/DLoopDetector/include/DLoopDetector/DLoopDetector.h:54, from /home/jun/Dropbox/cpp_ws/DLoopDetector_origin/DLoopDetector/demo/demo_brief.cpp:15: /home/jun/Dropbox/cpp_ws/DLoopDetector_origin/DLoopDetector/build/dependencies/install/include/DLib/../DVision/BRIEF.h:118:8: note: void DVision::BRIEF::compute(const cv::Mat&, const std::vector<cv::KeyPoint>&, std::vector<boost::dynamic_bitset<> >&, bool) const void compute(const cv::Mat &image, ^ /home/jun/Dropbox/cpp_ws/DLoopDetector_origin/DLoopDetector/build/dependencies/install/include/DLib/../DVision/BRIEF.h:118:8: note: no known conversion for argument 3 from ‘std::vector<std::bitset<256ul> >’ to ‘std::vector<boost::dynamic_bitset<> >&’ make[2]: *** [CMakeFiles/demo_brief.dir/demo/demo_brief.cpp.o] Error 1 make[1]: *** [CMakeFiles/demo_brief.dir/all] Error 2 make: *** [all] Error 2

junzhang2016 avatar May 01 '19 10:05 junzhang2016

@junzhang2016 I had the same error. Have you solved it?

SarahGao-1995 avatar Jan 03 '20 14:01 SarahGao-1995

@SarahGao-1995
Hi, yes, I solved. Please refer to this issue: https://github.com/dorian3d/DLoopDetector/issues/16

junzhang2016 avatar Jan 03 '20 14:01 junzhang2016

@junzhang2016 Thanks, I modified the CMakeLists.txt as methoned in #16. but another error occured. [ 88%] Completed 'DBoW2' [ 88%] Built target DBoW2 Scanning dependencies of target demo_brief [ 94%] Building CXX object CMakeFiles/demo_brief.dir/demo/demo_brief.cpp.o /home/gs/GS_doc/4_codes/loop_closing/DLoopDetector-master/demo/demo_brief.cpp:14:10: fatal error: DBoW2/DBoW2.h: No such file or directory #include <DBoW2/DBoW2.h> // defines BriefVocabulary ^~~~~~~~~~~~~~~ compilation terminated.

So, did you modify the CMakeLists.txt and demo_brief.cpp at the same time?

SarahGao-1995 avatar Jan 05 '20 07:01 SarahGao-1995

@SarahGao-1995 Did you get any solution for above error?

KratikaVarshney08 avatar Apr 09 '20 10:04 KratikaVarshney08

@KratikaVarshney08 yes, I solved by changing the declaration of the virtual function operator() in demo_brief.cpp to virtual void operator()(const cv::Mat &im, vector<cv::KeyPoint> &keys, vector<FBrief::TDescriptor> &descriptors) const; and in the function BriefExtractor::operator() I converted the type of descriptors in last line like this m_brief.compute(im, keys, (vector<BRIEF::bitset>&)(descriptors));

SarahGao-1995 avatar Apr 13 '20 07:04 SarahGao-1995

Thanks @SarahGao-1995 Do you know how do we get precision and recall curves/value in above code?

KratikaVarshney08 avatar Apr 13 '20 12:04 KratikaVarshney08