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

Chapter 4 compile problem ‘BruteForceMatcher_GPU’ was not declared in this scope #76

Open
wkyoun opened this issue Aug 29, 2016 · 6 comments

Comments

@wkyoun
Copy link

wkyoun commented Aug 29, 2016

I am trying to compile chapter 4,
but following error occurs!

Would you please let me know how to fix it?

wkyoun@wkyoun-XPS-13-9343:~/code/Chapter4_StructureFromMotion/build$ make

Scanning dependencies of target ExploringSfMLibrary
[  7%] Building CXX object CMakeFiles/ExploringSfMLibrary.dir/GPUSURFFeatureMatcher.cpp.o
/home/wkyoun/code/Chapter4_StructureFromMotion/GPUSURFFeatureMatcher.cpp: In member     function ‘virtual void GPU
SURFFeatureMatcher::MatchFeatures(int, int, std::vector<cv::DMatch>*)’:
/home/wkyoun/code/Chapter4_StructureFromMotion/GPUSURFFeatureMatcher.cpp:77:5: error:     ‘BruteForceMatcher_GPU’ was not declared in this scope
     BruteForceMatcher_GPU<L2<float> > matcher;
     ^
/home/wkyoun/code/Chapter4_StructureFromMotion/GPUSURFFeatureMatcher.cpp:77:37: error:     expected primary-expression before ‘>’ token
     BruteForceMatcher_GPU<L2<float> > matcher;
                                 ^
/home/wkyoun/code/Chapter4_StructureFromMotion/GPUSURFFeatureMatcher.cpp:77:39: error:     ‘matcher’ was not declared in this scope
     BruteForceMatcher_GPU<L2<float> > matcher;
                                   ^
make[2]: *** [CMakeFiles/ExploringSfMLibrary.dir/GPUSURFFeatureMatcher.cpp.o] Error 1
make[1]: *** [CMakeFiles/ExploringSfMLibrary.dir/all] Error 2
make: *** [all] Error 2
@royshil
Copy link
Member

royshil commented Aug 29, 2016

@won13y I'm currently re-writing this chapter, getting ready for a 2nd edition of the book that's schedule to publish before the end of the year. This code will be replaced with a far more robust version.

@wkyoun
Copy link
Author

wkyoun commented Aug 29, 2016

@royshil Thank you for the reply
Before you publish 2nd edition,
Would you please let me know how to fix those problems?

I already bought your book which have excellent contents about Sfm,

and I really need to run the opencv example of Chapter 4 for my projects

If possible,
I would like to invite you to come my institution(KARI) in south korea in the future
to share you knowlegde, and really hope that we can collaborate each other!
(Main topic of our team is Visual-SLAM usnig mono-camera on drone(quadcopter))

@thbupt
Copy link

thbupt commented Sep 7, 2016

@won13y I have the same problem, have you solved it?

@wkyoun
Copy link
Author

wkyoun commented Sep 7, 2016

@thbupt No, I cannot solve the problem yet!

Would anyone of you please let me know how to fix it?

@thbupt
Copy link

thbupt commented Sep 7, 2016

@won13y I just solved this problem. Just include opencv2/nonfree/gpu.hpp in the GPUSURFFeatureMatcher.hpp. You can have a try.

@lothas
Copy link

lothas commented Oct 1, 2016

For the sake of clarity, @thbupt 's solution requires adding opencv2/nonfree/gpu.hpp, in addition to opencv2/gpu/gpu.hpp.
That solved it for me.

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

4 participants