ubuntu14.04安裝opencv2.4.10

安裝依賴

sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev default-jdk ant libvtk5-qt4-dev

編譯選項

mkdir build
cd build
cmake -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=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_VTK=ON ..

cmake完後會輸出相似configure同樣的信息
確保Java, Python, TBB, OpenGL, V4L, OpenGL and Qt都被檢測到了java

再看一下opencv models: to be built:中的model是否是這些
core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib java python stitching superres ts videostab vizpython

編譯安裝

make
sudo make install

添加library pathweb

sudo gedit /etc/ld.so.conf.d/opencv.conf

內容是opencv的lib的路徑ubuntu

/usr/local/lib

而後ide

sudo ldconfig

參考

http://www.samontab.com/web/2014/06/installing-opencv-2-4-9-in-ubuntu-14-04-lts/ui

相關文章
相關標籤/搜索