Skip to content

Sample from modules/reg/samples/map_test.cpp does not compile #11

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

Closed
albenoit opened this issue Feb 17, 2014 · 6 comments
Closed

Sample from modules/reg/samples/map_test.cpp does not compile #11

albenoit opened this issue Feb 17, 2014 · 6 comments
Labels

Comments

@albenoit
Copy link
Contributor

Hi Kiril,

Sorry if i assigned the issue to you but the author Alfonso (alfonsosanchezbeato ) does not appear in the assignies list.

this sample does not compile.

First, you should change your includes referring to opencv modules
For example: replace

#include <opencv2/highgui/highgui.hpp>
by
#include <opencv2/highgui.hpp> // but note that teire are two similar lines including highgui

Here is the compiler errors i have with the original submission

[ 75%] Built target opencv_reg
Scanning dependencies of target example_reg_map_test
[ 75%] Building CXX object modules/reg/CMakeFiles/example_reg_map_test.dir/samples/map_test.cpp.o
In file included from /home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:43:0:
/home/noob/install/OpenCV/github/opencv/modules/highgui/include/opencv2/highgui/highgui.hpp:45:2: error: #error this is a compatibility header which should not be used inside the OpenCV library
 #error this is a compatibility header which should not be used inside the OpenCV library
  ^
In file included from /home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:44:0:
/home/noob/install/OpenCV/github/opencv/modules/imgproc/include/opencv2/imgproc/imgproc.hpp:45:2: error: #error this is a compatibility header which should not be used inside the OpenCV library
 #error this is a compatibility header which should not be used inside the OpenCV library
  ^
In file included from /home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:45:0:
/usr/local/include/opencv2/features2d/features2d.hpp:45:2: error: #error this is a compatibility header which should not be used inside the OpenCV library
 #error this is a compatibility header which should not be used inside the OpenCV library
  ^
In file included from /home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:46:0:
/usr/local/include/opencv2/nonfree/nonfree.hpp:45:2: error: #error this is a compatibility header which should not be used inside the OpenCV library
 #error this is a compatibility header which should not be used inside the OpenCV library
  ^
In file included from /home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:47:0:
/usr/local/include/opencv2/calib3d/calib3d.hpp:45:2: error: #error this is a compatibility header which should not be used inside the OpenCV library
 #error this is a compatibility header which should not be used inside the OpenCV library
  ^
In file included from /home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:48:0:
/home/noob/install/OpenCV/github/opencv/modules/imgproc/include/opencv2/imgproc/imgproc.hpp:45:2: error: #error this is a compatibility header which should not be used inside the OpenCV library
 #error this is a compatibility header which should not be used inside the OpenCV library
  ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void showDifference(const cv::Mat&, const cv::Mat&, const char*)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:68:6: warning: no previous declaration for ‘void showDifference(const cv::Mat&, const cv::Mat&, const char*)’ [-Wmissing-declarations]
 void showDifference(const Mat& image1, const Mat& image2, const char* title)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void testShift(const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:89:6: warning: no previous declaration for ‘void testShift(const cv::Mat&)’ [-Wmissing-declarations]
 void testShift(const Mat& img1)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void testEuclidean(const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:121:6: warning: no previous declaration for ‘void testEuclidean(const cv::Mat&)’ [-Wmissing-declarations]
 void testEuclidean(const Mat& img1)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void testSimilarity(const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:159:6: warning: no previous declaration for ‘void testSimilarity(const cv::Mat&)’ [-Wmissing-declarations]
 void testSimilarity(const Mat& img1)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void testAffine(const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:198:6: warning: no previous declaration for ‘void testAffine(const cv::Mat&)’ [-Wmissing-declarations]
 void testAffine(const Mat& img1)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void testProjective(const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:233:6: warning: no previous declaration for ‘void testProjective(const cv::Mat&)’ [-Wmissing-declarations]
 void testProjective(const Mat& img1)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void calcHomographyFeature(const cv::Mat&, const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:270:6: warning: no previous declaration for ‘void calcHomographyFeature(const cv::Mat&, const cv::Mat&)’ [-Wmissing-declarations]
 void calcHomographyFeature(const Mat& image1, const Mat& image2)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void calcHomographyPixel(const cv::Mat&, const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:352:6: warning: no previous declaration for ‘void calcHomographyPixel(const cv::Mat&, const cv::Mat&)’ [-Wmissing-declarations]
 void calcHomographyPixel(const Mat& img1, const Mat& img2)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void comparePixelVsFeature(const cv::Mat&, const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:373:6: warning: no previous declaration for ‘void comparePixelVsFeature(const cv::Mat&, const cv::Mat&)’ [-Wmissing-declarations]
 void comparePixelVsFeature(const Mat& img1_8b, const Mat& img2_8b)
      ^
make[2]: *** [modules/reg/CMakeFiles/example_reg_map_test.dir/samples/map_test.cpp.o] Erreur 1
make[1]: *** [modules/reg/CMakeFiles/example_reg_map_test.dir/all] Erreur 2
make: *** [all] Erreur 2

Now, if i correct the includes

I got these problems : code warnings and liker error (you should specifiy which module to link to in the config files)

Scanning dependencies of target example_reg_map_test
[ 75%] Building CXX object modules/reg/CMakeFiles/example_reg_map_test.dir/samples/map_test.cpp.o
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void showDifference(const cv::Mat&, const cv::Mat&, const char*)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:68:6: warning: no previous declaration for ‘void showDifference(const cv::Mat&, const cv::Mat&, const char*)’ [-Wmissing-declarations]
 void showDifference(const Mat& image1, const Mat& image2, const char* title)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void testShift(const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:89:6: warning: no previous declaration for ‘void testShift(const cv::Mat&)’ [-Wmissing-declarations]
 void testShift(const Mat& img1)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void testEuclidean(const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:121:6: warning: no previous declaration for ‘void testEuclidean(const cv::Mat&)’ [-Wmissing-declarations]
 void testEuclidean(const Mat& img1)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void testSimilarity(const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:159:6: warning: no previous declaration for ‘void testSimilarity(const cv::Mat&)’ [-Wmissing-declarations]
 void testSimilarity(const Mat& img1)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void testAffine(const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:198:6: warning: no previous declaration for ‘void testAffine(const cv::Mat&)’ [-Wmissing-declarations]
 void testAffine(const Mat& img1)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void testProjective(const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:233:6: warning: no previous declaration for ‘void testProjective(const cv::Mat&)’ [-Wmissing-declarations]
 void testProjective(const Mat& img1)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void calcHomographyFeature(const cv::Mat&, const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:270:6: warning: no previous declaration for ‘void calcHomographyFeature(const cv::Mat&, const cv::Mat&)’ [-Wmissing-declarations]
 void calcHomographyFeature(const Mat& image1, const Mat& image2)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void calcHomographyPixel(const cv::Mat&, const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:352:6: warning: no previous declaration for ‘void calcHomographyPixel(const cv::Mat&, const cv::Mat&)’ [-Wmissing-declarations]
 void calcHomographyPixel(const Mat& img1, const Mat& img2)
      ^
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp: In function ‘void comparePixelVsFeature(const cv::Mat&, const cv::Mat&)’:
/home/noob/install/OpenCV/github/opencv_contrib/modules/reg/samples/map_test.cpp:373:6: warning: no previous declaration for ‘void comparePixelVsFeature(const cv::Mat&, const cv::Mat&)’ [-Wmissing-declarations]
 void comparePixelVsFeature(const Mat& img1_8b, const Mat& img2_8b)
      ^
Linking CXX executable ../../bin/example_reg_map_test
CMakeFiles/example_reg_map_test.dir/samples/map_test.cpp.o: dans la fonction « calcHomographyFeature(cv::Mat const&, cv::Mat const&) »:
map_test.cpp:(.text+0x72f9): référence indéfinie vers « cv::SURF::SURF(double, int, int, bool, bool) »
map_test.cpp:(.text+0x7396): référence indéfinie vers « cv::FeatureDetector::detect(cv::_InputArray const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::_InputArray const&) const »
map_test.cpp:(.text+0x73f3): référence indéfinie vers « cv::FeatureDetector::detect(cv::_InputArray const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::_InputArray const&) const »
map_test.cpp:(.text+0x7400): référence indéfinie vers « cv::SURF::SURF() »
map_test.cpp:(.text+0x7592): référence indéfinie vers « cv::Feature2D::compute(cv::_InputArray const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::_OutputArray const&) const »
map_test.cpp:(.text+0x762c): référence indéfinie vers « cv::Feature2D::compute(cv::_InputArray const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::_OutputArray const&) const »
map_test.cpp:(.text+0x764f): référence indéfinie vers « cv::flann::SearchParams::SearchParams(int, float, bool) »
map_test.cpp:(.text+0x7698): référence indéfinie vers « cv::flann::KDTreeIndexParams::KDTreeIndexParams(int) »
map_test.cpp:(.text+0x76e6): référence indéfinie vers « cv::FlannBasedMatcher::FlannBasedMatcher(cv::Ptr<cv::flann::IndexParams> const&, cv::Ptr<cv::flann::SearchParams> const&) »
map_test.cpp:(.text+0x77e9): référence indéfinie vers « cv::DescriptorMatcher::match(cv::_InputArray const&, cv::_InputArray const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> >&, cv::_InputArray const&) const »
map_test.cpp:(.text+0x7e6e): référence indéfinie vers « cv::findHomography(cv::_InputArray const&, cv::_InputArray const&, int, double, cv::_OutputArray const&) »
map_test.cpp:(.text+0x87df): référence indéfinie vers « vtable for cv::FlannBasedMatcher »
map_test.cpp:(.text+0x87e8): référence indéfinie vers « cv::DescriptorMatcher::DescriptorCollection::~DescriptorCollection() »
map_test.cpp:(.text+0x8885): référence indéfinie vers « cv::DescriptorMatcher::~DescriptorMatcher() »
map_test.cpp:(.text+0x8984): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text+0x898b): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text+0x8990): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text+0x8997): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text+0x89c4): référence indéfinie vers « cv::DescriptorExtractor::~DescriptorExtractor() »
map_test.cpp:(.text+0x89d1): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text+0x89d6): référence indéfinie vers « cv::FeatureDetector::~FeatureDetector() »
map_test.cpp:(.text+0x8a18): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text+0x8a39): référence indéfinie vers « cv::DescriptorExtractor::~DescriptorExtractor() »
map_test.cpp:(.text+0x8a46): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text+0x8a4b): référence indéfinie vers « cv::FeatureDetector::~FeatureDetector() »
map_test.cpp:(.text+0x8d24): référence indéfinie vers « cv::DescriptorMatcher::~DescriptorMatcher() »
map_test.cpp:(.text+0x8ec4): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text+0x8ecc): référence indéfinie vers « cv::FeatureDetector::~FeatureDetector() »
map_test.cpp:(.text+0x8fe2): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text+0x8fea): référence indéfinie vers « cv::FeatureDetector::~FeatureDetector() »
CMakeFiles/example_reg_map_test.dir/samples/map_test.cpp.o: dans la fonction « cv::SURF::~SURF() »:
map_test.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x2): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x15): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x1c): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x30): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x38): référence indéfinie vers « cv::DescriptorExtractor::~DescriptorExtractor() »
map_test.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x3d): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x45): référence indéfinie vers « cv::FeatureDetector::~FeatureDetector() »
map_test.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x5b): référence indéfinie vers « VTT for cv::SURF »
map_test.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x66): référence indéfinie vers « cv::FeatureDetector::~FeatureDetector() »
CMakeFiles/example_reg_map_test.dir/samples/map_test.cpp.o: dans la fonction « cv::detail::PtrOwnerImpl<cv::flann::SearchParams, cv::DefaultDeleter<cv::flann::SearchParams> >::deleteSelf() »:
map_test.cpp:(.text._ZN2cv6detail12PtrOwnerImplINS_5flann12SearchParamsENS_14DefaultDeleterIS3_EEE10deleteSelfEv[_ZN2cv6detail12PtrOwnerImplINS_5flann12SearchParamsENS_14DefaultDeleterIS3_EEE10deleteSelfEv]+0x16): référence indéfinie vers « cv::flann::IndexParams::~IndexParams() »
CMakeFiles/example_reg_map_test.dir/samples/map_test.cpp.o: dans la fonction « cv::detail::PtrOwnerImpl<cv::flann::KDTreeIndexParams, cv::DefaultDeleter<cv::flann::KDTreeIndexParams> >::deleteSelf() »:
map_test.cpp:(.text._ZN2cv6detail12PtrOwnerImplINS_5flann17KDTreeIndexParamsENS_14DefaultDeleterIS3_EEE10deleteSelfEv[_ZN2cv6detail12PtrOwnerImplINS_5flann17KDTreeIndexParamsENS_14DefaultDeleterIS3_EEE10deleteSelfEv]+0x16): référence indéfinie vers « cv::flann::IndexParams::~IndexParams() »
CMakeFiles/example_reg_map_test.dir/samples/map_test.cpp.o: dans la fonction « cv::FlannBasedMatcher::~FlannBasedMatcher() »:
map_test.cpp:(.text._ZN2cv17FlannBasedMatcherD2Ev[_ZN2cv17FlannBasedMatcherD5Ev]+0x11): référence indéfinie vers « vtable for cv::FlannBasedMatcher »
map_test.cpp:(.text._ZN2cv17FlannBasedMatcherD2Ev[_ZN2cv17FlannBasedMatcherD5Ev]+0x16): référence indéfinie vers « cv::DescriptorMatcher::DescriptorCollection::~DescriptorCollection() »
map_test.cpp:(.text._ZN2cv17FlannBasedMatcherD2Ev[_ZN2cv17FlannBasedMatcherD5Ev]+0xc2): référence indéfinie vers « cv::DescriptorMatcher::~DescriptorMatcher() »
map_test.cpp:(.text._ZN2cv17FlannBasedMatcherD2Ev[_ZN2cv17FlannBasedMatcherD5Ev]+0x84): référence indéfinie vers « cv::DescriptorMatcher::~DescriptorMatcher() »
CMakeFiles/example_reg_map_test.dir/samples/map_test.cpp.o: dans la fonction « cv::FlannBasedMatcher::~FlannBasedMatcher() »:
map_test.cpp:(.text._ZN2cv17FlannBasedMatcherD0Ev[_ZN2cv17FlannBasedMatcherD0Ev]+0x11): référence indéfinie vers « vtable for cv::FlannBasedMatcher »
map_test.cpp:(.text._ZN2cv17FlannBasedMatcherD0Ev[_ZN2cv17FlannBasedMatcherD0Ev]+0x16): référence indéfinie vers « cv::DescriptorMatcher::DescriptorCollection::~DescriptorCollection() »
map_test.cpp:(.text._ZN2cv17FlannBasedMatcherD0Ev[_ZN2cv17FlannBasedMatcherD0Ev]+0x7e): référence indéfinie vers « cv::DescriptorMatcher::~DescriptorMatcher() »
map_test.cpp:(.text._ZN2cv17FlannBasedMatcherD0Ev[_ZN2cv17FlannBasedMatcherD0Ev]+0xc2): référence indéfinie vers « cv::DescriptorMatcher::~DescriptorMatcher() »
collect2: error: ld returned 1 exit status
make[2]: *** [bin/example_reg_map_test] Erreur 1
make[1]: *** [modules/reg/CMakeFiles/example_reg_map_test.dir/all] Erreur 2
make: *** [all] Erreur 2
@kirill-korniakov
Copy link

@alfonsosanchezbeato, could you please have a look?

@alfonsosanchezbeato
Copy link
Contributor

How are you compiling this? Using the cmake that appears in the folder works for me:

.../reg/samples $ mkdir obj; cd obj
.../reg/samples/obj $ export OpenCV_DIR=[openCV_out]
.../reg/samples/obj $ cmake ..
.../reg/samples/obj $ make

I am using gcc 4.8. Which is your set-up? It looks like you are compiling it inside the OpenCV library.

-- Alfonso

@albenoit
Copy link
Contributor Author

Hi,

i am using gcc 4.8 on debian 64bit.
Actually, i just start global opencv build with opencv_contrib extra module.
Normally, all the proposed codes (libs, samples and tutorial) should
compile fine at opencv make (for samples, they are automatically built if
BUILD_EXAMPLES option is set to ON).

so yes i am compiling it inside the OpenCV library to build all at the same
time.
Regarding your code, the includes lines fails (you target wrong headers :
you should do

#include <opencv2/highgui.hpp>

instead of writing

#include <opencv2/highgui/highgui.hpp>

you are actually targeting a compatibility header which should not be
used inside the OpenCV library
(as the header says ;o) ).

Then, can you make it compile within the library during its own build ?

Thanks
Alex

2014-02-17 17:30 GMT+01:00 alfonsosanchezbeato [email protected]:

How are you compiling this? Using the cmake that appears in the folder
works for me:

.../reg/samples $ mkdir obj; cd obj
.../reg/samples $ export OpenCV_DIR=
.../reg/samples $ cmake ..
.../reg/samples $ make

I am using gcc 4.8. Which is your set-up? It looks like you are compiling
it inside the OpenCV library.

-- Alfonso

Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-35299744
.

Alexandre BENOIT,
Associate Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
https://sites.google.com/site/benoitalexandrevision/

@alfonsosanchezbeato
Copy link
Contributor

Ok, I have been trying to compile changing header paths and with

$ cmake -DOPENCV_EXTRA_MODULES_PATH=/mnt/data/opencv/opencv_contrib/modules -DBUILD_EXAMPLES=ON [opencv_folder]

But I have lots of problems trying to use features2d. I tried adding:

ocv_add_module(opencv_nonfree opencv_features2d)

to CMakeLists.txt in reg/samples/ folder, but still it does not find features2d.hpp header. Any hint on this?

Thanks,
Alfonso

@albenoit
Copy link
Contributor Author

Normally, in your code, features2d include should be :

#include "opencv2/nonfree.hpp" // if you are using SIFT or SURF
or
#include "opencv2/features2d.hpp" // if you are using free descriptors

Is it the case ?

2014-02-18 11:49 GMT+01:00 alfonsosanchezbeato [email protected]:

Ok, I have been trying to compile changing header paths and with

$ cmake
-DOPENCV_EXTRA_MODULES_PATH=/mnt/data/opencv/opencv_contrib/modules
-DBUILD_EXAMPLES=ON [opencv_folder]

But I have lots of problems trying to use features2d. I tried adding:

ocv_add_module(opencv_nonfree opencv_features2d)

to CMakeLists.txt in reg/samples/ folder, but still it does not find
features2d.hpp header. Any hint on this?

Thanks,
Alfonso

Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-35372146
.

Alexandre BENOIT,
Associate Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
https://sites.google.com/site/benoitalexandrevision/

@alfonsosanchezbeato
Copy link
Contributor

It does not find any of those headers, not if I compile all OpenCV it with BUILD_EXAMPLES set. If I use the CMakeLists.txt file as stand-alone, headers are found. The problem seems to happen only for non-free modules. opencv2/imgproc.hpp or opencv2/highgui.hpp are found compiling OpenCV + BUILD_EXAMPLES.

shanchenqi pushed a commit to shanchenqi/opencv_contrib that referenced this issue Nov 20, 2020
delete useless include message
bmegli pushed a commit to Extend-Robotics/opencv_contrib that referenced this issue Jul 11, 2022
* Use nodelet for slam_rtabmap.launch

* Create pull_request_template.md
allnes pushed a commit to allnes/opencv_contrib that referenced this issue Jun 9, 2024
* Added fictitious delete methods, changes for android build

* fixed comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants