由於有些模塊在opencv3中被移除了,須要配置OpenCV2庫python
去opencv官網下載相對應的版本 我這裏下載的是opencv2.41ide
而後去VS裏面添加新屬性表(之後就不用每次配置。直接點擊添加現有的屬性表 找到以前的配置屬性表便可)ui
選擇的模塊應與最上面的選項相同,通常選擇Debug模式x64位(我這裏是爲了生成dll文件使用python對C++程序進行調用才設置的Release模式)3d
包含目錄blog
D:\opencv2.41\opencv\build\include
D:\opencv2.41\opencv\build\include\opencv
D:\opencv2.41\opencv\build\include\opencv2it
庫目錄
D:\opencv2.41\opencv\build\x64\vc14\libopencv
連接器->輸入class
opencv_ml2413d.lib
opencv_calib3d2413d.lib
opencv_contrib2413d.lib
opencv_core2413d.lib
opencv_features2d2413d.lib
opencv_flann2413d.lib
opencv_gpu2413d.lib
opencv_highgui2413d.lib
opencv_imgproc2413d.lib
opencv_legacy2413d.lib
opencv_objdetect2413d.lib
opencv_ts2413d.lib
opencv_video2413d.lib
opencv_nonfree2413d.lib
opencv_ocl2413d.lib
opencv_photo2413d.lib
opencv_stitching2413d.lib
opencv_superres2413d.lib
opencv_videostab2413d.libgui
之後每次再建立新項目使用相同的庫就能夠直接點擊添加現有的屬性表了配置
OpenCV3配置大體相同 但屬性表配置不太一致