VisualStudio2017配置OpenCV2

因为有些模块在opencv3中被移除了,需要配置OpenCV2库

去opencv官网下载相对应的版本  我这里下载的是opencv2.41

然后去VS里面添加新属性表(以后就不用每次配置。直接点击添加现有的属性表 找到之前的配置属性表即可)

 

 

选择的模块应与最上面的选项相同,一般选择Debug模式x64位(我这里是为了生成dll文件使用python对C++程序进行调用才设置的Release模式)

 

 

包含目录

D:\opencv2.41\opencv\build\include
D:\opencv2.41\opencv\build\include\opencv
D:\opencv2.41\opencv\build\include\opencv2


库目录
D:\opencv2.41\opencv\build\x64\vc14\lib


链接器->输入

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.lib

以后每次再创建新项目使用相同的库就可以直接点击添加现有的属性表了

 

OpenCV3配置大致相同 但属性表配置不太一致

 

posted @ 2019-01-17 10:50  henu小白  阅读(1451)  评论(0编辑  收藏  举报