close

先下載OpenCV 2.4.10

創建資料夾

例如C:\OpenCV\OpenCV2410\

可以將剛才下載的壓縮檔解壓縮至該目錄下

開啟資料夾 C:\OpenCV\OpenCV2410\opencv\build

以我的筆電64位元, 所以點開x64資料夾

image

C:\OpenCV\OpenCV2410\opencv\build\x64

image

以下為Visual Studio版本分別

  • vc14: The compiler packaged with Visual Studio 2015
  • vc12: The compiler packaged with Visual Studio 2013
  • vc11: The compiler packaged with Visual Studio 2012
  • vc10: The compiler packaged with Visual Studio 2010

如果以Visual Studio 2013為例, 應選擇vc12資料夾, 如下

image

1. lib 資料夾

將資料夾複製或剪下 C:\OpenCV\OpenCV2410\opencv\build\x64\vc12\lib

貼上至 C:\OpenCV\OpenCV2410\lib\x64

其中檔案名稱d結尾, 表示debug版本, 反之為release版本

image

同理, x86依樣畫葫蘆

將資料夾複製或剪下 C:\OpenCV\OpenCV2410\opencv\build\x86\vc12\lib

貼上至 C:\OpenCV\OpenCV2410\lib\x86

image


2. include資料夾

回到目錄C:\OpenCV\OpenCV2410\opencv\build\

將include資料夾複製或剪下

image

貼上至 C:\OpenCV\OpenCV2410, 如下

image

3. bin 資料夾

回到目錄C:\OpenCV\OpenCV2410\opencv\build\x64\vc12\bin

將bin資料夾複製或剪下

image

貼上至 C:\OpenCV\OpenCV2410\bin\x64, 如下

image

同理, x86依樣畫葫蘆

將資料夾複製或剪下 C:\OpenCV\OpenCV2410\opencv\build\x86\vc12\bin

貼上至 C:\OpenCV\OpenCV2410\bin\x86

image

最後可以刪除C:\OpenCV\OpenCV2410\opencv資料夾, 只保留bin, include, lib三個資料夾即可

image

4. 系統變數Path

for 64位元

新增系統變數: OpenCV2410_x64

變數值: C:\OpenCV\OpenCV2410\bin\x64

image

for 32位元

新增系統變數:  OpenCV2410_x86

變數值:  C:\OpenCV\OpenCV2410\bin\x86

image

系統變數Path 增加

%OpenCV2410_x86%

%OpenCV2410_x64%

image







參考資料:

1. What is the difference between vc10, vc11 and vc12 libraries in OpenCV?

2. https://sourceforge.net/projects/opencvlibrary/files/opencv-win/

3. Limitation to the length of the System PATH variable

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 me1237guy 的頭像
    me1237guy

    天天向上

    me1237guy 發表在 痞客邦 留言(0) 人氣()