How to Install OpenCV with Modules on Ubuntu Linux

preview_player
Показать описание
cmake Command:

$ 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= *path of your contrib_master*/modules ..

Example of the command above if you have your folder at the directory /home/Downloads/:

$ 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= /home/Downloads/opencv_contrib/modules ..

IMPORTANT: It is recommended to run the following commands before anything:
$ sudo apt-get update
$ sudo apt-get upgrade

NOTE: Please remove the '*' characters when placing the Path to your modules file.

NOTE #1: the double points at the end of the cake command IS NECESSARY! Do not delete!

NOTE #2: The WITH_EIGEN=OFF was used by me because I had an installation problem with the Eigen library. If you prefer, you can try to set it ON

NOTE #3: If you want to see ALL parameters you can install cmake-gui by typing the following command:
$ sudo apt-get install cmake-gui

------------------------------------------ UPDATE #1------------------------------------------

### FOR THOSE INSTALLING OpenCV 3.2.0 ###

If you are having the error saying something like the following error:

file DOWNLOAD cannot open file for write.
Call Stack (most recent call first):

There is a SOLUTION:
You must download the opencv_contrib-3.2.0 and this is NOT the one on the main github/opencv/opencv_contrib. You must go to the tab RELEASES and see the first release, the 3.2.0. The link is the following:

You will download the version compatible with the OpenCV version you are using it.

Besides this caveat, the steps are the same as described in the video.

Hope it helps!
----------------------------------------------------------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

### FOR THOSE INSTALLING OpenCV 3.2.0 ###

If you are having the error saying something like the following error:

CMake Error at cmake/OpenCVUtils.cmake:1043 (file):
file DOWNLOAD cannot open file for write.
Call Stack (most recent call first):


There is a SOLUTION:
You must download the opencv_contrib-3.2.0 and this is NOT the one on the main github/opencv/opencv_contrib. You must go to the tab RELEASES and see the first release, the 3.2.0. The link is the following:


You will download the version compatible with the OpenCV version you are using it.

Besides this caveat, the steps are the same as described in the video.

Hope it helps!

miguelrochajr
Автор

Worked like a breeze with OpenSUSE! thanks

agentrsdg
Автор

Valeu pelo tutorial Miguel. :D
Abraço!

KanagawaMarcos
Автор

it has a problem.the path does not include home.to find the path open the terminal in the module folder and copy the adress there, the blue one in terminal.it odes not have home.otherwise it doesnt verify the installation at the end

saranh
Автор

Also, for those trying to install OpenCV_contrib modules after installing only OpenCV, be sure to make a build folder from scratch! If you try to install it on the same build folder as you previously have, you may get some installing errors!

xGabriellL
Автор

Hi, I have downloaded the extra modules from the link provided by you. But there is an of not finding the tracking.hpp header file when i run the code. My cmake and make has run without anyerrors. What is problem in my case? Please give a solution

ambatihemasreesree
Автор

Hi, i get this error everytime. Do you have any idea what causes this problem? I am trying almost 3 hours. Please help!

make[2]: *** No rule to make target '/lib/libzlib.so', needed by 'bin/opencv_perf_core'. Stop.

make[1]: *** [CMakeFiles/Makefile2:5345: Error 2
make: *** [Makefile:163: all] Error 2

hqjkkrw
Автор

Thank you for this video. I am having errors while installing it, may pakcages it says"not found". Also I am not getting Python under "Interpreter" section and Numpy under "Libraries" secition after execution of this code. Please help!!!

arpitpachori
Автор

I downloaded and installed opencv using synaptic manager, and I can't find the build folder, what should I do to compile opencv-contrib ?

stoka
Автор

Thank you, how i use the jar in intellij+java, my jar doesn't have any of extra modules inside, is that normal? Or i have to make some reference to opencv_contrib when i add the library in intellij.

Thank you...

hardnb
Автор

I installed OpenCv 3.1 using your video and everything worked like a charm. However, I am working with ros and in order to successfully build a package with the right dependencies, I need to uninstall OpenCV 3.1. Could you please guide me through. I browsed on the internet and it is cardinal to uninstall OpenCV 3.1 in the appropriate way to prevent any broken links.

omarcheema
Автор

Hi, I am trying to install opencv 3.1.0 in centos using the opencv_conrib, I do all the same steps as you do but I get some errors when the modules are installing
CMake Error at cmake/OpenCVModule.cmake:286 (add_subdirectory):
The binary directory



is already used to build a source directory. It cannot be used to build
source directory



Specify a unique binary directory name.

I am trying to build it using this cmake script:
cmake \
-DCMAKE_BUILD_TYPE=RELEASE \
\
\
-DBUILD_SHARED_LIBS=OFF \
-DWITH_1394=OFF \
-DWITH_AVFOUNDATION=OFF \
-DWITH_VTK=OFF \
-DWITH_EIGEN=OFF \
-DWITH_CUFFT=OFF \
-DWITH_FFMPEG=OFF \
-DWITH_GSTREAMER=OFF \
-DWITH_GTK=OFF \
-DWITH_JASPER=OFF \
-DWITH_WEBP=OFF \
-DWITH_OPENEXR=OFF \
-DWITH_OPENGL=OFF \
-DWITH_PVAPI=OFF \
-DWITH_GIGEAPI=OFF \
-DWITH_QT=OFF \
-DWITH_QUICKTIME=OFF \
-DWITH_TIFF=OFF \
-DWITH_UNICAP=OFF \
-DWITH_V4L=OFF \
-DWITH_LIBV4L=OFF \
-DWITH_XIMEA=OFF \
-DWITH_XINE=OFF \
-DWITH_CLP=OFF \
-DWITH_OPENCL=OFF \
-DWITH_OPENCL_SVM=OFF \
-DWITH_OPENCLAMDFFT=OFF \
-DWITH_OPENCLAMDBLAS=OFF \
-DWITH_MATLAB=OFF \
-DWITH_GPHOTO2=OFF \
-DWITH_IPP=OFF \
-DBUILD_OPENCV_JAVA=OFF \
-DBUILD_OPENCV_PYTHON=OFF \
-DBUILD_opencv_legacy=OFF \
..
Thanks

Linkavich
Автор

Hey thanks a lot for this video.

One question though: how do we make sure that the opencv_contrib modules are installed?
cause i can't find any xheader.hpp in my /usr/local/

i have opencv-3.2.0 installed and trying to link opencv_contrib-3.2.0 on ubuntu 16.04

drnnokc
Автор

it does not work! CMakeLists.txt is missing

ricardobjorkeheim
Автор

how to import cv2 in python idle in linux, do you have any idea?

deepakparajuli
Автор

aruco_create_markermap.cpp
fatal error: markermap.h: No such file or directory
#include "markermap.h"

how do i solve this!!! plz help

wanghetongtt
Автор

please help, there is no makefile under this directory.
When i type make in and press enter i get this
make: *** No targets specified and no makefile found. Stop.

ibrahimyazici
Автор

where we can put sudo apt-get update & upgrade. after the $ cmake line?

jolamuthappan
Автор

I got the error while cmake: 

-- Configuring incomplete, errors occurred!

PelinGezerAE
Автор

make command not working in linux mint

ashegupta