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

Problema con demo_brief.cpp #15

Open
ariel9874 opened this issue Nov 6, 2018 · 9 comments
Open

Problema con demo_brief.cpp #15

ariel9874 opened this issue Nov 6, 2018 · 9 comments

Comments

@ariel9874
Copy link

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::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

@poaongithub
Copy link

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

@TeslaHua
Copy link

TeslaHua commented Mar 2, 2019

@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))

@junzhang2016
Copy link

@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

@SarahGao-1995
Copy link

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

@junzhang2016
Copy link

junzhang2016 commented Jan 3, 2020

@SarahGao-1995
Hi, yes, I solved. Please refer to this issue:
#16

@SarahGao-1995
Copy link

@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?

@KratikaVarshney08
Copy link

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

@SarahGao-1995
Copy link

@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));

@KratikaVarshney08
Copy link

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

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

6 participants