Ubuntu Install OpenCV 2.4.13 for QT Guide

# open_cv install version : opencv-2.4.13.3

sudo apt-get install build-essential

sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev

sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

cd ~/OpenCV/opencv-2.4.13.3/
mkdir build
cd build

cmake -D CMAKE_BUILD_TYPE=Release -D MAKE_INSTALL_PREFIX=/usr/local ..
# if building wrong with eigen, run:
cmake -D CMAKE_BUILD_TYPE=Release -D MAKE_INSTALL_PREFIX=/usr/local -D WITH_EIGEN=OFF ..

make

sudo make install

will insatll in /usr/local/include 



# add includes and libs to QT Creater .pro file

INCLUDEPATH += /usr/local/include \
/usr/local/include/opencv \
/usr/local/include/opencv2

# ls /usr/local/lib/libopencv*.so
# then coppy them to .pro file at the end

LIBS += /usr/local/lib/libopencv_calib3d.so \
/usr/local/lib/libopencv_contrib.so \
/usr/local/lib/libopencv_core.so \
/usr/local/lib/libopencv_features2d.so \
/usr/local/lib/libopencv_flann.so \
/usr/local/lib/libopencv_gpu.so \
/usr/local/lib/libopencv_highgui.so \
/usr/local/lib/libopencv_imgproc.so \
/usr/local/lib/libopencv_legacy.so \
/usr/local/lib/libopencv_ml.so \
/usr/local/lib/libopencv_nonfree.so \
/usr/local/lib/libopencv_objdetect.so \
/usr/local/lib/libopencv_ocl.so \
/usr/local/lib/libopencv_photo.so \
/usr/local/lib/libopencv_stitching.so \
/usr/local/lib/libopencv_superres.so \
/usr/local/lib/libopencv_video.so \
/usr/local/lib/libopencv_videostab.so

你可能感兴趣的:(OpenCV)