Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thanks to berak, I was able to install the current opencv library with the additional opencv_contrib repository on my Ubuntu 14.04 machine.

To build and install the library I performed the following steps:

sudo apt-get update
sudo apt-get upgrade
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 qt5-default libvtk6-dev zlib1g-dev libwebp-dev libpng-dev libtiff5-dev libopenexr-dev libgdal-dev libx264-dev yasm libxine2-dev libeigen3-dev python-tk python3-dev python3-tk python3-numpy ant default-jdk doxygen

mkdir -pv opencv
cd opencv

git clone https://github.com/Itseez/opencv.git
cd opencv/
git pull
cd ..

# opencv contrib
git clone https://github.com/Itseez/opencv_contrib.git
cd opencv_contrib/
git pull
cd ..

cd opencv/
mkdir -pv build
cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D WITH_TBB=ON \
      -D WITH_V4L=ON \
      -D WITH_QT=ON \
      -D WITH_OPENGL=ON \
      -D BUILD_opencv_ximgproc=ON \
      -D BUILD_opencv_python2=ON \
      -D BUILD_opencv_python3=OFF \
      ..

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

These steps are from the install script by Rodrigo Berriel http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/. I adapted them following the very helpful comments by berak http://answers.opencv.org/users/2130/berak/.

After the installation I was able to build some C++ code calling the white balance function from xphoto:

cv::Mat whiteBalanced;
cv::xphoto::balanceWhite(ImageOriginal, whiteBalanced, cv::xphoto::WHITE_BALANCE_SIMPLE);

The code could by compiled:

g++ -g -O2 -W -Wall -Wextra -Werror -pedantic -std=c++11 -I/usr/local/include/ -c main.cpp

and linked:

g++ -W -Wall -Wextra -Werror -pedantic -std=c++11 -o Main.bin main.o -L/usr/local/lib/ -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lopencv_imgcodecs -lopencv_xphoto

Thanks a lot for your help!

Thanks to berak, I was able to install the current opencv library with the additional opencv_contrib repository on my Ubuntu 14.04 machine.

To build and install the library I performed the following steps:

sudo apt-get update
sudo apt-get upgrade
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 qt5-default libvtk6-dev zlib1g-dev libwebp-dev libpng-dev libtiff5-dev libopenexr-dev libgdal-dev libx264-dev yasm libxine2-dev libeigen3-dev python-tk python3-dev python3-tk python3-numpy ant default-jdk doxygen

mkdir -pv opencv
cd opencv

git clone https://github.com/Itseez/opencv.git
cd opencv/
git pull
cd ..

# opencv contrib
git clone https://github.com/Itseez/opencv_contrib.git
cd opencv_contrib/
git pull
cd ..

cd opencv/
mkdir -pv build
cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D WITH_TBB=ON \
      -D WITH_V4L=ON \
      -D WITH_QT=ON \
      -D WITH_OPENGL=ON \
      -D BUILD_opencv_ximgproc=ON \
      -D BUILD_opencv_python2=ON \
      -D BUILD_opencv_python3=OFF \
      ..

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

These steps are from the install script by Rodrigo Berriel http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/. Berriel. I adapted them following the very helpful comments by berak http://answers.opencv.org/users/2130/berak/.berak.

After the installation I was able to build some C++ code calling the white balance function from xphoto:

cv::Mat whiteBalanced;
cv::xphoto::balanceWhite(ImageOriginal, whiteBalanced, cv::xphoto::WHITE_BALANCE_SIMPLE);

The code could by be compiled:

g++ -g -O2 -W -Wall -Wextra -Werror -pedantic -std=c++11 -I/usr/local/include/ -c main.cpp

and linked:

g++ -W -Wall -Wextra -Werror -pedantic -std=c++11 -o Main.bin main.o -L/usr/local/lib/ -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lopencv_imgcodecs -lopencv_xphoto

Thanks a lot for your help!