ubuntu下opencv和qt的安裝配置

opencv的安裝配置:下載opencv最新版的zip包文件,而後參考http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html html

qt下使用opencv配置:
sudo vim /etc/ld.so.conf.d/opencv.conf,輸入/usr/local/lib(因該和opencv的安裝位置有關)
sudo vim /etc/bash.bashrc,添加export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
linux

還不行,就在qt project的.pro文件中添加:
INCLUDEPATH += /usr/local/include \
                /usr/local/include/opencv \
                /usr/local/include/opencv2
LIBS += /usr/local/lib/libopencv_highgui.so \
        /usr/local/lib/libopencv_core.so    \
        /usr/local/lib/libopencv_imgproc.so
(如有一些函數編譯不經過,多是libs引用的文件不對,最簡單的方法是:
LIBS += /usr/local/lib/libopencv_×.so) vim

相關文章
相關標籤/搜索