Skip to content

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

Open

Description

@wkyoun

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

Activity

  1. royshil commented on Aug 29, 2016

    @royshil
    Member

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

  2. wkyoun commented on Aug 29, 2016

    @wkyoun
    Author

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

  3. thbupt commented on Sep 7, 2016

    @thbupt

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

  4. wkyoun commented on Sep 7, 2016

    @wkyoun
    Author

    @thbupt No, I cannot solve the problem yet!

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

  5. thbupt commented on Sep 7, 2016

    @thbupt

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

  6. lothas commented on Oct 1, 2016

    @lothas

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions