首先, 先下載安裝OpenCV2.4.10, 安裝方式請參考下面這篇:
Quick Installation for OpenCV 2.4.10 with Visual Studio 2013
版本: Visual Studio 2013 and OpenCV 2.4.10
準備建立四種不同屬性管理員專案,
可以方便以後使用OpenCV2.4.10直接下載使用,
免除重複設定include & library環境
--------------------------------------------------
1. 建立C++ Win32 Console Application
2. 命名colorInRange
記得選DLL
------------------------------------------------------------------
3. 新增屬性專案 VS2013OpenCV2410X86Release.props
滑鼠雙擊VS2013OpenCV2410X86Release進入編輯
include路徑
C:\OpenCV\OpenCV2410\include
C:\OpenCV\OpenCV2410\include\opencv
library路徑
opencv_calib3d2410.lib
opencv_contrib2410.lib
opencv_core2410.lib
opencv_features2d2410.lib
opencv_flann2410.lib
opencv_gpu2410.lib
opencv_highgui2410.lib
opencv_imgproc2410.lib
opencv_legacy2410.lib
opencv_ml2410.lib
opencv_nonfree2410.lib
opencv_objdetect2410.lib
opencv_ocl2410.lib
opencv_photo2410.lib
opencv_stitching2410.lib
opencv_superres2410.lib
opencv_ts2410.lib
opencv_video2410.lib
opencv_videostab2410.lib
--------------------------------------------------
仿照步驟3, 依樣畫葫蘆
4. 新增屬性專案 VS2013OpenCV2410X86Debug.props
滑鼠雙擊VS2013OpenCV2410X86Debug進入編輯
include路徑
C:\OpenCV\OpenCV2410\include
C:\OpenCV\OpenCV2410\include\opencv
library路徑
opencv_calib3d2410d.lib
opencv_contrib2410d.lib
opencv_core2410d.lib
opencv_features2d2410d.lib
opencv_flann2410d.lib
opencv_gpu2410d.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_legacy2410d.lib
opencv_ml2410d.lib
opencv_nonfree2410d.lib
opencv_objdetect2410d.lib
opencv_ocl2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_superres2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
opencv_videostab2410d.lib
--------------------------------------------------
預設 Debug Wind32 | Release Win32 , 接下來建立X64版本
BUILD->Configuration Manager
新增x64版本(從Win32複製一份)
可以看到新增的 Debug x64 | Release x64
新增x64屬性管理, 先刪除剛才複製VS2013OpenCV2410Debug
--------------------------------------------------
仿照步驟3, 點選Debgu | x64, 滑鼠右鍵點選Add New Project Property Sheet
5. 新增屬性專案 VS2013OpenCV2410X64Debug.props
include路徑
C:\OpenCV\OpenCV2410\include
C:\OpenCV\OpenCV2410\include\opencv
library路徑
opencv_calib3d2410d.lib
opencv_contrib2410d.lib
opencv_core2410d.lib
opencv_features2d2410d.lib
opencv_flann2410d.lib
opencv_gpu2410d.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_legacy2410d.lib
opencv_ml2410d.lib
opencv_nonfree2410d.lib
opencv_objdetect2410d.lib
opencv_ocl2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_superres2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
opencv_videostab2410d.lib
--------------------------------------------------
6. 新增屬性專案 VS2013OpenCV2410X64Release.props
新增x64屬性管理, 先刪除剛才複製VS2013OpenCV2410Release
Add New Project Property Sheet
include路徑
C:\OpenCV\OpenCV2410\include
C:\OpenCV\OpenCV2410\include\opencv
library路徑
opencv_calib3d2410.lib
opencv_contrib2410.lib
opencv_core2410.lib
opencv_features2d2410.lib
opencv_flann2410.lib
opencv_gpu2410.lib
opencv_highgui2410.lib
opencv_imgproc2410.lib
opencv_legacy2410.lib
opencv_ml2410.lib
opencv_nonfree2410.lib
opencv_objdetect2410.lib
opencv_ocl2410.lib
opencv_photo2410.lib
opencv_stitching2410.lib
opencv_superres2410.lib
opencv_ts2410.lib
opencv_video2410.lib
opencv_videostab2410.lib
--------------------------------------------------
經過以上設定可以得到, 四個設定好的屬性管理員
版本: Visual Studio 2013 and OpenCV 2.4.10
可以方便以後使用OpenCV2.4.10直接下載使用,
免除重複設定include & library環境
--------------------------------------------------
參考資料:
1. Quick Installation for OpenCV 2.4.10 with Visual Studio 2013
留言列表