OpenCV3.1 & opencv_contrib3.1 install in Ubuntu
I tried to setup opencv with opencv_contrib in an Ubuntu machine but failed several times. This is what I did.
I downloaded the opencv3.1.0 from here
I downloaded opencv_contrib3.1 from here
Extracted both of them
- Create a build directory inside opencv3.1.0
- Switched to that build directory
Run cmake like:
cmake -D WITH_TBB=ON -D INSTALL_C_EXAMPLES=ON -D WITH_EIGEN=OFF -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D OPENCV_EXTRA_MODULES_PATH= opencv_contrib3.1.0_full_path/modules ..
Run >make
Run >sudo make install
After all of this, I saw that in the directory /usr/local/lib there were all opencv3.1 modules, but not the opencv_contrib3.1 modules like "xfeature2d"
So, when I wanted to run a simple code that uses xfeature2d (example) I don't now where is that feature located to add it in my libs path so my IDE can compile the #include "opencv2/xfeatures2d.hpp" without error.
Where are these contrib_modules supposed to be stored after make?
-- Detected version of GNU GCC: 48 (408)
-- Found ZLIB: /usr/lib/i386-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR)
-- Found ZLIB: /usr/lib/i386-linux-gnu/libz.so (found version "1.2.8")
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
-- checking for module 'gtk+-3.0'
-- package 'gtk+-3.0' not found
-- checking for module 'gtk+-2.0'
-- package 'gtk+-2.0' not found
-- checking for module 'gthread-2.0'
-- package 'gthread-2.0' not found
-- checking for module 'gstreamer-base-1.0'
-- package 'gstreamer-base-1.0' not found
-- checking for module 'gstreamer-video-1.0'
-- package 'gstreamer-video-1.0' not found
-- checking for module 'gstreamer-app-1.0'
-- package 'gstreamer-app-1.0' not found
-- checking for module 'gstreamer-riff-1.0'
-- package 'gstreamer-riff-1.0' not found
-- checking for module 'gstreamer-pbutils-1.0'
-- package 'gstreamer-pbutils-1.0' not found
-- checking for module 'gstreamer-base-0.10'
-- package 'gstreamer-base-0.10' not found
-- checking for module 'gstreamer-video-0.10'
-- package 'gstreamer-video-0.10' not found
-- checking for module 'gstreamer-app-0.10'
-- package 'gstreamer-app-0.10' not found
-- checking for module 'gstreamer-riff-0.10'
-- package 'gstreamer-riff-0.10' not found
-- checking for module 'gstreamer-pbutils-0.10'
-- package 'gstreamer-pbutils-0.10' not found
-- checking for module 'libdc1394-2'
-- package 'libdc1394-2' not found
-- checking for module 'libdc1394'
-- package 'libdc1394' not found
-- checking for module 'libv4l1'
-- package 'libv4l1' not found
-- checking for module 'libv4l2'
-- package 'libv4l2' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- checking for module 'libavcodec'
-- package 'libavcodec' not found
-- checking for module 'libavformat'
-- package 'libavformat' not found
-- checking for module 'libavutil'
-- package 'libavutil' not found
-- checking for module 'libswscale'
-- package 'libswscale' not found
-- checking for module 'libavresample'
-- package 'libavresample' not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - not found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- checking for module 'libgphoto2'
-- package 'libgphoto2 ...
please rather use current 3.3, not 3.1
we would need to see the cmake output for further diagnosis, please add that to your question
@berak I uploaded the cmake output here: https://files.fm/u/xzzceemm
next time, please EDIT your question, and put it there, not on some drop bin, please
as you can see from the "to be build" section, none of the extra modules were built at all. (they would also show up in the same /usr/local/lib folder. )
something about your
line is wrong. go again there, rerun cmake, rinse and repeat, until the extra modules show up in the "to be built" output.
only then restart make.
@berak Do you have any idea what might cause the problem? Is there any dependency that should be installed in the machine that I'm missing?
hhm, at the moment, i'd say - your commandline is wrong, simply.