September 4,2007 17:16

安裝OpenCV

編譯OpenCV的步驟 (for Linux)

1. 下載OpenCV
http://sourceforge.net/project/showfiles.php?group_id=22870 (opencv-1.0.0.tar.gz 或最新的)

2. 解壓文件
tar zxvf opencv-1.0.0.tar.gz
cd opencv-1.0.0

3. 檢查軟體配置
./configure (執行 ./configure 命令,直到提示"Now run make ..."為止)

4. 編譯OpenCV
make

5.安裝
make install (用root)

6.更新動態連結庫
a . 添加路徑/usr/local/lib到文件/etc/ld.so.conf
b. ldconfig

7. 測試
g++ `pkg-config opencv.pc --libs --cflags opencv` samples/c/drawing.c -o drawing

8. 執行
./drawing

編譯OpenCV的步驟 (for VC6)

1. 下載OpenCV
http://sourceforge.net/project/showfiles.php?group_id=22870

2.配置並設定
http://www.opencv.org.cn/index.php/VC6%E4%B8%8B%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE
a. 檢查C:\Program Files\OpenCV\bin是否已經被加入到環境變數PATH
b. 在VC6裡 , Tools->Option ->Directories 的 Include files 裡加入
C:\Program Files\OpenCV\cxcore\include
C:\Program Files\OpenCV\cv\include
C:\Program Files\OpenCV\cvaux\include
C:\Program Files\OpenCV\ml\include
C:\Program Files\OpenCV\otherlibs\highgui
C:\Program Files\OpenCV\otherlibs\cvcam\include

c.在VC6裡 , Tools->Option ->Directories 的 Library files 裡加入
C:\Program Files\OpenCV\lib

3.編譯OpenCV Sample Code
a. 使用VC6開啟一個新的Console Application 專案.
b. Copy C:\Program Files\OpenCV\samples\c 裡任一Sample Code.
c. 在VC6編譯器裡 Project->Settings->Link 加上
cxcore.lib cv.lib ml.lib cvaux.lib highgui.lib cvcam.lib.
d. 開始編譯專案.



  • yumiwang 發表於樂多回應(1)引用(0)OpenCV編輯本文
    樂多分類:工作/職場切換閱讀版型 │昨日人次:4 │累計人次:5231
     

    引用URL

    http://cgi.blog.roodo.com/trackback/4078973

    回應文章
    Does your website have a contact page? I’m having trouble locating it but, I’d like to shoot you an e-mail. I’ve got some recommendations for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it grow over time.
    | 檢舉 | Posted by Leah at May 20,2014 02:28