Warning: Cannot use a scalar value as an array in /home/ryzir/public_html/libraries/cms/html/html.php on line 620

Warning: Cannot use a scalar value as an array in /home/ryzir/public_html/libraries/cms/html/html.php on line 621

Warning: Cannot use a scalar value as an array in /home/ryzir/public_html/libraries/cms/html/html.php on line 622

Warning: Cannot use a scalar value as an array in /home/ryzir/public_html/libraries/cms/html/html.php on line 623

installing opencv 3.2 in ubuntu 16.04

Installing OPENCV 3.2

  1. Prepare your Ubuntu system dependencies by executing this command:

    sudo apt-get install --assume-yes libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip
    # In Ubuntu 16.04, you can resolve dependencies (many are listed below),
    sudo apt-get install build-essential cmake git

    sudo apt-get install ffmpeg libopencv-dev libgtk-3-dev python-numpy python3-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libv4l-dev libtbb-dev qtbase5-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip
  2. Get opncv

    #Download OpenCV from http://opencv.org/downloads.html and unpack
    #or clone it from github (recommended)
    git clone https://github.com/opencv/opencv.git
  3. Enter the unpacked directory. configure and make:

    cd opencv
    mkdir build
    cd build/
    cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
    make

    ** This should completes the building process of OpenCV 3.2.it may the make process does not work with Cuda 7.5/8 and GCC 5 in Ubuntu 16.04. The problem is related to __mempcpy_inline and memcpy in the string.h. To solve this problem one needs to force inlines to CUDA (see this post and this topic for related discussions).So, run :


    cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -DCUDA_NVCC_FLAGS="-D_FORCE_INLINES" ..
    make

    ** if you get an error about CUDA/thrust. Apparently there is a bug with the Thrust version that comes with Cuda 8.0rc as you can see here if you go the the thrust Github and download the latest version and replace the files in your Cuda toolkit folder.(${CUDA_HOME}/include). it builds fine

    git clone https://github.com/thrust/thrust.git
    cd thrust-master/
    sudo cp -r thrust/ /usr/local/cuda-8.0/include/
  4. Installation Using make.Execute the following:


    sudo make install
    sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
    sudo ldconfig
    sudo apt-get update

  5. reboot the system.

    sudo reboot

  6. Using checkinstall:

    #This will create the OpenCV package that has a modern install/uninstall option. While you are in the build directory, execute these commands:

    sudo apt-get install checkinstall
    sudo checkinstall





Tags: UBUNTU, OPENCV, GTX1080, UBUNTU16.04

Add comment


Security code
Refresh

Free WordPress Themes - Download High-quality Templates