ubuntu14.04 How to install opencv3.0.0

  • 2020-06-19 12:35:22
  • OfStack

1. Install dependencies

Direct compilation and installation of opencv1 will generally report errors, and the dependent tools need to be installed first.


$ sudo apt-get install build-essential cmake libopencv-dev libgtk2.0-dev pkg-config python-dev python-numpy

2. Download opencv3(either version 1)


$ mkdir ~/opencv
$ cd ~/opencv

$ wget https://github.com/Itseez/opencv/archive/3.0.0-alpha.zip -O opencv-3.0.0-alpha.zip
$ unzip opencv-3.0.0-alpha.zip
$ cd opencv-3.0.0-alpha
//$ wget https://github.com/Itseez/opencv/archive/3.0.0-beta.zip
//$ unzip opencv-3.0.0-beta.zip
//$ cd opencv-3.0.0-beta

$ mkdir release
$ cd release

3. Compile and install


$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_CUDA=OFF .. // An error will be reported if the graphics card is not closed ( -D WITH_CUDA=OFF ) 
$ make -j  // Multi-core processors compile better than the default make only 1 The nuclear fast 
$ sudo make install

4. Configure environment variables


$ sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
$ sudo ldconfig

Related articles: