Tuesday, June 9, 2015

Build OpenCV 3.0 from source on Ubuntu 14.04


http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/

Check http://sgsai.blogspot.com/search/label/opencv for some errors

Installing OpenCV 3.0.0 on Ubuntu 14.04

In this article, we’ll see how to install the computer vision library OpenCV 3.0.0 alpha, latest release, released two months ago (Ago 21, 2014) , on Ubuntu 14.04 LTS (Trusty Tahr) 64 bits. For those who already have installed previous releases, you’ll see that, basically, nothing has changed and it’s as easy as always. Watch the demonstration video to see how it works.
Notes:
- Tested on Ubuntu 14.04 LTS 64 bits and 32 bits;
- Tested on release 3.0.0 alpha and beta of OpenCV;
Pre-requirements:
- Ubuntu 14.04 LTS 64 bits or 32 bits installed and updated;

Lets get it started!

As I wrote in the pre-requirements, is always nice to have your OS updated. Then, run apt-get update and apt-get upgrade before we really start. For those who already have it done, skip this and don’t forget to comment these lines from the script if you choose to use it.

1st step: Install the Dependencies

To install the dependencies required from OpenCV, just run the following commands:
sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine-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

2nd step: Download OpenCV 3.0.0 alpha

You can download manually or run the commands below to get OpenCV:
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

3rd step: Install OpenCV

Now, we’ll install OpenCV. Cmake command has a lot of options: choose those that better suit your needs and run the commands below. If you’re planning to use Qt 5.x, don’t use -D WITH_QT=ON. Learn how to use OpenCV 3 with Qt Creator 3.2 (Qt 5.3). According to one of the users that tested it on Ubuntu 14.10, you’ll need to use WITH_FFMPEG=OFF.
cd opencv-3.0.0-alpha
mkdir build
cd build
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 ..
make -j $(nproc)
sudo make install

Error with Cuda 8.0 (and OpenCV 3.0)


http://answers.opencv.org/question/95148/cudalegacy-not-compile-nppigraphcut-missing/


4rd step: Finishing installation

To get OpenCV working properly, we need to tell Ubuntu:
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
After all is done I recommend rebooting your system. Done!

http://blog.aicry.com/ubuntu-14-04-install-opencv-with-cuda/

CONFIGURE LIBRARY SEARCH PATH

echo '/usr/local/lib' | sudo tee -a /etc/ld.so.conf.d/opencv.conf  
sudo ldconfig  
printf '# OpenCV\nPKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig\nexport PKG_CONFIG_PATH\n' >> ~/.bashrc  
source ~/.bashrc  

3 comments:

  1. cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_FAST_MATH=ON -D ENABLE_AVX=ON -D ENABLE_AVX2=ON -D ENABLE_FAST_MATH=ON -D ENABLE_SSE41=ON -D ENABLE_SSE42=ON -D ENABLE_SSSE3=ON -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=OFF -D WITH_QT=OFF -D WITH_OPENGL=ON -D WITH_CUBLAS=ON -D BUILD_opencv_python2=ON -D BUILD_opencv_python3=OFF -D OPENCV_EXTRA_MODULES_PATH=/home/hieunguyen/opencv-3.0.0-rc1/opencv_contrib/modules -D BUILD_opencv_adas=OFF -D BUILD_opencv_bgsegm=OFF -D BUILD_opencv_bioinspired=OFF -D BUILD_opencv_ccalib=OFF -D BUILD_opencv_cvv=OFF -D BUILD_opencv_datasets=OFF -D BUILD_opencv_datasettools=OFF -D BUILD_opencv_face=ON -D BUILD_opencv_line_descriptor=OFF -D BUILD_opencv_reg=OFF -D BUILD_opencv_rgbd=OFF -D BUILD_opencv_saliency=OFF -D BUILD_opencv_surface_matching=OFF -D BUILD_opencv_xfeatures2d=OFF -D BUILD_opencv_ximgproc=OFF -D BUILD_opencv_xphoto=OFF -D BUILD_opencv_python2=ON -D BUILD_opencv_python3=OFF ..

    ReplyDelete
  2. OpenCV 3.2 with opencv_contrib

    http://stackoverflow.com/questions/41598755/opencv-test-data-path-environment-variable-was-not-specified-when-installing-o

    ReplyDelete
  3. OpenCV 3.0, Cuda 8.0

    http://answers.opencv.org/question/95148/cudalegacy-not-compile-nppigraphcut-missing/

    ReplyDelete